Click here to Skip to main content
15,893,904 members
Articles / Desktop Programming / WPF

WPF Form Designer Prototype (MVVM)

Rate me:
Please Sign up or sign in to vote.
4.83/5 (31 votes)
3 Apr 2013CPOL9 min read 79.6K   3.4K   108  
Form designer with editable display properties and bindings. Generates XAML forms.
<Window x:Class="WPFFormDesigner.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ViewModels="clr-namespace:WPFFormDesigner.ViewModels" xmlns:WPFFormDesigner="clr-namespace:WPFFormDesigner" Title="MainWindow">
        <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1.5*"/>
            <ColumnDefinition Width="6*"/>
            <ColumnDefinition Width="2.5*"/>
        </Grid.ColumnDefinitions>
    <!--<DockPanel Name="dockPanel1" >-->
        <Menu Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
            <MenuItem Header="_File">
                <MenuItem Header="_Open..." Command="{Binding Path=OpenFormFromFileCommand}"/>
                <MenuItem Header="_New" Command="{Binding Path=NewFormCommand}"/>
                <!--<MenuItem Header="_Close" Command="{Binding Path=CloseFormCommand}"/>-->
                <MenuItem Header="_Save" Command="{Binding Path=SaveFormCommand}"/>
            </MenuItem>
        </Menu>
        <WPFFormDesigner:FormDesignerSurface DataContext="{Binding Path=FormDesignerSurfaceVM,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Grid.Column="1"/>
        <WPFFormDesigner:ToolboxView  Grid.Row="1" Grid.Column="0"/>
        <WPFFormDesigner:PropertiesView DataContext="{Binding Path=PropertiesVM,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Grid.Column="2"/>
    <!--</DockPanel>-->
    </Grid>
</Window>

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
United States United States
Sr. application developer currently developing desktop and web applications for the specialty insurance sector. Data integration specialist, interested in learning the latest .Net technologies.

Comments and Discussions