This is a migrated thread and some comments may be shown as answers.

How do you set internal Canvas settings in the C# code?

0 Answers 34 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 29 Jun 2011, 06:25 PM

How do you set internal Canvas settings in the C# code?

This question requires some detail explaination. So here it is. In one of my XAML files I have a Grid. The grid is defined something like this:

<Grid Background="White" x:Name="LayoutRoot" Canvas.Left="0" Canvas.Top="0">

Now, at runtime, I have found, I can reposition objects in the C# code if I want:

LayoutRoot = (Grid)appCanvas.FindName("LayoutRoot");
LayoutRoot.Height = App.Current.Host.Content.ActualHeight;
LayoutRoot.Width = App.Current.Host.Content.ActualWidth;

Pretty cool, huh? I can make the grid the same size of the browser window if I want. But how would I set this "Canvas" setting in the grid that is defined in the XAML code?
                 

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
William
Top achievements
Rank 1
Share this question
or