Filtration/Filtration/Views/LootFilterScriptView.xaml
2015-06-06 17:07:07 +01:00

123 lines
7.7 KiB
XML

<UserControl x:Class="Filtration.Views.LootFilterScriptView"
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:views="clr-namespace:Filtration.Views"
xmlns:viewModels="clr-namespace:Filtration.ViewModels"
xmlns:userControls="clr-namespace:Filtration.UserControls"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=viewModels:LootFilterScriptViewModel}"
d:DesignHeight="300" d:DesignWidth="600">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>
<!-- ReSharper disable once Xaml.RedundantResource -->
<DataTemplate x:Key="LootFilterBlockTemplate">
<views:LootFilterBlockView Margin="0,2,0,2" />
</DataTemplate>
<!-- ReSharper disable once Xaml.RedundantResource -->
<DataTemplate x:Key="LootFilterSectionTemplate">
<views:LootFilterSectionView Margin="0,2,0,2" />
</DataTemplate>
<views:BlockTemplateSelector x:Key="BlockTemplateSelector" />
</ResourceDictionary>
<ResourceDictionary Source="ExpanderStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!--<Border Grid.Row="0" BorderThickness="2" BorderBrush="SlateGray" CornerRadius="4" Margin="5,5,5,0">-->
<Border Grid.Row="0" BorderThickness="1" BorderBrush="DarkGray" Margin="5,5,5,0">
<StackPanel Margin="2,2,2,2">
<Expander Style="{StaticResource ExpanderRightAlignStyle}">
<Expander.Header>
<TextBlock Text="Script Description" VerticalAlignment="Center" />
</Expander.Header>
<Grid>
<TextBox Text="{Binding Description, UpdateSourceTrigger=PropertyChanged}" Margin="5" MaxLines="20" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" />
</Grid>
</Expander>
</StackPanel>
</Border>
<!--<Border Grid.Row="1" BorderThickness="2" BorderBrush="SlateGray" CornerRadius="4" Margin="5,5,5,5">-->
<Border Grid.Row="1" BorderThickness="1" BorderBrush="DarkGray" Margin="5,5,5,5" Padding="2">
<DockPanel LastChildFill="True">
<ToolBarTray DockPanel.Dock="Top">
<ToolBar>
<Button ToolTip="Add Block" Command="{Binding AddBlockCommand}" Content="{StaticResource AddBlockIcon}" />
<Button ToolTip="Add Section" Command="{Binding AddSectionCommand}" Content="{StaticResource AddSectionIcon}" />
<Button ToolTip="Delete Block/Section" Command="{Binding DeleteBlockCommand}" Content="{StaticResource DeleteIcon}" />
</ToolBar>
<ToolBar>
<Button ToolTip="Move Block to Top" Command="{Binding MoveBlockToTopCommand}" Content="{StaticResource MoveToTopIcon}" />
<Button ToolTip="Move Block Up" Command="{Binding MoveBlockUpCommand}" Content="{StaticResource MoveUpIcon}" />
<Button ToolTip="Move Block Down" Command="{Binding MoveBlockDownCommand}" Content="{StaticResource MoveDownIcon}" />
<Button ToolTip="Move Block to Bottom" Command="{Binding MoveBlockToBottomCommand}" Content="{StaticResource MoveToBottomIcon}" />
</ToolBar>
</ToolBarTray>
<Expander DockPanel.Dock="Left" ExpandDirection="Right" MaxWidth="200" HorizontalAlignment="Left" >
<Expander.Header>
<TextBlock Text="Section Browser" Foreground="White" VerticalAlignment="Top">
<TextBlock.LayoutTransform>
<RotateTransform Angle="-90"/>
</TextBlock.LayoutTransform>
</TextBlock>
</Expander.Header>
<ListBox ItemsSource="{Binding LootFilterSectionViewModels}"
SelectedItem="{Binding SectionBrowserSelectedViewModel}"
x:Name="SectionBrowserListBox"
SelectionChanged="SectionBrowserListBox_OnSelectionChanged"
ScrollViewer.HorizontalScrollBarVisibility="Hidden">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding BlockDescription}" ToolTip="{Binding BlockDescription}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Expander>
<userControls:AutoScrollingListBox ItemsSource="{Binding LootFilterBlockViewModels}"
Margin="5,5,5,5"
Padding="5"
HorizontalContentAlignment="Stretch"
BorderThickness="0"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
VirtualizingStackPanel.VirtualizationMode="Recycling"
ItemTemplateSelector="{StaticResource BlockTemplateSelector}"
SelectedItem="{Binding SelectedBlockViewModel}" x:Name="BlocksListBox">
<ListBox.InputBindings>
<KeyBinding Key="Delete" Command="{Binding DeleteBlockCommand}" />
</ListBox.InputBindings>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="BorderThickness" Value="1"/>
</Trigger>
</Style.Triggers>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.Resources>
<Style TargetType="ListBoxItem">
<Style.Resources>
<!-- SelectedItem with focus -->
<!--<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
--><!-- SelectedItem without focus -->
<!--<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />-->
<!-- SelectedItem text foreground --><!--
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />-->
</Style.Resources>
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
</Style>
</ListBox.Resources>
</userControls:AutoScrollingListBox>
</DockPanel>
</Border>
</Grid>
</UserControl>