Moved icons to separate ResourceDictionary

Changed block tooltip to hide when the block is expanded
This commit is contained in:
Ben
2015-06-06 15:50:20 +01:00
parent 3c643eb07b
commit 301b24d324
17 changed files with 87 additions and 201 deletions

View File

@@ -22,16 +22,14 @@ namespace Filtration.ViewModels
internal class LootFilterBlockViewModel : FiltrationViewModelBase, ILootFilterBlockViewModel
{
private readonly ILootFilterBlockTranslator _translator;
private readonly IStaticDataService _staticDataService;
private readonly MediaPlayer _mediaPlayer = new MediaPlayer();
private LootFilterScriptViewModel _parentScriptViewModel;
private bool _displaySettingsPopupOpen;
public LootFilterBlockViewModel(ILootFilterBlockTranslator translator, IStaticDataService staticDataService)
public LootFilterBlockViewModel(IStaticDataService staticDataService)
{
_translator = translator;
_staticDataService = staticDataService;
CopyBlockCommand = new RelayCommand(OnCopyBlockCommand);
PasteBlockCommand = new RelayCommand(OnPasteBlockCommand);
@@ -40,6 +38,8 @@ namespace Filtration.ViewModels
DeleteBlockCommand = new RelayCommand(OnDeleteBlockCommand);
MoveBlockUpCommand = new RelayCommand(OnMoveBlockUpCommand);
MoveBlockDownCommand = new RelayCommand(OnMoveBlockDownCommand);
MoveBlockToTopCommand = new RelayCommand(OnMoveBlockToTopCommand);
MoveBlockToBottomCommand = new RelayCommand(OnMoveBlockToBottomCommand);
AddFilterBlockItemCommand = new RelayCommand<Type>(OnAddFilterBlockItemCommand);
AddAudioVisualBlockItemCommand = new RelayCommand<Type>(OnAddAudioVisualBlockItemCommand);
RemoveFilterBlockItemCommand = new RelayCommand<ILootFilterBlockItem>(OnRemoveFilterBlockItemCommand);
@@ -72,6 +72,8 @@ namespace Filtration.ViewModels
public RelayCommand DeleteBlockCommand { get; private set; }
public RelayCommand MoveBlockUpCommand { get; private set; }
public RelayCommand MoveBlockDownCommand { get; private set; }
public RelayCommand MoveBlockToTopCommand { get; private set; }
public RelayCommand MoveBlockToBottomCommand { get; private set; }
public RelayCommand<Type> AddFilterBlockItemCommand { get; private set; }
public RelayCommand<Type> AddAudioVisualBlockItemCommand { get; private set; }
public RelayCommand<ILootFilterBlockItem> RemoveFilterBlockItemCommand { get; private set; }
@@ -308,6 +310,16 @@ namespace Filtration.ViewModels
{
_parentScriptViewModel.MoveBlockDown(this);
}
private void OnMoveBlockToTopCommand()
{
_parentScriptViewModel.MoveBlockToTop(this);
}
private void OnMoveBlockToBottomCommand()
{
_parentScriptViewModel.MoveBlockToBottom(this);
}
private bool AddBlockItemAllowed(Type type)
{

View File

@@ -187,11 +187,17 @@ namespace Filtration.ViewModels
private void OnMoveBlockToTopCommand()
{
var currentIndex = LootFilterBlockViewModels.IndexOf(SelectedBlockViewModel);
MoveBlockToTop(SelectedBlockViewModel);
}
public void MoveBlockToTop(ILootFilterBlockViewModel targetBlockViewModel)
{
var currentIndex = LootFilterBlockViewModels.IndexOf(targetBlockViewModel);
if (currentIndex > 0)
{
var block = SelectedBlockViewModel.Block;
var block = targetBlockViewModel.Block;
Script.LootFilterBlocks.Remove(block);
Script.LootFilterBlocks.Insert(0, block);
LootFilterBlockViewModels.Move(currentIndex, 0);
@@ -244,11 +250,16 @@ namespace Filtration.ViewModels
private void OnMoveBlockToBottomCommand()
{
var currentIndex = LootFilterBlockViewModels.IndexOf(SelectedBlockViewModel);
MoveBlockToBottom(SelectedBlockViewModel);
}
public void MoveBlockToBottom(ILootFilterBlockViewModel targetBlockViewModel)
{
var currentIndex = LootFilterBlockViewModels.IndexOf(targetBlockViewModel);
if (currentIndex < LootFilterBlockViewModels.Count - 1)
{
var block = SelectedBlockViewModel.Block;
var block = targetBlockViewModel.Block;
Script.LootFilterBlocks.Remove(block);
Script.LootFilterBlocks.Add(block);
LootFilterBlockViewModels.Move(currentIndex, LootFilterBlockViewModels.Count - 1);

View File

@@ -1,5 +1,7 @@
using System;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Reflection;
using System.Windows.Forms;
using Castle.Core;
using Filtration.Models;
@@ -63,6 +65,16 @@ namespace Filtration.ViewModels
get { return _scriptViewModels; }
}
public string WindowTitle
{
get
{
var assembly = Assembly.GetExecutingAssembly();
var fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
return "Filtration v" + fvi.FileMajorPart + "." + fvi.FileMinorPart;
}
}
[DoNotWire]
public ILootFilterScriptViewModel CurrentScriptViewModel
{