Various changes to context menus and toolbars

This commit is contained in:
Ben 2015-06-05 23:20:47 +01:00
parent 7f06f271cc
commit 7b5d92bf66
9 changed files with 192 additions and 99 deletions

View File

@ -1,6 +1,7 @@
<Application x:Class="Filtration.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:fa="http://schemas.fontawesome.io/icons/"
Startup="Application_Startup">
<Application.Resources>
<ResourceDictionary>
@ -11,6 +12,19 @@
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Steel.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
<ResourceDictionary Source="Views/CrossButton.xaml" />
<ResourceDictionary>
<!-- TODO: Fix these icons so we don't need one resource for each instance. x:Shared="False" does not work for ImageAwesome -->
<fa:ImageAwesome Icon="Plus" Height="15" Width="15" x:Key="AddBlockToolbarIcon" />
<fa:ImageAwesome Icon="ListUl" Height="15" Width="15" x:Key="AddSectionToolbarIcon" />
<fa:ImageAwesome Icon="Minus" Height="15" Width="15" x:Key="DeleteBlockToolbarIcon" />
<fa:ImageAwesome Icon="AngleDoubleUp" Height="15" Width="15" x:Key="MoveBlockToTopToolbarIcon" />
<fa:ImageAwesome Icon="AngleUp" Height="15" Width="15" x:Key="MoveBlockUpToolbarIcon" />
<fa:ImageAwesome Icon="AngleDown" Height="15" Width="15" x:Key="MoveBlockDownToolbarIcon" />
<fa:ImageAwesome Icon="AngleDoubleDown" Height="15" Width="15" x:Key="MoveBlockToBottomToolbarIcon" />
<fa:ImageAwesome Icon="FileOutlined" Height="15" Width="15" x:Key="NewIcon" />
<fa:ImageAwesome Icon="FolderOpenOutlined" Height="15" Width="15" x:Key="OpenIcon" />
<fa:ImageAwesome Icon="FloppyOutlined" Height="15" Width="15" x:Key="SaveIcon" />
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>

View File

@ -41,9 +41,6 @@
<Reference Include="Castle.Windsor">
<HintPath>..\packages\Castle.Windsor.3.3.0\lib\net45\Castle.Windsor.dll</HintPath>
</Reference>
<Reference Include="DragAndDropLib">
<HintPath>..\..\DragAndDrop(Complete)\DragAndDropLib\bin\Debug\DragAndDropLib.dll</HintPath>
</Reference>
<Reference Include="FontAwesome.WPF, Version=4.3.0.26714, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\FontAwesome.WPF.4.3.0.2\lib\FontAwesome.WPF.dll</HintPath>
@ -152,6 +149,7 @@
<Compile Include="ViewModels\ILootFilterBlockViewModelFactory.cs" />
<Compile Include="ViewModels\LootFilterBlockViewModel.cs" />
<Compile Include="ViewModels\LootFilterScriptViewModel.cs" />
<Compile Include="Views\BindingProxy.cs" />
<Compile Include="Views\BlockTemplateSelector.cs" />
<Compile Include="Views\LootFilterBlockDisplaySettingsView.xaml.cs">
<DependentUpon>LootFilterBlockDisplaySettingsView.xaml</DependentUpon>

View File

