More styling work, fixed automapper issue

This commit is contained in:
Ben 2015-07-01 22:26:00 +01:00
parent 3a628df744
commit 440254f3f8
16 changed files with 469 additions and 44 deletions

View File

@ -7,16 +7,13 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Fluent;Component/Themes/Generic.xaml" />
<ResourceDictionary Source="pack://application:,,,/Fluent;component/Themes/windows8/silver.xaml" />
<ResourceDictionary Source="Views/Styles/Colours.xaml" />
<ResourceDictionary Source="Views/Styles/CheckBox.xaml" />
<ResourceDictionary Source="Views/Styles/ListBoxItem.xaml" />
<ResourceDictionary Source="Views/Styles/TreeViewItem.xaml" />
<ResourceDictionary Source="Views/CrossButton.xaml" />
<ResourceDictionary Source="Views/IconsDictionary.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
<!--<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Steel.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />-->

View File

@ -1,11 +1,14 @@
using System.Linq;
using System.IO.Compression;
using System.Linq;
using System.Windows;
using AutoMapper;
using Castle.Facilities.TypedFactory;
using Castle.MicroKernel.ModelBuilder.Inspectors;
using Castle.Windsor;
using Castle.Windsor.Installer;
using Filtration.ObjectModel;
using Filtration.Properties;
using Filtration.ViewModels;
using Filtration.Views;
namespace Filtration
@ -30,12 +33,34 @@ namespace Filtration
Mapper.Configuration.ConstructServicesUsing(_container.Resolve);
Mapper.CreateMap<ItemFilterBlockGroup, ItemFilterBlockGroupViewModel>()
.ForMember(destination => destination.ChildGroups, options => options.ResolveUsing(
delegate(ResolutionResult resolutionResult)
{
var context = resolutionResult.Context;
var showAdvanced = (bool) context.Options.Items["showAdvanced"];
var group = (ItemFilterBlockGroup) context.SourceValue;
if (showAdvanced)
return group.ChildGroups;
else
return group.ChildGroups.Where(c => c.Advanced == false);
}))
.ForMember(dest => dest.SourceBlockGroup,
opts => opts.MapFrom(from => from))
.ForMember(dest => dest.IsExpanded,
opts => opts.UseValue(false));
Mapper.AssertConfigurationIsValid();
var mainWindow = _container.Resolve<IMainWindow>();
mainWindow.Show();
}
public void TestTest()
{
}
protected override void OnExit(ExitEventArgs e)
{
_container.Dispose();

View File

@ -0,0 +1,51 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
namespace Filtration.Converters
{
public class TreeViewMarginConverter : IValueConverter
{
public double Length { get; set; }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var item = value as TreeViewItem;
if (item == null)
return new Thickness(0);
return new Thickness(Length * item.GetDepth(), 0, 0, 0);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return DependencyProperty.UnsetValue;
}
}
public static class TreeViewItemExtensions
{
public static int GetDepth(this TreeViewItem item)
{
TreeViewItem parent;
while ((parent = GetParent(item)) != null)
{
return GetDepth(parent) + 1;
}
return 0;
}
private static TreeViewItem GetParent(TreeViewItem item)
{
var parent = item != null ? VisualTreeHelper.GetParent(item) : null;
while (parent != null && !(parent is TreeViewItem || parent is TreeView))
{
parent = VisualTreeHelper.GetParent(parent);
}
return parent as TreeViewItem;
}
}
}

View File

