2015-06-26 12:42:20 -04:00
|
|
|
<UserControl x:Class="Filtration.ThemeEditor.Views.ThemeComponentControl"
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
2015-07-06 07:01:48 -04:00
|
|
|
xmlns:commonConverters="clr-namespace:Filtration.Common.Converters;assembly=Filtration.Common"
|
2015-07-05 17:43:17 -04:00
|
|
|
xmlns:themeEditor="clr-namespace:Filtration.ObjectModel.ThemeEditor;assembly=Filtration.ObjectModel"
|
|
|
|
xmlns:views="clr-namespace:Filtration.ThemeEditor.Views"
|
2015-06-26 12:42:20 -04:00
|
|
|
mc:Ignorable="d"
|
2015-07-05 17:43:17 -04:00
|
|
|
d:DataContext="{d:DesignInstance Type=themeEditor:ThemeComponent}"
|
2015-07-06 08:41:46 -04:00
|
|
|
d:DesignHeight="100" d:DesignWidth="200">
|
2015-06-26 12:42:20 -04:00
|
|
|
<UserControl.Resources>
|
2015-07-06 07:01:48 -04:00
|
|
|
<commonConverters:BooleanVisibilityConverter x:Key="BooleanVisibilityConverter" />
|
2015-06-26 12:42:20 -04:00
|
|
|
</UserControl.Resources>
|
|
|
|
<Grid Width="200">
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
<RowDefinition Height="25" />
|
|
|
|
</Grid.RowDefinitions>
|
2015-07-05 17:43:17 -04:00
|
|
|
<Grid.Resources>
|
|
|
|
<DataTemplate x:Key="EditableComponentNameTemplate">
|
|
|
|
<TextBox Text="{Binding ComponentName}" />
|
|
|
|
</DataTemplate>
|
|
|
|
<DataTemplate x:Key="ViewOnlyComponentNameTemplate">
|
|
|
|
<TextBlock Text="{Binding ComponentName}" ToolTip="{Binding ComponentName}" />
|
|
|
|
</DataTemplate>
|
|
|
|
</Grid.Resources>
|
2015-07-06 10:33:25 -04:00
|
|
|
<DockPanel LastChildFill="True">
|
|
|
|
<TextBlock DockPanel.Dock="Left"
|
|
|
|
Text="{Binding UsageCount, StringFormat='Usages: {0}'}"
|
|
|
|
FontSize="10"
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
Visibility="{Binding Path=DataContext.EditEnabled, RelativeSource={RelativeSource AncestorType={x:Type views:ThemeEditorView}}, Converter={StaticResource BooleanVisibilityConverter}}">
|
|
|
|
<TextBlock.Style>
|
|
|
|
<Style TargetType="TextBlock">
|
|
|
|
<Style.Triggers>
|
|
|
|
<DataTrigger Binding="{Binding UsageCount}" Value="0">
|
|
|
|
<Setter Property="Foreground" Value="Red" />
|
|
|
|
</DataTrigger>
|
|
|
|
</Style.Triggers>
|
|
|
|
<Setter Property="Foreground" Value="SteelBlue" />
|
|
|
|
</Style>
|
|
|
|
</TextBlock.Style>
|
|
|
|
</TextBlock>
|
|
|
|
</DockPanel>
|
|
|
|
<ContentControl Grid.Row="1" Content="{Binding}">
|
2015-07-05 17:43:17 -04:00
|
|
|
<ContentControl.Style>
|
|
|
|
<Style TargetType="ContentControl">
|
|
|
|
<Style.Triggers>
|
2015-07-06 08:41:46 -04:00
|
|
|
<DataTrigger Binding="{Binding Path=DataContext.IsMasterTheme, RelativeSource={RelativeSource AncestorType={x:Type views:ThemeEditorView}}}" Value="true">
|
2015-07-05 17:43:17 -04:00
|
|
|
<Setter Property="ContentTemplate" Value="{StaticResource EditableComponentNameTemplate}" />
|
|
|
|
</DataTrigger>
|
2015-07-06 08:41:46 -04:00
|
|
|
<DataTrigger Binding="{Binding Path=DataContext.IsMasterTheme, RelativeSource={RelativeSource AncestorType={x:Type views:ThemeEditorView}}}" Value="false">
|
2015-07-05 17:43:17 -04:00
|
|
|
<Setter Property="ContentTemplate" Value="{StaticResource ViewOnlyComponentNameTemplate}" />
|
|
|
|
</DataTrigger>
|
|
|
|
</Style.Triggers>
|
|
|
|
</Style>
|
|
|
|
</ContentControl.Style>
|
|
|
|
</ContentControl>
|
2015-07-06 08:41:46 -04:00
|
|
|
|
2015-07-06 10:33:25 -04:00
|
|
|
<xctk:ColorPicker Grid.Row="2" SelectedColor="{Binding Color}" />
|
2015-06-26 12:42:20 -04:00
|
|
|
</Grid>
|
|
|
|
</UserControl>
|