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

WPF Diagram Designer - Part 2

, 8 Oct 2008 CPOL
Designer Canvas with Zoombox
DiagramDesignerPart2.zip
DiagramDesigner
Adorners
bin
Debug
DiagramDesigner.exe
DiagramDesigner.csproj.user
Images
attention.png
chart1.png
chart2.png
chart3.png
cross.png
mail.png
new.png
newBold.png
nuclear.png
plus.png
ring.png
rotateLeft.png
rotateRight.png
rt1.png
rt2.png
rt3.png
rt4.png
rt5.png
rt6.png
software.png
walk.png
world.png
Properties
Settings.settings
Resources
Stencils
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:s="clr-namespace:DiagramDesigner">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="ResizeChrome.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <ControlTemplate x:Key="MoveThumbTemplate"
                     TargetType="{x:Type s:MoveThumb}">
        <Rectangle Fill="Transparent" />
    </ControlTemplate>

    <Style TargetType="{x:Type s:DesignerItem}">
        <Setter Property="MinHeight"
                Value="50" />
        <Setter Property="MinWidth"
                Value="50" />
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type s:DesignerItem}">
                    <Grid DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=.}">
                        <s:MoveThumb x:Name="PART_MoveThumb"
                                     Cursor="SizeAll"
                                     Template="{StaticResource MoveThumbTemplate}" />
                        <ContentPresenter x:Name="PART_ContentPresenter"
                                          Content="{TemplateBinding ContentControl.Content}"
                                          Margin="{TemplateBinding Padding}" />
                        <s:ResizeDecorator x:Name="PART_DesignerItemDecorator" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected"
                                 Value="True">
                            <Setter TargetName="PART_DesignerItemDecorator"
                                    Property="ShowDecorator"
                                    Value="True" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>

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 | Mobile
Web03 | 2.8.141022.2 | Last Updated 8 Oct 2008
Article Copyright 2008 by sukram
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid