Reputation: 1767
I have a noob question =P How can I programatically add a canvas to a grid? When I use
Canvas _canvas = new Canvas( )
{
Name = "newCanvas",
Visibility = System.Windows.Visibility.Visible,
Margin = new Thickness( 100, 0, 0, 100 ),
Width = 100000,
Height = 100000,
Background = new SolidColorBrush { Color = new Color { R = 255, G = 255, B = 255, A = 1 } }
};
and then say LayoutRoot.Children.Add( _canvas );
nothing happens. What should I do?
Upvotes: 0
Views: 692