Click here to Skip to main content
15,886,798 members
Articles / Desktop Programming / WPF

200% Reflective Class Diagram Creation Tool

Rate me:
Please Sign up or sign in to vote.
4.92/5 (200 votes)
20 Feb 2014CPOL22 min read 579.8K   11.5K   437  
WPF: Version II of my 100% Reflective class diagram creation tool.
<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="SUT.PrintEngine.Controls.ProgressDialog.ProgressDialogView"
    BorderThickness="0"
    Padding="0"
    Margin="0"
    MinWidth="500"   
    Height="Auto"
    Background="Transparent">
    <UserControl.Resources>
        <Style x:Key="{x:Type Thumb}" TargetType="{x:Type Thumb}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="2" Background="Transparent">
                            <TextBlock Text="{TemplateBinding Tag}" Width="Auto" Foreground="Black" FontSize="13" FontFamily="Arial" FontWeight="Bold" Margin="5,0,0,0" TextAlignment="Left" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <StackPanel Orientation="Vertical" Width="Auto" Height="Auto">
        <Border Background="White" BorderThickness="1" BorderBrush="Gray" Margin="12" CornerRadius="12" x:Name="Container">
            <Border.BitmapEffect>
                <DropShadowBitmapEffect Color="Black" Direction="320"
                  ShadowDepth="2"
                  Softness="0.5"
                  Opacity="0.5"/>
            </Border.BitmapEffect>
            <DockPanel>
                <Border DockPanel.Dock="Top" Height="34" Margin="0,3,0,0" Padding="0,4,0,0" CornerRadius="0.12" HorizontalAlignment="Stretch">
                    <Grid>
                        <Grid.Background>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                <GradientStop Color="#FFFFFF" Offset="0.0" />
                                <GradientStop Color="#f0f0f0" Offset="1.0" />
                            </LinearGradientBrush>
                        </Grid.Background>
                        <Button Style="{DynamicResource CloseButtonStyle}"  Command="{Binding CancelCommand}" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5,0,9,3" Background="#FFC8C8C8" Cursor="Hand"  Visibility="{Binding CancelButtonVisibility}" Width="25" Height="25" BorderBrush="#FF585858"/>
                        <TextBlock VerticalAlignment="Center" FontFamily="Arial" FontSize="13" Foreground="#313438" FontWeight="Bold" Margin="7,0" HorizontalAlignment="Left" Text="{Binding DialogTitle}"></TextBlock>
                    </Grid>
                </Border>
                <Border DockPanel.Dock="Top" Height="1" BorderThickness="1" BorderBrush="#CCCCCC" Margin="0,1,0,0" />
                <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                    <Border Margin="10" Background="#f0f2f2" CornerRadius="7" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                        <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                                <TextBlock FontFamily="Arial" FontSize="12" FontWeight="Bold" Margin="0,30,0,5"  Foreground="#272727" HorizontalAlignment="Center" Text="{Binding Message}" />                                
                            </StackPanel>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition />
                                    <RowDefinition />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="10*" />
                                    <ColumnDefinition Width="80*" />
                                    <ColumnDefinition Width="10*" />
                                </Grid.ColumnDefinitions>
                                <TextBlock Grid.Row="0" Grid.Column="1" FontFamily="Arial" FontSize="12" FontWeight="Bold" Margin="0,30,0,5"  Foreground="#272727" HorizontalAlignment="Left" Text="{Binding ProgressText}" />
                                <Border Height="25" Grid.Row="1" Grid.Column="1" CornerRadius="10" BorderThickness="1" BorderBrush="#bac6c6">
                                    <ProgressBar x:Name="PBar" Maximum="{Binding MaxProgressValue}" Value="{Binding CurrentProgressValue}"  Background="White" Foreground="#7dc402"  Margin="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsIndeterminate="False"/>
                                </Border>
                                <Button x:Name="CancelButton" Cursor="Hand" Style="{DynamicResource DefaultButtonStyle}" Command="{Binding CancelCommand}" Content="{Binding CancelButtonCaption}" Margin="0,10,0,0" Grid.Row="2" Grid.Column="1" Width="80" Height="30" Visibility="{Binding CancelButtonVisibility}"/>
                            </Grid>                            
                            <Grid Margin="0,30,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="10" />
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="10" />
                                </Grid.ColumnDefinitions>
                                <Border Height="Auto" Grid.Column="1" BorderThickness="1">
                                    <StackPanel Orientation="Vertical">
                                        <Border Background="#d2dadd" Height="0.5" />
                                        <Border Background="White" Height="0.5" />
                                    </StackPanel>
                                </Border>
                            </Grid>
                        </StackPanel>
                    </Border>
                </DockPanel>
            </DockPanel>
        </Border>
    </StackPanel>
</UserControl>

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)
United Kingdom United Kingdom
I currently hold the following qualifications (amongst others, I also studied Music Technology and Electronics, for my sins)

- MSc (Passed with distinctions), in Information Technology for E-Commerce
- BSc Hons (1st class) in Computer Science & Artificial Intelligence

Both of these at Sussex University UK.

Award(s)

I am lucky enough to have won a few awards for Zany Crazy code articles over the years

  • Microsoft C# MVP 2016
  • Codeproject MVP 2016
  • Microsoft C# MVP 2015
  • Codeproject MVP 2015
  • Microsoft C# MVP 2014
  • Codeproject MVP 2014
  • Microsoft C# MVP 2013
  • Codeproject MVP 2013
  • Microsoft C# MVP 2012
  • Codeproject MVP 2012
  • Microsoft C# MVP 2011
  • Codeproject MVP 2011
  • Microsoft C# MVP 2010
  • Codeproject MVP 2010
  • Microsoft C# MVP 2009
  • Codeproject MVP 2009
  • Microsoft C# MVP 2008
  • Codeproject MVP 2008
  • And numerous codeproject awards which you can see over at my blog

Comments and Discussions