Browse Source

Style for GridSplitter, apply translation property s

pull/19/head
PeterForstmeier 15 years ago
parent
commit
910d2b0ff3
  1. 1
      src/AddIns/Analysis/CodeQuality/CodeQualityAnalysis.csproj
  2. 8
      src/AddIns/Analysis/CodeQuality/Resources/GridSplitterTemplate.xaml
  3. 10
      src/AddIns/Analysis/CodeQuality/Src/Controls/TreeMatrixControl.xaml
  4. 69
      src/AddIns/Analysis/CodeQuality/Src/MainWindow.xaml
  5. 4
      src/AddIns/Analysis/CodeQuality/Src/MainWindowTranslationModel.cs

1
src/AddIns/Analysis/CodeQuality/CodeQualityAnalysis.csproj

@ -146,6 +146,7 @@
<Compile Include="Src\Utility\Matrix.cs" /> <Compile Include="Src\Utility\Matrix.cs" />
<Compile Include="Src\Utility\RelayCommand.cs" /> <Compile Include="Src\Utility\RelayCommand.cs" />
<Compile Include="Src\Utility\ViewModelBase.cs" /> <Compile Include="Src\Utility\ViewModelBase.cs" />
<Page Include="Resources\GridSplitterTemplate.xaml" />
<Page Include="Resources\GraphTemplate.xaml"> <Page Include="Resources\GraphTemplate.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>

8
src/AddIns/Analysis/CodeQuality/Resources/GridSplitterTemplate.xaml

@ -0,0 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<Style x:Key="GridSplitterStyle1" TargetType="{x:Type GridSplitter}">
<Setter Property="Background" Value="LightGray"></Setter>
<Setter Property="Width" Value="3"></Setter>
</Style>
</ResourceDictionary>

10
src/AddIns/Analysis/CodeQuality/Src/Controls/TreeMatrixControl.xaml

@ -42,7 +42,8 @@
Grid.RowSpan="3" Grid.RowSpan="3"
ResizeDirection="Columns" ResizeDirection="Columns"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"></GridSplitter> VerticalAlignment="Stretch"
Style="{DynamicResource GridSplitterStyle1}"></GridSplitter>
<tree:SharpTreeView <tree:SharpTreeView
Name="topTree" Name="topTree"
@ -54,12 +55,11 @@
</tree:SharpTreeView.LayoutTransform> </tree:SharpTreeView.LayoutTransform>
</tree:SharpTreeView> </tree:SharpTreeView>
<GridSplitter Grid.Row="1" <GridSplitter Grid.Row="1" Grid.Column="2"
Grid.Column="2"
Height="3" Height="3"
ResizeDirection="Rows" ResizeDirection="Rows"
HorizontalAlignment="Stretch"></GridSplitter> HorizontalAlignment="Stretch"
Background="LightGray"></GridSplitter>
<ScrollViewer <ScrollViewer
Grid.Column="2" Grid.Column="2"
Grid.Row="2" Grid.Row="2"

69
src/AddIns/Analysis/CodeQuality/Src/MainWindow.xaml

