0

I have a Grid with the Background property set like this:

  <Grid x:Name="PaginaMain" Background="#FFD39448">

I wanted to enter the color code through code behind, with c #. how can I do?

I tried it, but it is not the right way

PaginaMain.Background = # FFD39448;
SMM
  • 201
  • 1
  • 9
  • Please take a quick look at [documentation](https://msdn.microsoft.com/en-us/library/windows/apps/xaml/windows.ui.xaml.controls.panel.background.aspx). – Romasz Mar 12 '15 at 19:29
  • That is a color. You need a brush. In XAML do it as a resource. – paparazzo Mar 12 '15 at 19:29

1 Answers1

1
PaginaMain.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0xD3, 0x94, 0x48));
cbr
  • 12,563
  • 3
  • 38
  • 63