@ -132,6 +132,7 @@
<Compile Include="Converters\ItemRarityConverter.cs" />
<Compile Include="Converters\BooleanVisibilityConverter.cs" />
<Compile Include="Converters\StringToVisibilityConverter.cs" />
<Compile Include="Converters\TreeViewMarginConverter.cs" />
<Compile Include="Extensions\EnumerationExtension.cs" />
<Compile Include="Extensions\HyperlinkExtensions.cs" />
<Compile Include="Properties\Annotations.cs" />
@ -177,6 +178,10 @@
<Compile Include="Views\SettingsPageView.xaml.cs">
<DependentUpon>SettingsPageView.xaml</DependentUpon>
</Compile>
<Page Include="Views\Styles\ListBoxItem.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="Views\ToolPanes\BlockGroupBrowserView.xaml.cs">
<DependentUpon>BlockGroupBrowserView.xaml</DependentUpon>
</Compile>
@ -232,6 +237,18 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Styles\CheckBox.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Styles\Colours.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Styles\TreeViewItem.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ToolPanes\BlockGroupBrowserView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>

View File

@ -50,7 +50,7 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.3.*")]
[assembly: AssemblyVersion("0.4.*")]
[assembly: InternalsVisibleTo("Filtration.Tests")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]

View File

@ -1,5 +1,6 @@
using System.Collections.ObjectModel;
using System.Linq;
using System.Net.Mime;
using AutoMapper;
using Filtration.ObjectModel;
using Filtration.ViewModels;
@ -18,27 +19,7 @@ namespace Filtration.Utilities
ObservableCollection<ItemFilterBlockGroup> blockGroups, bool showAdvanced)
{
//Mapper.Reset();
if (showAdvanced)
{
Mapper.CreateMap<ItemFilterBlockGroup, ItemFilterBlockGroupViewModel>()
.ForMember(dest => dest.IsChecked,
opts => opts.MapFrom(from => from.IsChecked))
.ForMember(dest => dest.SourceBlockGroup,
opts => opts.MapFrom(from => from));
}
else
{
Mapper.CreateMap<ItemFilterBlockGroup, ItemFilterBlockGroupViewModel>()
.ForMember(dest => dest.IsChecked,
opts => opts.MapFrom(from => from.IsChecked))
.ForMember(dest => dest.ChildGroups,
opts => opts.MapFrom(from => from.ChildGroups.Where(c => c.Advanced == false)))
.ForMember(dest => dest.SourceBlockGroup,
opts => opts.MapFrom(from => from));
}
var mappedViewModels = Mapper.Map<ObservableCollection<ItemFilterBlockGroupViewModel>>(blockGroups);
var mappedViewModels = Mapper.Map<ObservableCollection<ItemFilterBlockGroupViewModel>>(blockGroups, opts => opts.Items["showAdvanced"] = showAdvanced);
AutoMapperHelpers.ItemFilterBlockGroupViewModelPostMap(mappedViewModels.First());
return mappedViewModels.First().ChildGroups;
}

View File

@ -24,9 +24,9 @@
AllowMixedOrientation="True"
DocumentsSource="{Binding OpenDocuments}"
ActiveContent="{Binding ActiveDocument, Mode=TwoWay, Converter={StaticResource ActiveDocumentConverter}}" >
<!--<xcad:DockingManager.Theme>
<xcad:DockingManager.Theme>
<xcad:Vs2013LightTheme />
</xcad:DockingManager.Theme>-->
</xcad:DockingManager.Theme>
<xcad:DockingManager.LayoutItemTemplateSelector>
<viewsAvalonDock:PanesTemplateSelector>
<viewsAvalonDock:PanesTemplateSelector.ItemFilterScriptTemplate>
@ -95,7 +95,6 @@
<xcad:LayoutAnchorablePane Name="SectionBrowserPane" DockWidth="150" />
<xcad:LayoutPanel Orientation="Vertical">
<xcad:LayoutDocumentPane />
</xcad:LayoutPanel>
<xcad:LayoutAnchorablePaneGroup DockWidth="200" Orientation="Vertical">
<xcad:LayoutAnchorablePane Name="BlockGroupBrowserPane" />

View File

@ -67,7 +67,7 @@
</ListBox.InputBindings>
<ListBox.Resources>
<Style TargetType="ListBoxItem">
<!--<Setter Property="FocusVisualStyle" Value="{x:Null}" />-->
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">

View File

@ -60,7 +60,7 @@
x:Name="ScriptToolsGroup"
Visibility="{Binding ActiveDocumentIsScript, Converter={StaticResource BooleanVisibilityConverterCopy}, ConverterParameter={x:Static Visibility.Hidden}, Mode=OneWay}" />
</fluent:Ribbon.ContextualGroups>
<fluent:RibbonTabItem Header="Script Tools" Group="{Binding ElementName=ScriptToolsGroup}" >
<fluent:RibbonTabItem Header="Script Tools" ><!--Group="{Binding ElementName=ScriptToolsGroup}"-->
<fluent:RibbonGroupBox Header="Clipboard">
<fluent:Button Header="Copy Block" Command="{Binding CopyBlockCommand}" Icon="{StaticResource CopyIcon}" LargeIcon="{StaticResource CopyIcon}">
</fluent:Button>
@ -94,9 +94,9 @@
</fluent:RibbonTabItem>
<fluent:RibbonTabItem Header="View">
<fluent:RibbonGroupBox Header="Tools">
<fluent:ToggleButton Header="Section Browser" SizeDefinition="Middle" Icon="{StaticResource AddSectionIcon}" IsChecked="{Binding AvalonDockWorkspaceViewModel.SectionBrowserViewModel.IsVisible}" />
<fluent:ToggleButton Header="Block Group Browser" SizeDefinition="Middle" Icon="{StaticResource BlockGroupBrowserIcon}" IsChecked="{Binding AvalonDockWorkspaceViewModel.BlockGroupBrowserViewModel.IsVisible}" />
<fluent:ToggleButton Header="Block Output Preview" SizeDefinition="Middle" Icon="{StaticResource BlockOutputPreviewIcon}" IsChecked="{Binding AvalonDockWorkspaceViewModel.BlockOutputPreviewViewModel.IsVisible}" />
<fluent:ToggleButton Header="Section Browser" Width="150" SizeDefinition="Middle" Icon="{StaticResource AddSectionIcon}" IsChecked="{Binding AvalonDockWorkspaceViewModel.SectionBrowserViewModel.IsVisible}" />
<fluent:ToggleButton Header="Block Group Browser" Width="150" SizeDefinition="Middle" Icon="{StaticResource BlockGroupBrowserIcon}" IsChecked="{Binding AvalonDockWorkspaceViewModel.BlockGroupBrowserViewModel.IsVisible}" />
<fluent:ToggleButton Header="Block Output Preview" Width="150" SizeDefinition="Middle" Icon="{StaticResource BlockOutputPreviewIcon}" IsChecked="{Binding AvalonDockWorkspaceViewModel.BlockOutputPreviewViewModel.IsVisible}" />
</fluent:RibbonGroupBox>
</fluent:RibbonTabItem>
</fluent:Ribbon>

View File

@ -8,7 +8,6 @@
<ResourceDictionary>
<Style x:Key="PathOfExileFont">
<Setter Property="TextElement.FontFamily" Value="pack://application:,,,/resources/#Fontin SmallCaps" />
<!--<Setter Property="TextElement.FontSize" Value="14" />-->
</Style>
<Style x:Key="ChromelessToggleButton" TargetType="{x:Type ToggleButton}">
<Setter Property="Template">

View File

