Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

WPF Diagram Designer - Part 3

, 29 Feb 2008 CPOL
Connecting items
<Window x:Class="DiagramDesigner.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:s="clr-namespace:DiagramDesigner"
        xmlns:c="clr-namespace:DiagramDesigner.Controls"
        WindowStartupLocation="CenterScreen"
        SnapsToDevicePixels="True"
        Title="Diagram Designer"        
        Height="750" Width="950">
  <Window.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Resources/DesignerItem.xaml"/>
        <ResourceDictionary Source="Resources/ToolboxItem.xaml"/>
        <ResourceDictionary Source="Resources/Toolbox.xaml"/>
        <ResourceDictionary Source="Resources/Connection.xaml"/>
        <ResourceDictionary Source="Resources/Stencils/FlowChartStencils.xaml"/>
        <ResourceDictionary Source="Resources/Stencils/ShapeStencils.xaml"/>
        <ResourceDictionary Source="Resources/Stencils/SymbolStencils.xaml"/>
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
  </Window.Resources>
  <Grid>
    <Grid Margin="10">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="265"/>
        <ColumnDefinition/>
      </Grid.ColumnDefinitions>
      <!-- Toolbox -->
      <StackPanel Grid.Column="0" Margin="0,0,5,0">
        <Expander Header="Symbols" Content="{StaticResource SymbolStencils}" IsExpanded="True" />
        <Expander Header="Flow Chart" Content="{StaticResource FlowChartStencils}" IsExpanded="True"/>        
        <Expander Header="Shapes" Content="{StaticResource ShapeStencils}" IsExpanded="False" />
      </StackPanel>
      <!-- GridSplitter -->
      <GridSplitter Focusable="False" Width="2" Background="{StaticResource LightBorderBrush}"
                    VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
      <!-- Designer -->
      <GroupBox Header="Designer" Grid.Column="1" Margin="3,0,0,0" Background="Transparent">
        <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
          <s:DesignerCanvas Background="Transparent" Margin="10"/>
        </ScrollViewer>
      </GroupBox>
    </Grid>
  </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)

Share

About the Author

sukram

Austria Austria
No Biography provided

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141223.1 | Last Updated 29 Feb 2008
Article Copyright 2008 by sukram
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid