Added Advanced Block Group block colouring
This commit is contained in:
parent
08d9cf277b
commit
e0a660fec6
|
@ -11,7 +11,7 @@ namespace Filtration.Converters
|
||||||
{
|
{
|
||||||
var advanced = (bool) value;
|
var advanced = (bool) value;
|
||||||
|
|
||||||
return advanced ? new SolidColorBrush(Colors.Red) : new SolidColorBrush(Colors.Black);
|
return advanced ? new SolidColorBrush(Colors.IndianRed) : new SolidColorBrush(Colors.Black);
|
||||||
}
|
}
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
|
namespace Filtration.Converters
|
||||||
|
{
|
||||||
|
internal class BlockGroupAdvancedFillColorConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
var advanced = (bool) value;
|
||||||
|
|
||||||
|
return advanced ? new SolidColorBrush(Colors.IndianRed) : new SolidColorBrush(Colors.SlateGray);
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Data;
|
||||||
|
|
||||||
|
namespace Filtration.Converters
|
||||||
|
{
|
||||||
|
internal class BlockGroupVisibilityConverter : IMultiValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
var blockGroupAdvanced = (bool) values[0];
|
||||||
|
var showAdvanced = (bool)values[1];
|
||||||
|
|
||||||
|
if (!blockGroupAdvanced || showAdvanced)
|
||||||
|
{
|
||||||
|
return Visibility.Visible;
|
||||||
|
}
|
||||||
|
return Visibility.Hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -107,6 +107,7 @@
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</ApplicationDefinition>
|
</ApplicationDefinition>
|
||||||
<Compile Include="Converters\ActiveDocumentConverter.cs" />
|
<Compile Include="Converters\ActiveDocumentConverter.cs" />
|
||||||
|
<Compile Include="Converters\BlockGroupAdvancedFillConverter.cs" />
|
||||||
<Compile Include="Converters\BlockGroupAdvancedColorConverter.cs" />
|
<Compile Include="Converters\BlockGroupAdvancedColorConverter.cs" />
|
||||||
<Compile Include="Converters\BlockGroupVisibilityConverter.cs" />
|
<Compile Include="Converters\BlockGroupVisibilityConverter.cs" />
|
||||||
<Compile Include="Converters\BlockItemTypeToStringConverter.cs" />
|
<Compile Include="Converters\BlockItemTypeToStringConverter.cs" />
|
||||||
|
|
|
@ -106,6 +106,14 @@ namespace Filtration.ViewModels
|
||||||
get { return Block.BlockItems.Where(b => b is IAudioVisualBlockItem); }
|
get { return Block.BlockItems.Where(b => b is IAudioVisualBlockItem); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool AdvancedBlockGroup
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Block.BlockGroup != null && Block.BlockGroup.Advanced;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool DisplaySettingsPopupOpen
|
public bool DisplaySettingsPopupOpen
|
||||||
{
|
{
|
||||||
get { return _displaySettingsPopupOpen; }
|
get { return _displaySettingsPopupOpen; }
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
xmlns:viewModels="clr-namespace:Filtration.ViewModels"
|
xmlns:viewModels="clr-namespace:Filtration.ViewModels"
|
||||||
xmlns:userControls="clr-namespace:Filtration.UserControls"
|
xmlns:userControls="clr-namespace:Filtration.UserControls"
|
||||||
xmlns:views="clr-namespace:Filtration.Views"
|
xmlns:views="clr-namespace:Filtration.Views"
|
||||||
|
xmlns:converters="clr-namespace:Filtration.Converters"
|
||||||
xmlns:blockItemBaseTypes="clr-namespace:Filtration.Models.BlockItemBaseTypes"
|
xmlns:blockItemBaseTypes="clr-namespace:Filtration.Models.BlockItemBaseTypes"
|
||||||
xmlns:blockItemTypes="clr-namespace:Filtration.Models.BlockItemTypes"
|
xmlns:blockItemTypes="clr-namespace:Filtration.Models.BlockItemTypes"
|
||||||
xmlns:enums="clr-namespace:Filtration.Enums"
|
xmlns:enums="clr-namespace:Filtration.Enums"
|
||||||
|
@ -19,6 +20,8 @@
|
||||||
<ResourceDictionary Source="SharedResourcesDictionary.xaml" />
|
<ResourceDictionary Source="SharedResourcesDictionary.xaml" />
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<views:BindingProxy x:Key="proxy" Data="{Binding}" />
|
<views:BindingProxy x:Key="proxy" Data="{Binding}" />
|
||||||
|
<converters:BlockGroupAdvancedFillColorConverter x:Key="BlockGroupAdvancedFillColorConverter" />
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
@ -30,10 +33,10 @@
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Rectangle Width="7" >
|
<Rectangle Width="7" Fill="{Binding AdvancedBlockGroup, Converter={StaticResource BlockGroupAdvancedFillColorConverter}}">
|
||||||
<Rectangle.Fill>
|
<Rectangle.ToolTip>
|
||||||
<SolidColorBrush Color="Gray" />
|
<ToolTip Visibility="{Binding AdvancedBlockGroup, Converter={StaticResource BooleanVisibilityConverter}}">Advanced Block Group</ToolTip>
|
||||||
</Rectangle.Fill>
|
</Rectangle.ToolTip>
|
||||||
</Rectangle>
|
</Rectangle>
|
||||||
<Expander Grid.Column="1" Style="{StaticResource ExpanderRightAlignStyle}" x:Name="TestExpander" ToolTip="{Binding BlockDescription}" ToolTipService.IsEnabled="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsExpanded, Converter={StaticResource BoolInverterConverter}}">
|
<Expander Grid.Column="1" Style="{StaticResource ExpanderRightAlignStyle}" x:Name="TestExpander" ToolTip="{Binding BlockDescription}" ToolTipService.IsEnabled="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsExpanded, Converter={StaticResource BoolInverterConverter}}">
|
||||||
<Expander.ContextMenu>
|
<Expander.ContextMenu>
|
||||||
|
|
Loading…
Reference in New Issue