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

1 posts, 0 answers
  1. William
    William avatar
    14 posts
    Member since:
    Jan 2010

    Posted 29 Jun 2011 Link to this post

    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?
                     

Back to Top