@ -0,0 +1,120 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="{x:Type CheckBox}">
<Setter Property="SnapsToDevicePixels" Value="true" />
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="Height" Value="30" />
<!--<Setter Property="FocusVisualStyle" Value="{DynamicResource MyFocusVisualStyte}" />-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CheckBox}">
<BulletDecorator>
<BulletDecorator.Bullet>
<Grid Height="{TemplateBinding Height}" Width="{Binding RelativeSource={RelativeSource Self}, Path=Height, UpdateSourceTrigger=PropertyChanged}"
MinHeight="30" MinWidth="30" ShowGridLines="False">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="4*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="3*" />
<RowDefinition Height="1*" />
<RowDefinition Height="1*" />
<RowDefinition Height="1*" />
<RowDefinition Height="4*" />
<RowDefinition Height="1*" />
<RowDefinition Height="1*" />
<RowDefinition Height="4*" />
</Grid.RowDefinitions>
<Border Name="MainBorder"
Grid.ColumnSpan="9" Grid.RowSpan="9"
CornerRadius="4"
BorderThickness="1"
Background="Transparent" />
<Border Name="InnerBorder"
Grid.Column="1" Grid.ColumnSpan="5"
Grid.Row="2" Grid.RowSpan="5"
BorderThickness="1"
BorderBrush="#808080" />
<Path Name="InnerPath"
Grid.Column="1" Grid.ColumnSpan="5"
Grid.Row="2" Grid.RowSpan="5"
Data="M31,5 L19.5,5 19.5,19.5 34.5,19.5 34.5,11.75"
Stretch="Fill" Stroke="#808080"/>
<Path Name="CheckMark"
Grid.Column="2" Grid.ColumnSpan="5"
Grid.Row="1" Grid.RowSpan="5"
Opacity="0"
Data="M9.07743946676476E-09,4.31805768640244L4.68740335877841,8.86361158398516C4.68740335877841,8.86361158398516,16.3281249985376,-2.42451336648723,16.3281249985376,-2.42451336648723L14.0622100581796,-4.77304938341948 4.68740335877846,4.31805791992662 2.22656251699567,1.93164208562579z"
Fill="#3babe3"
Stretch="Fill"
Stroke="#3babe3" />
<Path Name="InderminateMark"
Grid.Column="3"
Grid.Row="4"
Data="M0,4 L1,5 5,1 4,0"
Opacity="0"
Stretch="Fill"
StrokeThickness="0"
Fill="#808080" />
</Grid>
</BulletDecorator.Bullet>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CheckStates">
<VisualState x:Name="Checked">
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity"
Storyboard.TargetName="CheckMark" Duration="0:0:0.2" To="1" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked" >
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity"
Storyboard.TargetName="CheckMark" Duration="0:0:0.2" To="0" />
</Storyboard>
</VisualState>
<VisualState x:Name="Indeterminate">
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity"
Storyboard.TargetName="InderminateMark" Duration="0:0:0.2" To="1" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter Margin="4,0,4,0"
VerticalAlignment="Center"
HorizontalAlignment="Left"
RecognizesAccessKey="True" />
</BulletDecorator>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="InnerBorder" Property="Visibility" Value="Collapsed" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="MainBorder" Property="Background" Value="#81d2eb" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="CheckMark" Property="Fill" Value="#cccccc" />
<Setter TargetName="CheckMark" Property="Stroke" Value="#cccccc" />
<Setter TargetName="InnerPath" Property="Stroke" Value="#cccccc" />
<Setter TargetName="InderminateMark" Property="Fill" Value="#cccccc" />
<Setter TargetName="InnerBorder" Property="BorderBrush" Value="#cccccc" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@ -0,0 +1,29 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Color x:Key="BlackColor">#FF000000</Color>
<Color x:Key="WhiteColor">#FFFFFFFF</Color>
<Color x:Key="Gray1">#FF333333</Color>
<Color x:Key="Gray2">#FF7F7F7F</Color>
<Color x:Key="Gray3">#FF9D9D9D</Color>
<Color x:Key="Gray4">#FFA59F93</Color>
<Color x:Key="Gray5">#FFB9B9B9</Color>
<Color x:Key="Gray6">#FFCCCCCC</Color>
<Color x:Key="Gray7">#FFD8D8D9</Color>
<Color x:Key="Gray8">#FFE0E0E0</Color>
<Color x:Key="Gray9">#5EC9C9C9</Color>
<Color x:Key="Gray10">#FFF7F7F7</Color>
<Color x:Key="HighlightGray">#FFA9BDD8</Color>
<SolidColorBrush x:Key="BlackBrush" Color="{StaticResource BlackColor}" />
<SolidColorBrush x:Key="GrayBrush1" Color="{StaticResource Gray1}"/>
<SolidColorBrush x:Key="GrayBrush2" Color="{StaticResource Gray2}"/>
<SolidColorBrush x:Key="GrayBrush3" Color="{StaticResource Gray3}"/>
<SolidColorBrush x:Key="GrayBrush4" Color="{StaticResource Gray4}"/>
<SolidColorBrush x:Key="GrayBrush5" Color="{StaticResource Gray5}"/>
<SolidColorBrush x:Key="GrayBrush6" Color="{StaticResource Gray6}"/>
<SolidColorBrush x:Key="GrayBrush7" Color="{StaticResource Gray7}"/>
<SolidColorBrush x:Key="GrayBrush8" Color="{StaticResource Gray8}"/>
<SolidColorBrush x:Key="GrayBrush9" Color="{StaticResource Gray9}"/>
<SolidColorBrush x:Key="GrayBrush10" Color="{StaticResource Gray10}"/>
<SolidColorBrush x:Key="HighlightGrayBrush" Color="{StaticResource HighlightGray}" />
</ResourceDictionary>

