Click here to Skip to main content
15,886,137 members
Articles / Desktop Programming / Windows Forms

User Settings Applied

Rate me:
Please Sign up or sign in to vote.
4.95/5 (136 votes)
5 Sep 2013CPOL10 min read 542.1K   7.5K   489  
Simplifying the .NET User Configuration for Windows Forms and WPF
<win:BaseWindow
  x:Class="Itenso.Solutions.Community.ConfigurationWindowsDemo.DerivedSettingsWindow"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:win="clr-namespace:Itenso.Solutions.Community.ConfigurationWindowsDemo"
  Icon="/ConfigurationWindowsDemo;component/App.ico"
  Title="User Settings Applied - WPF Derived Window"
  Height="300"
  Width="400"
  MinWidth="300"
  MinHeight="250">
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition
        Height="Auto" />
      <RowDefinition />
    </Grid.RowDefinitions>
    <TextBlock
      Grid.Row="0"
      FontSize="14"
      Padding="5"
      Background="Silver"
      TextWrapping="Wrap">
      This Window is derived from BaseWindow.<LineBreak/><LineBreak />Please change Window Location/Size/State and re-open the window
    </TextBlock>
    <Grid
      Grid.Row="1">
      <Grid.RowDefinitions>
        <RowDefinition
          Height="Auto" />
        <RowDefinition
          Height="Auto" />
        <RowDefinition
          Height="Auto" />
        <RowDefinition
          Height="Auto" />
        <RowDefinition
          Height="Auto" />
      </Grid.RowDefinitions>
      <CheckBox
        x:Name="Option1"
        Grid.Row="0"
        Margin="5"
        Content="Option 1" />
      <CheckBox
        x:Name="Option2"
        Grid.Row="1"
        Margin="5"
        Content="Option 2" />
      <CheckBox
        x:Name="Option3"
        Grid.Row="2"
        Margin="5"
        Content="Option 3 (excluded)" />
      <Grid
        Grid.Row="3">
        <Grid.ColumnDefinitions>
          <ColumnDefinition 
            Width="Auto"/>
          <ColumnDefinition
            Width="Auto" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition
            Height="Auto" />
          <RowDefinition
            Height="Auto" />
          <RowDefinition
            Height="Auto" />
        </Grid.RowDefinitions>
        <Label
          Grid.Row="0"
          Grid.Column="0"
          Content="Input 1:" />
        <TextBox
          Grid.Row="0"
          Grid.Column="1"
          x:Name="Edit1"
          MinWidth="100" />
        <Label
          Grid.Row="1"
          Grid.Column="0"
          Content="Input 2:" />
        <TextBox
          Grid.Row="1"
          Grid.Column="1"
          x:Name="Edit2"
          MinWidth="100" />
        <Label
          Grid.Row="2"
          Grid.Column="0"
          Content="Input 3 (excluded):" />
        <TextBox
          Grid.Row="2"
          Grid.Column="1"
          x:Name="Edit3"
          MinWidth="100" />
      </Grid>
    </Grid>
  </Grid>
</win:BaseWindow>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Switzerland Switzerland
👨 Senior .NET Software Engineer

🚀 My Open Source Projects
- Time Period Library 👉 GitHub
- Payroll Engine 👉 GitHub

Feedback and contributions are welcome.



Comments and Discussions