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"
|
2018-08-29 13:12:02 -04:00
|
|
|
xmlns:extensions="clr-namespace:Filtration.Common.Extensions;assembly=Filtration.Common"
|
|
|
|
xmlns:enums="clr-namespace:Filtration.ObjectModel.Enums;assembly=Filtration.ObjectModel"
|
2018-12-05 12:40:59 -05:00
|
|
|
xmlns:utilities="clr-namespace:Filtration.Common.Utilities;assembly=Filtration.Common"
|
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" />
|
2018-08-29 13:12:02 -04:00
|
|
|
<RowDefinition Height="*" />
|
2015-06-26 12:42:20 -04:00
|
|
|
</Grid.RowDefinitions>
|
2015-07-05 17:43:17 -04:00
|
|
|
<Grid.Resources>
|
|
|
|
<DataTemplate x:Key="EditableComponentNameTemplate">
|
2015-07-15 14:10:51 -04:00
|
|
|
<StackPanel>
|
|
|
|
<TextBlock 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>
|
|
|
|
<TextBox Text="{Binding ComponentName}" />
|
|
|
|
</StackPanel>
|
2015-07-05 17:43:17 -04:00
|
|
|
</DataTemplate>
|
|
|
|
<DataTemplate x:Key="ViewOnlyComponentNameTemplate">
|
|
|
|
<TextBlock Text="{Binding ComponentName}" ToolTip="{Binding ComponentName}" />
|
|
|
|
</DataTemplate>
|
|
|
|
</Grid.Resources>
|
2015-07-06 10:33:25 -04:00
|
|
|
<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>
|
2018-08-24 15:07:24 -04:00
|
|
|
<ContentControl Grid.Row="2" Content="{Binding Mode=OneWay}">
|
|
|
|
<ContentControl.Resources>
|
|
|
|
<!-- Color Theme Template -->
|
2018-12-05 12:40:59 -05:00
|
|
|
<DataTemplate DataType="{x:Type themeEditor:ColorThemeComponent}">
|
|
|
|
<xctk:ColorPicker SelectedColor="{Binding Color}" AvailableColors="{x:Static utilities:PathOfExileColors.DefaultColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" MouseDown="ColorPicker_OnMouseDown" />
|
2018-08-24 15:07:24 -04:00
|
|
|
</DataTemplate>
|
2018-08-25 08:52:16 -04:00
|
|
|
|
|
|
|
<!-- Integer Theme Template -->
|
|
|
|
<DataTemplate DataType="{x:Type themeEditor:IntegerThemeComponent}">
|
|
|
|
<xctk:ShortUpDown Value="{Binding Value}" />
|
|
|
|
</DataTemplate>
|
2018-08-26 13:24:13 -04:00
|
|
|
|
|
|
|
<!-- String Integer Theme Template -->
|
|
|
|
<DataTemplate DataType="{x:Type themeEditor:StrIntThemeComponent}">
|
|
|
|
<Grid>
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBox Grid.Column="0" Text="{Binding Value}" Height="25" Padding="2,-15,0,0" />
|
|
|
|
<xctk:ShortUpDown Grid.Column="1" Value="{Binding SecondValue}" HorizontalAlignment="Right"/>
|
|
|
|
</Grid>
|
|
|
|
</DataTemplate>
|
2018-08-29 06:11:41 -04:00
|
|
|
|
|
|
|
<!--TODO:File block type and string block type should be separate-->
|
|
|
|
<!-- Custom Sound Theme Template -->
|
|
|
|
<DataTemplate DataType="{x:Type themeEditor:StringThemeComponent}">
|
|
|
|
<Grid>
|
|
|
|
<!--TODO: Add play sound support-->
|
|
|
|
<!--<Button Grid.Column="0" Command="{Binding PlayCustomSoundCommand}" Width="20" Height="20" Background="Transparent" BorderBrush="Transparent">
|
|
|
|
<Image Source="/Filtration.ThemeEditor;component/Resources/speaker_icon.png" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
|
|
|
</Button>-->
|
|
|
|
<ComboBox ItemsSource="{Binding CustomSoundsAvailable}"
|
|
|
|
SelectedValue="{Binding Value}" Style="{StaticResource MetroComboBox}"/>
|
|
|
|
<Button Command="{Binding CustomSoundFileDialogCommand}"
|
|
|
|
Width="20" Height="20" Background="Transparent" BorderBrush="Transparent" Margin="0,0,30,0" VerticalAlignment="Center" HorizontalAlignment="Right">
|
|
|
|
<Image Source="/Filtration.ThemeEditor;component/Resources/open_icon.png"/>
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
</DataTemplate>
|
2018-08-29 13:12:02 -04:00
|
|
|
|
|
|
|
<!--Icon Theme Template-->
|
|
|
|
<DataTemplate DataType="{x:Type themeEditor:IconThemeComponent}">
|
|
|
|
<StackPanel Orientation="Vertical" Margin="5,5,5,5">
|
|
|
|
<ComboBox ItemsSource="{Binding Source={extensions:Enumeration {x:Type enums:IconSize}}}" Style="{StaticResource MetroComboBox}"
|
|
|
|
DisplayMemberPath="Description"
|
|
|
|
SelectedValue="{Binding IconSize}"
|
|
|
|
SelectedValuePath="Value" />
|
|
|
|
<ComboBox ItemsSource="{Binding Source={extensions:Enumeration {x:Type enums:IconColor}}}" Style="{StaticResource MetroComboBox}"
|
|
|
|
DisplayMemberPath="Description"
|
|
|
|
SelectedValue="{Binding IconColor}"
|
|
|
|
SelectedValuePath="Value" />
|
|
|
|
<ComboBox ItemsSource="{Binding Source={extensions:Enumeration {x:Type enums:IconShape}}}" Style="{StaticResource MetroComboBox}"
|
|
|
|
DisplayMemberPath="Description"
|
|
|
|
SelectedValue="{Binding IconShape}"
|
|
|
|
SelectedValuePath="Value" />
|
|
|
|
</StackPanel>
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
|
|
<!--Effect Color Theme Template-->
|
|
|
|
<DataTemplate DataType="{x:Type themeEditor:EffectColorThemeComponent}">
|
|
|
|
<StackPanel>
|
|
|
|
<WrapPanel VerticalAlignment="Center" Margin="5,5,5,5">
|
|
|
|
<RadioButton IsChecked="{Binding Temporary, Converter={StaticResource BoolInverterConverter}}" Margin="0,0,10,0">Permanent</RadioButton>
|
|
|
|
<RadioButton IsChecked="{Binding Temporary}" >Temporary</RadioButton>
|
|
|
|
</WrapPanel>
|
|
|
|
<ComboBox ItemsSource="{Binding Source={extensions:Enumeration {x:Type enums:EffectColor}}}" Style="{StaticResource MetroComboBox}"
|
|
|
|
DisplayMemberPath="Description"
|
|
|
|
SelectedValue="{Binding EffectColor}"
|
|
|
|
SelectedValuePath="Value" />
|
|
|
|
</StackPanel>
|
|
|
|
</DataTemplate>
|
2018-08-24 15:07:24 -04:00
|
|
|
</ContentControl.Resources>
|
|
|
|
</ContentControl>
|
2015-06-26 12:42:20 -04:00
|
|
|
</Grid>
|
|
|
|
</UserControl>
|