@ -25,42 +25,8 @@ DataContext="{Binding RelativeSource={RelativeSource Self}}"
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Resources/GraphTemplate.xaml" /> <ResourceDictionary Source="../Resources/GraphTemplate.xaml" />
<ResourceDictionary Source="../Resources/GridSplitterTemplate.xaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<!--
<DataTemplate x:Key="MemberTemplate">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding Path=Icon}" Margin="0, 0, 5, 0" />
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</DataTemplate>
<HierarchicalDataTemplate x:Key="TypeTemplate"
ItemTemplate="{StaticResource MemberTemplate}"
ItemsSource="{Binding Members}">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding Path=Icon}" Margin="0, 0, 5, 0" />
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate x:Key="NamespaceTemplate"
ItemsSource="{Binding Types}"
ItemTemplate="{StaticResource TypeTemplate}">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding Path=Icon}" Margin="0, 0, 5, 0" />
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Namespaces}"
ItemTemplate="{StaticResource NamespaceTemplate}"
x:Key="ModuleTemplate">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding Path=Icon}" Margin="0, 0, 5, 0" />
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</HierarchicalDataTemplate>
-->
</ResourceDictionary> </ResourceDictionary>
</Window.Resources> </Window.Resources>
@ -73,19 +39,15 @@ DataContext="{Binding RelativeSource={RelativeSource Self}}"
<ToolBarTray Background="White" Grid.Row="0"> <ToolBarTray Background="White" Grid.Row="0">
<ToolBar> <ToolBar>
<Button Name="btnOpenAssembly" <Button Name="btnOpenAssembly"
Content="{Binding OpenAssembly}" Content="{Binding OpenAssembly}"
Click="btnOpenAssembly_Click" Click="btnOpenAssembly_Click"
Margin="0 0 5 0"></Button> Margin="0 0 5 0"></Button>
<!--
<Button Command="{Binding Path=OpenAssemblyCommand}" Margin="0 0 5 0">Open Assembly</Button>
-->
</ToolBar> </ToolBar>
</ToolBarTray> </ToolBarTray>
<TabControl Grid.Row="1" Name="mainTabs" IsEnabled="False"> <!-- It is enabled once assembly is loaded. --> <TabControl Grid.Row="1" Name="mainTabs" IsEnabled="False"> <!-- It is enabled once assembly is loaded. -->
<TabItem Header="Dependency Graph"> <TabItem Header="{Binding DependencyGraph}">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@ -94,11 +56,13 @@ DataContext="{Binding RelativeSource={RelativeSource Self}}"
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="250px" /> <ColumnDefinition Width="250px" />
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition /> <ColumnDefinition />
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="200px" /> <ColumnDefinition Width="200px" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<ToolBarTray Background="White" Grid.Row="0" Grid.ColumnSpan="2"> <ToolBarTray Background="White" Grid.Row="0" Grid.ColumnSpan="3">
<ToolBar> <ToolBar>
<Button Name="btnRelayout" Click="btnRelayout_Click" Margin="0 0 5 0">Relayout</Button> <Button Name="btnRelayout" Click="btnRelayout_Click" Margin="0 0 5 0">Relayout</Button>
<Button Name="btnContinueLayout" Click="btnContinueLayout_Click" Margin="0 0 5 0">Continue Layout</Button> <Button Name="btnContinueLayout" Click="btnContinueLayout_Click" Margin="0 0 5 0">Continue Layout</Button>
@ -110,11 +74,19 @@ DataContext="{Binding RelativeSource={RelativeSource Self}}"
<tree:SharpTreeView Name="definitionTree" <tree:SharpTreeView Name="definitionTree"
Grid.Row="1" Grid.Column="0" Grid.Row="1" Grid.Column="0"
Margin="2"
SelectionChanged="definitionTree_SelectedItemChanged"> SelectionChanged="definitionTree_SelectedItemChanged">
</tree:SharpTreeView> </tree:SharpTreeView>
<Controls:ZoomControl Grid.Row="1" Grid.Column="1" Name="zoom" AlwaysShowZoomButtons="True" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible"> <GridSplitter Grid.Column="1"
Grid.Row="1"
Grid.RowSpan="2"
ResizeDirection="Columns"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Style="{DynamicResource GridSplitterStyle1}"></GridSplitter>
<Controls:ZoomControl Grid.Row="1" Grid.Column="2" Name="zoom" AlwaysShowZoomButtons="True" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible">
<Graph:DependencyGraphLayout x:Name="graphLayout" <Graph:DependencyGraphLayout x:Name="graphLayout"
LayoutAlgorithmType="LinLog" LayoutAlgorithmType="LinLog"
OverlapRemovalAlgorithmType="FSA" OverlapRemovalAlgorithmType="FSA"
@ -123,7 +95,16 @@ DataContext="{Binding RelativeSource={RelativeSource Self}}"
/> />
</Controls:ZoomControl> </Controls:ZoomControl>
<TextBlock Name="txbTypeInfo" Grid.Column="3" Grid.Row="1"/> <GridSplitter Grid.Column="3"
Grid.RowSpan="2"
ResizeDirection="Columns"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Style="{DynamicResource GridSplitterStyle1}"></GridSplitter>
<TextBlock Name="txbTypeInfo"
Margin="2"
Grid.Column="4" Grid.RowSpan="2" Padding="5" Background="LightBlue"/>
</Grid> </Grid>
</TabItem> </TabItem>
<TabItem Header="Dependency Matrix"> <TabItem Header="Dependency Matrix">

4
src/AddIns/Analysis/CodeQuality/Src/MainWindowTranslationModel.cs

@ -26,13 +26,15 @@ namespace ICSharpCode.CodeQualityAnalysis
public MainWindowTranslationViewModel():base() public MainWindowTranslationViewModel():base()
{ {
this.Title = "Code Quality Analysis"; this.Title = "Code Quality Analysis";
this.OpenAssembly = "OpenAssembly"; this.OpenAssembly = "Open Assembly";
this.DependencyGraph = "Dependency Graph";
} }
public string Title {get;private set;} public string Title {get;private set;}
public string OpenAssembly {get; private set;} public string OpenAssembly {get; private set;}
public string DependencyGraph {get; private set;}
#region OpenAssembly #region OpenAssembly
/* /*

Loading…
Cancel
Save