View File

@ -0,0 +1,49 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="MinHeight" Value="20" />
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="5,0,0,0" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="Border" Background="{TemplateBinding Background}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<ContentPresenter Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Border" Property="Background" Value="{StaticResource GrayBrush5}" />
<Setter Property="Foreground" Value="White" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Border" Property="Background" Value="{StaticResource GrayBrush6}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="LightSlateGray" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsEnabled" Value="False" />
<Condition Property="IsSelected" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="Border" Property="Background" Value="LightSlateGray" />
<Setter Property="Foreground" Value="White" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="True" />
<Condition Property="Selector.IsSelectionActive" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="Border" Property="Background" Value="{StaticResource GrayBrush5}" />
<Setter Property="Foreground" Value="Black" />
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@ -0,0 +1,156 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Filtration.Converters">
<converters:TreeViewMarginConverter Length="12" x:Key="TreeViewMarginConverter" />
<Style x:Key="TreeViewItemFocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Border>
<Rectangle Margin="0,0,0,0"
StrokeThickness="5"
Stroke="Black"
StrokeDashArray="1 2"
Opacity="0" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<PathGeometry x:Key="TreeArrow" Figures="M0,0 L0,6 L6,0 z" />
<Style x:Key="ExpandCollapseToggleStyle"
TargetType="{x:Type ToggleButton}">
<Setter Property="Focusable"
Value="False" />
<Setter Property="Width"
Value="16" />
<Setter Property="Height"
Value="16" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid Background="Transparent"
Height="16"
Width="16">
<Path x:Name="ExpandPath"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="{StaticResource TreeArrow}"
Fill="Transparent"
Stroke="{StaticResource BlackBrush}">
<Path.RenderTransform>
<RotateTransform Angle="135" CenterY="3" CenterX="3" />
</Path.RenderTransform>
</Path>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="RenderTransform" TargetName="ExpandPath">
<Setter.Value>
<RotateTransform Angle="180" CenterY="3" CenterX="3" />
</Setter.Value>
</Setter>
<Setter Property="Fill" TargetName="ExpandPath" Value="{StaticResource GrayBrush1}" />
<Setter Property="Stroke" TargetName="ExpandPath" Value="{StaticResource BlackBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Stroke" TargetName="ExpandPath" Value="{StaticResource GrayBrush5}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsEnabled" Value="False" />
<Condition Property="IsChecked" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="Fill" TargetName="ExpandPath" Value="{StaticResource GrayBrush5}" />
<Setter Property="Stroke" TargetName="ExpandPath" Value="{StaticResource GrayBrush5}" />
</MultiTrigger>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="Stroke" TargetName="ExpandPath" Value="{StaticResource GrayBrush3}" />
<Setter Property="Fill" TargetName="ExpandPath" Value="{StaticResource GrayBrush6}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="MinHeight" Value="25" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Background" Value="White" />
<Setter Property="FocusVisualStyle" Value="{StaticResource TreeViewItemFocusVisual}" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TreeViewItem}">
<StackPanel>
<Border x:Name="TreeViewItemBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"
MinHeight="{TemplateBinding MinHeight}"
UseLayoutRounding="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<Grid Margin="{Binding Converter={StaticResource TreeViewMarginConverter}, RelativeSource={x:Static RelativeSource.TemplatedParent}}" Background="Transparent" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="19" Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ToggleButton x:Name="Expander"
Style="{StaticResource ExpandCollapseToggleStyle}"
IsChecked="{Binding Path=IsExpanded, RelativeSource={x:Static RelativeSource.TemplatedParent}, Mode=TwoWay}"
ClickMode="Press" />
<ContentPresenter x:Name="PART_Header"
Grid.Column="1"
ContentSource="Header"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Grid>
</Border>
<ItemsPresenter x:Name="ItemsHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="False">
<Setter TargetName="ItemsHost" Property="Visibility" Value="Collapsed" />
</Trigger>
<Trigger Property="HasItems" Value="False">
<Setter TargetName="Expander" Property="Visibility" Value="Hidden" />
</Trigger>
<Trigger SourceName="TreeViewItemBorder" Property="IsMouseOver" Value="True">
<Setter TargetName="TreeViewItemBorder" Property="Background" Value="{StaticResource GrayBrush6}" />
<Setter Property="Foreground" Value="Black" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="TreeViewItemBorder" Property="Background" Value="{StaticResource GrayBrush5}" />
<Setter Property="Foreground" Value="Red" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{StaticResource GrayBrush7}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsEnabled" Value="False" />
<Condition Property="IsSelected" Value="True" />
</MultiTrigger.Conditions>
<MultiTrigger.Setters>
<Setter TargetName="TreeViewItemBorder" Property="Background" Value="{StaticResource GrayBrush7}" />
<Setter Property="Foreground" Value="{StaticResource GrayBrush6}" />
</MultiTrigger.Setters>
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="True" />
<Condition Property="Selector.IsSelectionActive" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="TreeViewItemBorder" Property="Background" Value="{StaticResource GrayBrush5}" />
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@ -24,7 +24,6 @@
<Button Height="20" Content="{StaticResource ExpandIcon}" ToolTip="Expand All (Not Implemented)" Name="ExpandAllButton" />
<Button Height="20" Content="{StaticResource CollapseIcon}" ToolTip="Collapse All (Not Implemented)" Name="CollapseAllButton" />
</ToolBar>
<TreeView Grid.Row="1" ItemsSource="{Binding BlockGroupViewModels}" Name="TreeView">
<i:Interaction.Behaviors>
<behaviors:BindableSelectedItemBehavior SelectedItem="{Binding SelectedBlockGroupViewModel, Mode=OneWayToSource}" />
@ -33,7 +32,7 @@
<HierarchicalDataTemplate DataType="{x:Type viewModels:ItemFilterBlockGroupViewModel}" ItemsSource="{Binding ChildGroups}">
<WrapPanel>
<CheckBox IsThreeState="True" IsChecked="{Binding IsChecked}" Click="BlockGroupCheckBox_Clicked" />
<TextBlock Text="{Binding GroupName}" Foreground="{Binding Advanced, Converter={StaticResource BlockGroupAdvancedColorConverter}}" />
<TextBlock Text="{Binding GroupName}" VerticalAlignment="Center" Foreground="{Binding Advanced, Converter={StaticResource BlockGroupAdvancedColorConverter}}" />
</WrapPanel>
</HierarchicalDataTemplate>
</TreeView.Resources>

View File

@ -16,6 +16,9 @@
SelectedItem="{Binding SelectedSectionBlockViewModel}"
x:Name="SectionBrowserListBox"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"><!--SelectionChanged="SectionBrowserListBox_OnSelectionChanged"-->
<ListBox.Resources>
</ListBox.Resources>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Block.Description, Converter={StaticResource HashSignRemovalConverter}}" ToolTip="{Binding Block.Description}" />