@ -50,8 +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("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: InternalsVisibleTo("Filtration.Tests")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]

View File

@ -15,7 +15,7 @@ namespace Filtration.ViewModels
{
internal interface ILootFilterBlockViewModel
{
void Initialise(LootFilterBlock lootFilterBlock);
void Initialise(LootFilterBlock lootFilterBlock, LootFilterScriptViewModel parentScriptViewModel);
bool IsDirty { get; set; }
LootFilterBlock Block { get; }
}
@ -25,6 +25,7 @@ namespace Filtration.ViewModels
private readonly ILootFilterBlockTranslator _translator;
private readonly IStaticDataService _staticDataService;
private readonly MediaPlayer _mediaPlayer = new MediaPlayer();
private LootFilterScriptViewModel _parentScriptViewModel;
private bool _displaySettingsPopupOpen;
@ -33,7 +34,11 @@ namespace Filtration.ViewModels
_translator = translator;
_staticDataService = staticDataService;
CopyBlockCommand = new RelayCommand(OnCopyConditionCommand);
AddBlockCommand = new RelayCommand(OnAddBlockCommand);
AddSectionCommand = new RelayCommand(OnAddSectionCommand);
DeleteBlockCommand = new RelayCommand(OnDeleteBlockCommand);
MoveBlockUpCommand = new RelayCommand(OnMoveBlockUpCommand);
MoveBlockDownCommand = new RelayCommand(OnMoveBlockDownCommand);
AddFilterBlockItemCommand = new RelayCommand<Type>(OnAddFilterBlockItemCommand);
AddAudioVisualBlockItemCommand = new RelayCommand<Type>(OnAddAudioVisualBlockItemCommand);
RemoveFilterBlockItemCommand = new RelayCommand<ILootFilterBlockItem>(OnRemoveFilterBlockItemCommand);
@ -41,13 +46,15 @@ namespace Filtration.ViewModels
PlaySoundCommand = new RelayCommand(OnPlaySoundCommand, () => HasSound);
}
public void Initialise(LootFilterBlock lootFilterBlock)
public void Initialise(LootFilterBlock lootFilterBlock, LootFilterScriptViewModel parentScriptViewModel)
{
if (lootFilterBlock == null)
if (lootFilterBlock == null || parentScriptViewModel == null)
{
throw new ArgumentNullException("lootFilterBlock");
}
_parentScriptViewModel = parentScriptViewModel;
Block = lootFilterBlock;
lootFilterBlock.BlockItems.CollectionChanged += OnBlockItemsCollectionChanged;
@ -58,6 +65,11 @@ namespace Filtration.ViewModels
}
public RelayCommand CopyBlockCommand { get; private set; }
public RelayCommand AddBlockCommand { get; private set; }
public RelayCommand AddSectionCommand { get; private set; }
public RelayCommand DeleteBlockCommand { get; private set; }
public RelayCommand MoveBlockUpCommand { get; private set; }
public RelayCommand MoveBlockDownCommand { get; private set; }
public RelayCommand<Type> AddFilterBlockItemCommand { get; private set; }
public RelayCommand<Type> AddAudioVisualBlockItemCommand { get; private set; }
public RelayCommand<ILootFilterBlockItem> RemoveFilterBlockItemCommand { get; private set; }
@ -264,6 +276,31 @@ namespace Filtration.ViewModels
IsDirty = true;
}
private void OnAddBlockCommand()
{
_parentScriptViewModel.AddBlock(this);
}
private void OnAddSectionCommand()
{
_parentScriptViewModel.AddSection(this);
}
private void OnDeleteBlockCommand()
{
_parentScriptViewModel.DeleteBlock(this);
}
private void OnMoveBlockUpCommand()
{
_parentScriptViewModel.MoveBlockUp(this);
}
private void OnMoveBlockDownCommand()
{
_parentScriptViewModel.MoveBlockDown(this);
}
private bool AddBlockItemAllowed(Type type)
{
var blockItem = (ILootFilterBlockItem)Activator.CreateInstance(type);

View File

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
@ -16,26 +15,25 @@ namespace Filtration.ViewModels
string Description { get; set; }
void Initialise(LootFilterScript lootFilterScript);
void RemoveDirtyFlag();
void AddSection(ILootFilterBlockViewModel blockViewModel);
void AddBlock(ILootFilterBlockViewModel blockViewModel);
}
internal class LootFilterScriptViewModel : FiltrationViewModelBase, ILootFilterScriptViewModel
{
private readonly ILootFilterBlockViewModelFactory _lootFilterBlockViewModelFactory;
private bool _isDirty;
private ILootFilterBlockViewModel _selectedBlockViewModel;
public LootFilterScriptViewModel(ILootFilterBlockViewModelFactory lootFilterBlockViewModelFactory )
{
DeleteBlockCommand = new RelayCommand(OnDeleteBlock, () => SelectedBlockViewModel != null);
DeleteBlockCommand = new RelayCommand(OnDeleteBlockCommand, () => SelectedBlockViewModel != null);
MoveBlockToTopCommand = new RelayCommand(OnMoveBlockToTopCommand, () => SelectedBlockViewModel != null);
MoveBlockUpCommand = new RelayCommand(OnMoveBlockUpCommand, () => SelectedBlockViewModel != null);
MoveBlockDownCommand = new RelayCommand(OnMoveBlockDownCommand, () => SelectedBlockViewModel != null);
MoveBlockToBottomCommand = new RelayCommand(OnMoveBlockToBottomCommand, () => SelectedBlockViewModel != null);
AddBlockAboveCommand = new RelayCommand(OnAddBlockAboveCommand, () => SelectedBlockViewModel != null || LootFilterBlockViewModels.Count == 0);
AddBlockBelowCommand = new RelayCommand(OnAddBlockBelowCommand, () => SelectedBlockViewModel != null);
AddSectionAboveCommand = new RelayCommand(OnAddSectionAboveCommand, () => SelectedBlockViewModel != null);
SectionBrowserSelectionChangedCommand = new RelayCommand<EventArgs>(OnSectionBrowserSelectionChanged);
AddBlockCommand = new RelayCommand(OnAddBlockCommand, () => SelectedBlockViewModel != null);
AddSectionCommand = new RelayCommand(OnAddSectionCommand, () => SelectedBlockViewModel != null);
_lootFilterBlockViewModelFactory = lootFilterBlockViewModelFactory;
LootFilterBlockViewModels = new ObservableCollection<ILootFilterBlockViewModel>();
@ -47,10 +45,8 @@ namespace Filtration.ViewModels
public RelayCommand MoveBlockUpCommand { get; private set; }
public RelayCommand MoveBlockDownCommand { get; private set; }
public RelayCommand MoveBlockToBottomCommand { get; private set; }
public RelayCommand AddBlockAboveCommand { get; private set; }
public RelayCommand AddBlockBelowCommand { get; private set; }
public RelayCommand AddSectionAboveCommand { get; private set; }
public RelayCommand<EventArgs> SectionBrowserSelectionChangedCommand { get; private set; }
public RelayCommand AddBlockCommand { get; private set; }
public RelayCommand AddSectionCommand { get; private set; }
public ObservableCollection<ILootFilterBlockViewModel> LootFilterBlockViewModels { get; private set; }
@ -61,11 +57,6 @@ namespace Filtration.ViewModels
public ILootFilterBlockViewModel SectionBrowserSelectedViewModel { get; set; }
private void OnSectionBrowserSelectionChanged(EventArgs e)
{
}
public string Description
{
get { return Script.Description; }
@ -77,7 +68,15 @@ namespace Filtration.ViewModels
}
}
public LootFilterBlockViewModel SelectedBlockViewModel { get; set; }
public ILootFilterBlockViewModel SelectedBlockViewModel
{
get { return _selectedBlockViewModel; }
set
{
_selectedBlockViewModel = value;
RaisePropertyChanged();
}
}
public LootFilterScript Script { get; private set; }
@ -129,7 +128,7 @@ namespace Filtration.ViewModels
foreach (var block in Script.LootFilterBlocks)
{
var vm = _lootFilterBlockViewModelFactory.Create();
vm.Initialise(block);
vm.Initialise(block, this);
LootFilterBlockViewModels.Add(vm);
}
}
@ -151,11 +150,16 @@ namespace Filtration.ViewModels
private void OnMoveBlockUpCommand()
{
var currentIndex = LootFilterBlockViewModels.IndexOf(SelectedBlockViewModel);
MoveBlockUp(SelectedBlockViewModel);
}
public void MoveBlockUp(ILootFilterBlockViewModel blockViewModel)
{
var currentIndex = LootFilterBlockViewModels.IndexOf(blockViewModel);
if (currentIndex > 0)
{
var block = SelectedBlockViewModel.Block;
var block = blockViewModel.Block;
var blockPos = Script.LootFilterBlocks.IndexOf(block);
Script.LootFilterBlocks.RemoveAt(blockPos);
Script.LootFilterBlocks.Insert(blockPos - 1, block);
@ -167,11 +171,16 @@ namespace Filtration.ViewModels
private void OnMoveBlockDownCommand()
{
var currentIndex = LootFilterBlockViewModels.IndexOf(SelectedBlockViewModel);
MoveBlockDown(SelectedBlockViewModel);
}
public void MoveBlockDown(ILootFilterBlockViewModel blockViewModel)
{
var currentIndex = LootFilterBlockViewModels.IndexOf(blockViewModel);
if (currentIndex < LootFilterBlockViewModels.Count - 1)
{
var block = SelectedBlockViewModel.Block;
var block = blockViewModel.Block;
var blockPos = Script.LootFilterBlocks.IndexOf(block);
Script.LootFilterBlocks.RemoveAt(blockPos);
Script.LootFilterBlocks.Insert(blockPos + 1, block);
@ -196,16 +205,21 @@ namespace Filtration.ViewModels
}
}
private void OnAddBlockAboveCommand()
private void OnAddBlockCommand()
{
AddBlock(SelectedBlockViewModel);
}
public void AddBlock(ILootFilterBlockViewModel blockViewModel)
{
var vm = _lootFilterBlockViewModelFactory.Create();
var newBlock = new LootFilterBlock();
vm.Initialise(newBlock);
vm.Initialise(newBlock, this);
if (LootFilterBlockViewModels.Count > 0)
{
Script.LootFilterBlocks.Insert(Script.LootFilterBlocks.IndexOf(SelectedBlockViewModel.Block), newBlock);
LootFilterBlockViewModels.Insert(LootFilterBlockViewModels.IndexOf(SelectedBlockViewModel), vm);
Script.LootFilterBlocks.Insert(Script.LootFilterBlocks.IndexOf(blockViewModel.Block) + 1, newBlock);
LootFilterBlockViewModels.Insert(LootFilterBlockViewModels.IndexOf(blockViewModel) + 1, vm);
}
else
{
@ -213,41 +227,42 @@ namespace Filtration.ViewModels
LootFilterBlockViewModels.Add(vm);
}
SelectedBlockViewModel = vm;
_isDirty = true;
}
private void OnAddBlockBelowCommand()
private void OnAddSectionCommand()
{
var vm = _lootFilterBlockViewModelFactory.Create();
var newBlock = new LootFilterBlock();
vm.Initialise(newBlock);
Script.LootFilterBlocks.Insert(Script.LootFilterBlocks.IndexOf(SelectedBlockViewModel.Block) + 1, newBlock);
LootFilterBlockViewModels.Insert(LootFilterBlockViewModels.IndexOf(SelectedBlockViewModel) + 1, vm);
_isDirty = true;
AddSection(SelectedBlockViewModel);
}
private void OnAddSectionAboveCommand()
public void AddSection(ILootFilterBlockViewModel blockViewModel)
{
var vm = _lootFilterBlockViewModelFactory.Create();
var newSection = new LootFilterSection { Description = "New Section" };
vm.Initialise(newSection);
vm.Initialise(newSection, this);
Script.LootFilterBlocks.Insert(Script.LootFilterBlocks.IndexOf(SelectedBlockViewModel.Block), newSection);
LootFilterBlockViewModels.Insert(LootFilterBlockViewModels.IndexOf(SelectedBlockViewModel), vm);
Script.LootFilterBlocks.Insert(Script.LootFilterBlocks.IndexOf(blockViewModel.Block) + 1, newSection);
LootFilterBlockViewModels.Insert(LootFilterBlockViewModels.IndexOf(blockViewModel) + 1, vm);
_isDirty = true;
SelectedBlockViewModel = vm;
RaisePropertyChanged("LootFilterSectionViewModels");
}
private void OnDeleteBlock()
private void OnDeleteBlockCommand()
{
DeleteBlock(SelectedBlockViewModel);
}
public void DeleteBlock(ILootFilterBlockViewModel blockViewModel)
{
var result = MessageBox.Show("Are you sure you wish to delete this block?", "Delete Confirmation",
MessageBoxButton.YesNo, MessageBoxImage.Question);
if (result == MessageBoxResult.Yes)
{
Script.LootFilterBlocks.Remove(SelectedBlockViewModel.Block);
LootFilterBlockViewModels.Remove(SelectedBlockViewModel);
Script.LootFilterBlocks.Remove(blockViewModel.Block);
LootFilterBlockViewModels.Remove(blockViewModel);
_isDirty = true;
}
SelectedBlockViewModel = null;

View File

@ -0,0 +1,22 @@
using System.Windows;
namespace Filtration.Views
{
public class BindingProxy : Freezable
{
protected override Freezable CreateInstanceCore()
{
return new BindingProxy();
}
public object Data
{
get { return GetValue(DataProperty); }
set { SetValue(DataProperty, value); }
}
// Using a DependencyProperty as the backing store for Data. This enables animation, styling, binding, etc...
public static readonly DependencyProperty DataProperty =
DependencyProperty.Register("Data", typeof(object), typeof(BindingProxy), new UIPropertyMetadata(null));
}
}

View File

@ -18,6 +18,9 @@
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="LootFilterBlockViewDictionary.xaml" />
<ResourceDictionary>
<views:BindingProxy x:Key="proxy" Data="{Binding}" />
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
@ -30,28 +33,35 @@
</Grid.ColumnDefinitions>
<Rectangle Width="7" >
<Rectangle.Fill>
<SolidColorBrush Color="Gray"></SolidColorBrush>
<!--<DrawingBrush Viewbox="0,0,5,4" TileMode="Tile">
<DrawingBrush.Drawing>
<GeometryDrawing Brush="#FF9D9D9D">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="0,0,1,1" />
<RectangleGeometry Rect="4,0,1,1" />
<RectangleGeometry Rect="2,2,1,1" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>-->
<SolidColorBrush Color="Gray" />
</Rectangle.Fill>
</Rectangle>
<Expander Grid.Column="1" Style="{StaticResource ExpanderRightAlignStyle}" x:Name="TestExpander" ToolTip="{Binding BlockDescription}">
<Expander.ContextMenu>
<ContextMenu>
<ContextMenu.Resources>
<fa:ImageAwesome Icon="Plus" Height="15" Width="15" x:Key="AddBlockIcon" />
<fa:ImageAwesome Icon="ListUl" Height="15" Width="15" x:Key="AddSectionIcon" />
<fa:ImageAwesome Icon="Minus" Height="15" Width="15" x:Key="DeleteBlockIcon" />
<fa:ImageAwesome Icon="AngleDoubleUp" Height="15" Width="15" x:Key="MoveBlockToTopIcon" />
<fa:ImageAwesome Icon="AngleUp" Height="15" Width="15" x:Key="MoveBlockUpIcon" />
<fa:ImageAwesome Icon="AngleDown" Height="15" Width="15" x:Key="MoveBlockDownIcon" />
<fa:ImageAwesome Icon="AngleDoubleDown" Height="15" Width="15" x:Key="MoveBlockToBottomIcon" />
<fa:ImageAwesome Icon="Copy" Height="15" Width="15" x:Key="CopyIcon" />
<fa:ImageAwesome Icon="Paste" Height="15" Width="15" x:Key="PasteIcon" />
</ContextMenu.Resources>
<ContextMenu.Items>
<MenuItem Header="Copy" Command="{Binding CopyBlockCommand}" />
<MenuItem Header="Copy" Command="{Binding CopyBlockCommand}" Icon="{StaticResource CopyIcon}" />
<MenuItem Header="Paste" Command="{Binding CopyBlockCommand}" Icon="{StaticResource PasteIcon}" />
<Separator />
<MenuItem Header="Add Block" Command="{Binding Data.AddBlockCommand, Source={StaticResource proxy}}" Icon="{StaticResource AddBlockIcon}" />
<MenuItem Header="Add Section" Command="{Binding Data.AddSectionCommand, Source={StaticResource proxy}}" Icon="{StaticResource AddSectionIcon}">
</MenuItem>
<Separator />
<MenuItem Header="Delete Block" Command="{Binding Data.DeleteBlockCommand, Source={StaticResource proxy}}" Icon="{StaticResource DeleteBlockIcon}" />
<Separator />
<MenuItem Header="Move Block Up" Command="{Binding Data.MoveBlockUpCommand, Source={StaticResource proxy}}" Icon="{StaticResource MoveBlockUpIcon}" />
<MenuItem Header="Move Block Down" Command="{Binding Data.MoveBlockDownCommand, Source={StaticResource proxy}}" Icon="{StaticResource MoveBlockDownIcon}" />
</ContextMenu.Items>
</ContextMenu>
</Expander.ContextMenu>
@ -61,8 +71,9 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" VerticalAlignment="Center">
<!-- BlockItems Summary Panel -->
<StackPanel Grid.Row="0" Grid.Column="0" VerticalAlignment="Center">
<ItemsControl ItemsSource="{Binding SummaryBlockItems}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
@ -126,6 +137,7 @@
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<!-- Add Block Item Links -->
<ItemsControl ItemsSource="{Binding BlockItemTypesAvailable}" Grid.Row="0" Margin="0,0,0,10">
<ItemsControl.ItemsPanel>
@ -143,6 +155,7 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!-- Block Items -->
<WrapPanel Grid.Row="1" MaxHeight="200">
<ItemsControl ItemsSource="{Binding FilterBlockItems}">

View File

@ -7,7 +7,6 @@
xmlns:viewModels="clr-namespace:Filtration.ViewModels"
xmlns:userControls="clr-namespace:Filtration.UserControls"
xmlns:fa="http://schemas.fontawesome.io/icons/"
xmlns:dragAndDropLib="clr-namespace:DragAndDropLib;assembly=DragAndDropLib"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=viewModels:LootFilterScriptViewModel}"
d:DesignHeight="300" d:DesignWidth="600">
@ -59,29 +58,15 @@
</Style>
</ToolBarTray.Resources>
<ToolBar>
<Button ToolTip="Add Block" Command="{Binding AddBlockAboveCommand}">
<fa:ImageAwesome Icon="Plus" />
</Button>
<Button ToolTip="Add Section" Command="{Binding AddSectionAboveCommand}">
<fa:ImageAwesome Icon="ListUl" />
</Button>
<Button ToolTip="Delete Block/Section" Command="{Binding DeleteBlockCommand}">
<fa:ImageAwesome Icon="Minus" />
</Button>
<Button ToolTip="Add Block" Command="{Binding AddBlockCommand}" Content="{StaticResource AddBlockToolbarIcon}" />
<Button ToolTip="Add Section" Command="{Binding AddSectionCommand}" Content="{StaticResource AddSectionToolbarIcon}" />
<Button ToolTip="Delete Block/Section" Command="{Binding DeleteBlockCommand}" Content="{StaticResource DeleteBlockToolbarIcon}" />
</ToolBar>
<ToolBar>
<Button ToolTip="Move Block to Top" Command="{Binding MoveBlockToTopCommand}">
<fa:ImageAwesome Icon="AngleDoubleUp" />
</Button>
<Button ToolTip="Move Block Up" Command="{Binding MoveBlockUpCommand}">
<fa:ImageAwesome Icon="AngleUp" />
</Button>
<Button ToolTip="Move Block Down" Command="{Binding MoveBlockDownCommand}">
<fa:ImageAwesome Icon="AngleDown" />
</Button>
<Button ToolTip="Move Block to Bottom" Command="{Binding MoveBlockToBottomCommand}">
<fa:ImageAwesome Icon="AngleDoubleDown" />
</Button>
<Button ToolTip="Move Block to Top" Command="{Binding MoveBlockToTopCommand}" Content="{StaticResource MoveBlockToTopToolbarIcon}" />
<Button ToolTip="Move Block Up" Command="{Binding MoveBlockUpCommand}" Content="{StaticResource MoveBlockUpToolbarIcon}" />
<Button ToolTip="Move Block Down" Command="{Binding MoveBlockDownCommand}" Content="{StaticResource MoveBlockDownToolbarIcon}" />
<Button ToolTip="Move Block to Bottom" Command="{Binding MoveBlockToBottomCommand}" Content="{StaticResource MoveBlockToBottomToolbarIcon}" />
</ToolBar>
</ToolBarTray>
<Expander DockPanel.Dock="Left" ExpandDirection="Right" MaxWidth="200" HorizontalAlignment="Left" >
@ -113,6 +98,9 @@
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">
<!--<Setter Property="BorderBrush" Value="Red"/>-->
@ -127,11 +115,11 @@
<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" />
<!--<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>

View File

@ -25,7 +25,14 @@
<MenuItem Header="_Copy Script to Clipboard" Command="{Binding CopyScriptCommand}" />
</MenuItem>
</Menu>
<controls:MetroTabControl ItemsSource="{Binding ScriptViewModels}" SelectedItem="{Binding CurrentScriptViewModel}" DockPanel.Dock="Bottom" Name="TabControl">
<ToolBarTray DockPanel.Dock="Top">
<ToolBar>
<Button Command="{Binding NewScriptCommand}" Content="{StaticResource NewIcon}" ToolTip="New Script" />
<Button Command="{Binding OpenScriptCommand}" Content="{StaticResource OpenIcon}" ToolTip="Open Script" />
<Button Command="{Binding SaveScriptCommand}" Content="{StaticResource SaveIcon}" ToolTip="Save Script" />
</ToolBar>
</ToolBarTray>
<controls:MetroTabControl ItemsSource="{Binding ScriptViewModels}" SelectedItem="{Binding CurrentScriptViewModel}" Name="TabControl">
<TabControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="5,0,0,0">