C# XAML Layouts

There are several layout controls to choose from when designing your Windows application. For example, if you are designing an About window you may wish to use the Grid control. You could define several rows. The top row will be reserved for a logo and program name information and may use a Canvas control. The row will have a fixed height. The next row could give a one-line description of copyright information. It will contain a Canvas control with a Label control. It will also be a fixed height. The third row could have a few Label controls and Text Blocks and will not have a fixed height. The last row could have a fixed height and only display a Close button.

Several examples of layouts can be written in a Visual Studio Solution that contains one Project.

Each example runs in its own window. In order to run each of the windows you need to change the StarupUri in the App.xaml file. The App.xaml file is shown below.

<Application x:Class="LayoutExamples.App"
    <!-- Edit the StartupUri in App.xaml to see each of the examples 

Leave a comment

Your email address will not be published. Required fields are marked *