Click here to Skip to main content
13,345,744 members (49,488 online)
Click here to Skip to main content

Stats

513.4K views
18.3K downloads
551 bookmarked
Posted 24 Feb 2008

WPF Diagram Designer - Part 3

, 29 Feb 2008
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

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.180111.1 | Last Updated 29 Feb 2008
Article Copyright 2008 by sukram
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid