Implemented AvalonDock, added BlockGroupBrowser
This commit is contained in:
parent
92eb8cec01
commit
f4eaba016f
|
@ -9,7 +9,7 @@ namespace Filtration.Converters
|
||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
if (value is ItemFilterScriptViewModel)
|
if (value is IDocument)
|
||||||
return value;
|
return value;
|
||||||
|
|
||||||
return Binding.DoNothing;
|
return Binding.DoNothing;
|
||||||
|
@ -17,7 +17,7 @@ namespace Filtration.Converters
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
if (value is ItemFilterScriptViewModel)
|
if (value is IDocument)
|
||||||
return value;
|
return value;
|
||||||
|
|
||||||
return Binding.DoNothing;
|
return Binding.DoNothing;
|
||||||
|
|
|
@ -170,7 +170,9 @@
|
||||||
<DependentUpon>ItemPreviewControl.xaml</DependentUpon>
|
<DependentUpon>ItemPreviewControl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Utilities\LineReader.cs" />
|
<Compile Include="Utilities\LineReader.cs" />
|
||||||
|
<Compile Include="ViewModels\BlockGroupBrowserViewModel.cs" />
|
||||||
<Compile Include="ViewModels\FiltrationViewModelBase.cs" />
|
<Compile Include="ViewModels\FiltrationViewModelBase.cs" />
|
||||||
|
<Compile Include="ViewModels\IDocument.cs" />
|
||||||
<Compile Include="ViewModels\IItemFilterScriptViewModelFactory.cs" />
|
<Compile Include="ViewModels\IItemFilterScriptViewModelFactory.cs" />
|
||||||
<Compile Include="ViewModels\IItemFilterBlockViewModelFactory.cs" />
|
<Compile Include="ViewModels\IItemFilterBlockViewModelFactory.cs" />
|
||||||
<Compile Include="ViewModels\ItemFilterBlockViewModel.cs" />
|
<Compile Include="ViewModels\ItemFilterBlockViewModel.cs" />
|
||||||
|
@ -178,8 +180,13 @@
|
||||||
<Compile Include="ViewModels\PaneViewModel.cs" />
|
<Compile Include="ViewModels\PaneViewModel.cs" />
|
||||||
<Compile Include="ViewModels\ReplaceColorsViewModel.cs" />
|
<Compile Include="ViewModels\ReplaceColorsViewModel.cs" />
|
||||||
<Compile Include="ViewModels\SectionBrowserViewModel.cs" />
|
<Compile Include="ViewModels\SectionBrowserViewModel.cs" />
|
||||||
|
<Compile Include="ViewModels\StartPageViewModel.cs" />
|
||||||
<Compile Include="ViewModels\ToolViewModel.cs" />
|
<Compile Include="ViewModels\ToolViewModel.cs" />
|
||||||
|
<Compile Include="Views\AttachedProperties\SelectingItemAttachedProperty.cs" />
|
||||||
<Compile Include="Views\BindingProxy.cs" />
|
<Compile Include="Views\BindingProxy.cs" />
|
||||||
|
<Compile Include="Views\BlockGroupBrowserView.xaml.cs">
|
||||||
|
<DependentUpon>BlockGroupBrowserView.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Views\BlockTemplateSelector.cs" />
|
<Compile Include="Views\BlockTemplateSelector.cs" />
|
||||||
<Compile Include="Views\ItemFilterBlockDisplaySettingsView.xaml.cs">
|
<Compile Include="Views\ItemFilterBlockDisplaySettingsView.xaml.cs">
|
||||||
<DependentUpon>ItemFilterBlockDisplaySettingsView.xaml</DependentUpon>
|
<DependentUpon>ItemFilterBlockDisplaySettingsView.xaml</DependentUpon>
|
||||||
|
@ -199,15 +206,18 @@
|
||||||
<Compile Include="Views\AboutWindow.xaml.cs">
|
<Compile Include="Views\AboutWindow.xaml.cs">
|
||||||
<DependentUpon>AboutWindow.xaml</DependentUpon>
|
<DependentUpon>AboutWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Views\LayoutInitializer.cs" />
|
<Compile Include="Views\AvalonDock\LayoutInitializer.cs" />
|
||||||
<Compile Include="Views\PanesStyleSelector.cs" />
|
<Compile Include="Views\AvalonDock\PanesStyleSelector.cs" />
|
||||||
<Compile Include="Views\PanesTemplateSelector.cs" />
|
<Compile Include="Views\AvalonDock\PanesTemplateSelector.cs" />
|
||||||
<Compile Include="Views\ReplaceColorsWindow.xaml.cs">
|
<Compile Include="Views\ReplaceColorsWindow.xaml.cs">
|
||||||
<DependentUpon>ReplaceColorsWindow.xaml</DependentUpon>
|
<DependentUpon>ReplaceColorsWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Views\SectionBrowserView.xaml.cs">
|
<Compile Include="Views\SectionBrowserView.xaml.cs">
|
||||||
<DependentUpon>SectionBrowserView.xaml</DependentUpon>
|
<DependentUpon>SectionBrowserView.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Views\StartPageView.xaml.cs">
|
||||||
|
<DependentUpon>StartPageView.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="WindsorInstallers\ModelsInstaller.cs" />
|
<Compile Include="WindsorInstallers\ModelsInstaller.cs" />
|
||||||
<Compile Include="WindsorInstallers\ServicesInstaller.cs" />
|
<Compile Include="WindsorInstallers\ServicesInstaller.cs" />
|
||||||
<Compile Include="WindsorInstallers\TranslatorsInstaller.cs" />
|
<Compile Include="WindsorInstallers\TranslatorsInstaller.cs" />
|
||||||
|
@ -217,6 +227,10 @@
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="Views\BlockGroupBrowserView.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="Views\CrossButton.xaml">
|
<Page Include="Views\CrossButton.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
@ -282,6 +296,10 @@
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="Views\StartPageView.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs">
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
|
@ -338,6 +356,7 @@
|
||||||
<Resource Include="Resources\Icons\about_icon.png" />
|
<Resource Include="Resources\Icons\about_icon.png" />
|
||||||
<Resource Include="Resources\filtration.ico" />
|
<Resource Include="Resources\filtration.ico" />
|
||||||
<Resource Include="Resources\Icons\replace_colors_icon.png" />
|
<Resource Include="Resources\Icons\replace_colors_icon.png" />
|
||||||
|
<Resource Include="Resources\Icons\block_group_browser_icon.png" />
|
||||||
<Content Include="Resources\ItemBaseTypes.txt">
|
<Content Include="Resources\ItemBaseTypes.txt">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
|
|
@ -16,10 +16,15 @@ namespace Filtration.Models
|
||||||
var currentBlockGroup = this;
|
var currentBlockGroup = this;
|
||||||
|
|
||||||
var outputString = GroupName;
|
var outputString = GroupName;
|
||||||
while (currentBlockGroup.ParentGroup.ParentGroup != null)
|
|
||||||
|
// TODO: This is retarded, fix this.
|
||||||
|
if (currentBlockGroup.ParentGroup != null)
|
||||||
{
|
{
|
||||||
outputString = currentBlockGroup.ParentGroup.GroupName + " - " + outputString;
|
while (currentBlockGroup.ParentGroup.ParentGroup != null)
|
||||||
currentBlockGroup = currentBlockGroup.ParentGroup;
|
{
|
||||||
|
outputString = currentBlockGroup.ParentGroup.GroupName + " - " + outputString;
|
||||||
|
currentBlockGroup = currentBlockGroup.ParentGroup;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return outputString;
|
return outputString;
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 158 B |
|
@ -0,0 +1,13 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Filtration.ViewModels
|
||||||
|
{
|
||||||
|
interface IDocument
|
||||||
|
{
|
||||||
|
bool IsScript { get; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -18,7 +18,9 @@ namespace Filtration.ViewModels
|
||||||
string DisplayName { get; }
|
string DisplayName { get; }
|
||||||
void Initialise(ItemFilterScript itemFilterScript);
|
void Initialise(ItemFilterScript itemFilterScript);
|
||||||
IItemFilterBlockViewModel SelectedBlockViewModel { get; set; }
|
IItemFilterBlockViewModel SelectedBlockViewModel { get; set; }
|
||||||
|
IItemFilterBlockViewModel SectionBrowserSelectedBlockViewModel { get; set; }
|
||||||
void RemoveDirtyFlag();
|
void RemoveDirtyFlag();
|
||||||
|
IEnumerable<ItemFilterBlockGroup> BlockGroups { get; }
|
||||||
IEnumerable<IItemFilterBlockViewModel> ItemFilterSectionViewModels { get; }
|
IEnumerable<IItemFilterBlockViewModel> ItemFilterSectionViewModels { get; }
|
||||||
void AddSection(IItemFilterBlockViewModel targetBlockViewModel);
|
void AddSection(IItemFilterBlockViewModel targetBlockViewModel);
|
||||||
void AddBlock(IItemFilterBlockViewModel targetBlockViewModel);
|
void AddBlock(IItemFilterBlockViewModel targetBlockViewModel);
|
||||||
|
@ -26,15 +28,18 @@ namespace Filtration.ViewModels
|
||||||
void PasteBlock(IItemFilterBlockViewModel targetBlockViewModel);
|
void PasteBlock(IItemFilterBlockViewModel targetBlockViewModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class ItemFilterScriptViewModel : PaneViewModel, IItemFilterScriptViewModel
|
internal class ItemFilterScriptViewModel : PaneViewModel, IItemFilterScriptViewModel, IDocument
|
||||||
{
|
{
|
||||||
private readonly IItemFilterBlockViewModelFactory _itemFilterBlockViewModelFactory;
|
private readonly IItemFilterBlockViewModelFactory _itemFilterBlockViewModelFactory;
|
||||||
private readonly IItemFilterBlockTranslator _blockTranslator;
|
private readonly IItemFilterBlockTranslator _blockTranslator;
|
||||||
|
private readonly IMainWindowViewModel _mainWindowViewModel;
|
||||||
private bool _isDirty;
|
private bool _isDirty;
|
||||||
private IItemFilterBlockViewModel _selectedBlockViewModel;
|
private IItemFilterBlockViewModel _selectedBlockViewModel;
|
||||||
|
private IItemFilterBlockViewModel _sectionBrowserSelectedBlockViewModel;
|
||||||
|
|
||||||
public ItemFilterScriptViewModel(IItemFilterBlockViewModelFactory itemFilterBlockViewModelFactory, IItemFilterBlockTranslator blockTranslator)
|
public ItemFilterScriptViewModel(IItemFilterBlockViewModelFactory itemFilterBlockViewModelFactory, IItemFilterBlockTranslator blockTranslator, IMainWindowViewModel mainWindowViewModel)
|
||||||
{
|
{
|
||||||
|
CloseCommand = new RelayCommand(OnCloseCommand);
|
||||||
DeleteBlockCommand = new RelayCommand(OnDeleteBlockCommand, () => SelectedBlockViewModel != null);
|
DeleteBlockCommand = new RelayCommand(OnDeleteBlockCommand, () => SelectedBlockViewModel != null);
|
||||||
MoveBlockToTopCommand = new RelayCommand(OnMoveBlockToTopCommand, () => SelectedBlockViewModel != null);
|
MoveBlockToTopCommand = new RelayCommand(OnMoveBlockToTopCommand, () => SelectedBlockViewModel != null);
|
||||||
MoveBlockUpCommand = new RelayCommand(OnMoveBlockUpCommand, () => SelectedBlockViewModel != null);
|
MoveBlockUpCommand = new RelayCommand(OnMoveBlockUpCommand, () => SelectedBlockViewModel != null);
|
||||||
|
@ -46,10 +51,16 @@ namespace Filtration.ViewModels
|
||||||
PasteBlockCommand = new RelayCommand(OnPasteBlockCommand, () => SelectedBlockViewModel != null);
|
PasteBlockCommand = new RelayCommand(OnPasteBlockCommand, () => SelectedBlockViewModel != null);
|
||||||
_itemFilterBlockViewModelFactory = itemFilterBlockViewModelFactory;
|
_itemFilterBlockViewModelFactory = itemFilterBlockViewModelFactory;
|
||||||
_blockTranslator = blockTranslator;
|
_blockTranslator = blockTranslator;
|
||||||
|
_mainWindowViewModel = mainWindowViewModel;
|
||||||
ItemFilterBlockViewModels = new ObservableCollection<IItemFilterBlockViewModel>();
|
ItemFilterBlockViewModels = new ObservableCollection<IItemFilterBlockViewModel>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsScript
|
||||||
|
{
|
||||||
|
get { return true; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public RelayCommand CloseCommand { get; private set; }
|
||||||
public RelayCommand DeleteBlockCommand { get; private set; }
|
public RelayCommand DeleteBlockCommand { get; private set; }
|
||||||
public RelayCommand MoveBlockToTopCommand { get; private set; }
|
public RelayCommand MoveBlockToTopCommand { get; private set; }
|
||||||
public RelayCommand MoveBlockUpCommand { get; private set; }
|
public RelayCommand MoveBlockUpCommand { get; private set; }
|
||||||
|
@ -66,9 +77,7 @@ namespace Filtration.ViewModels
|
||||||
{
|
{
|
||||||
get { return ItemFilterBlockViewModels.Where(b => b.Block.GetType() == typeof (ItemFilterSection)); }
|
get { return ItemFilterBlockViewModels.Where(b => b.Block.GetType() == typeof (ItemFilterSection)); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public IItemFilterBlockViewModel SectionBrowserSelectedViewModel { get; set; }
|
|
||||||
|
|
||||||
public string Description
|
public string Description
|
||||||
{
|
{
|
||||||
get { return Script.Description; }
|
get { return Script.Description; }
|
||||||
|
@ -90,8 +99,24 @@ namespace Filtration.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IItemFilterBlockViewModel SectionBrowserSelectedBlockViewModel
|
||||||
|
{
|
||||||
|
get { return _sectionBrowserSelectedBlockViewModel; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_sectionBrowserSelectedBlockViewModel = value;
|
||||||
|
SelectedBlockViewModel = value;
|
||||||
|
RaisePropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public ItemFilterScript Script { get; private set; }
|
public ItemFilterScript Script { get; private set; }
|
||||||
|
|
||||||
|
public IEnumerable<ItemFilterBlockGroup> BlockGroups
|
||||||
|
{
|
||||||
|
get { return Script.ItemFilterBlockGroups; }
|
||||||
|
}
|
||||||
|
|
||||||
public bool IsDirty
|
public bool IsDirty
|
||||||
{
|
{
|
||||||
get { return _isDirty || HasDirtyChildren; }
|
get { return _isDirty || HasDirtyChildren; }
|
||||||
|
@ -153,6 +178,10 @@ namespace Filtration.ViewModels
|
||||||
ContentId = "testcontentid";
|
ContentId = "testcontentid";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnCloseCommand()
|
||||||
|
{
|
||||||
|
_mainWindowViewModel.Close(this);
|
||||||
|
}
|
||||||
private void OnCopyBlockCommand()
|
private void OnCopyBlockCommand()
|
||||||
{
|
{
|
||||||
CopyBlock(SelectedBlockViewModel);
|
CopyBlock(SelectedBlockViewModel);
|
||||||
|
|
|
@ -10,7 +10,6 @@ using Filtration.Services;
|
||||||
using Filtration.Translators;
|
using Filtration.Translators;
|
||||||
using Filtration.Views;
|
using Filtration.Views;
|
||||||
using GalaSoft.MvvmLight.CommandWpf;
|
using GalaSoft.MvvmLight.CommandWpf;
|
||||||
using Xceed.Wpf.AvalonDock.Layout;
|
|
||||||
using Clipboard = System.Windows.Clipboard;
|
using Clipboard = System.Windows.Clipboard;
|
||||||
using OpenFileDialog = Microsoft.Win32.OpenFileDialog;
|
using OpenFileDialog = Microsoft.Win32.OpenFileDialog;
|
||||||
|
|
||||||
|
@ -18,9 +17,13 @@ namespace Filtration.ViewModels
|
||||||
{
|
{
|
||||||
internal interface IMainWindowViewModel
|
internal interface IMainWindowViewModel
|
||||||
{
|
{
|
||||||
IItemFilterScriptViewModel ActiveDocument { get; set; }
|
IDocument ActiveDocument { get; set; }
|
||||||
|
IItemFilterScriptViewModel ActiveScriptViewModel { get; }
|
||||||
event EventHandler ActiveDocumentChanged;
|
event EventHandler ActiveDocumentChanged;
|
||||||
void LoadScriptFromFile(string path);
|
void LoadScriptFromFile(string path);
|
||||||
|
RelayCommand OpenScriptCommand { get; }
|
||||||
|
RelayCommand NewScriptCommand { get; }
|
||||||
|
void Close(IDocument scriptToClose);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class MainWindowViewModel : FiltrationViewModelBase, IMainWindowViewModel
|
internal class MainWindowViewModel : FiltrationViewModelBase, IMainWindowViewModel
|
||||||
|
@ -32,38 +35,52 @@ namespace Filtration.ViewModels
|
||||||
private readonly IItemFilterPersistenceService _persistenceService;
|
private readonly IItemFilterPersistenceService _persistenceService;
|
||||||
private readonly IItemFilterScriptTranslator _itemFilterScriptTranslator;
|
private readonly IItemFilterScriptTranslator _itemFilterScriptTranslator;
|
||||||
private readonly IReplaceColorsViewModel _replaceColorsViewModel;
|
private readonly IReplaceColorsViewModel _replaceColorsViewModel;
|
||||||
private IItemFilterScriptViewModel _activeDocument;
|
private IDocument _activeDocument;
|
||||||
private readonly ObservableCollection<IItemFilterScriptViewModel> _scriptViewModels;
|
private IItemFilterScriptViewModel _activeScriptViewModel;
|
||||||
private readonly SectionBrowserViewModel _sectionBrowserViewModel;
|
private readonly ObservableCollection<IDocument> _openDocuments;
|
||||||
|
private readonly ISectionBrowserViewModel _sectionBrowserViewModel;
|
||||||
|
private readonly IBlockGroupBrowserViewModel _blockGroupBrowserViewModel;
|
||||||
|
private readonly IStartPageViewModel _startPageViewModel;
|
||||||
|
|
||||||
public MainWindowViewModel(IItemFilterScriptViewModelFactory itemFilterScriptViewModelFactory,
|
public MainWindowViewModel(IItemFilterScriptViewModelFactory itemFilterScriptViewModelFactory,
|
||||||
IItemFilterPersistenceService persistenceService,
|
IItemFilterPersistenceService persistenceService,
|
||||||
IItemFilterScriptTranslator itemFilterScriptTranslator,
|
IItemFilterScriptTranslator itemFilterScriptTranslator,
|
||||||
IReplaceColorsViewModel replaceColorsViewModel)
|
IReplaceColorsViewModel replaceColorsViewModel,
|
||||||
|
ISectionBrowserViewModel sectionBrowserViewModel,
|
||||||
|
IBlockGroupBrowserViewModel blockGroupBrowserViewModel,
|
||||||
|
IStartPageViewModel startPageViewModel)
|
||||||
{
|
{
|
||||||
_itemFilterScriptViewModelFactory = itemFilterScriptViewModelFactory;
|
_itemFilterScriptViewModelFactory = itemFilterScriptViewModelFactory;
|
||||||
_persistenceService = persistenceService;
|
_persistenceService = persistenceService;
|
||||||
_itemFilterScriptTranslator = itemFilterScriptTranslator;
|
_itemFilterScriptTranslator = itemFilterScriptTranslator;
|
||||||
_replaceColorsViewModel = replaceColorsViewModel;
|
_replaceColorsViewModel = replaceColorsViewModel;
|
||||||
_sectionBrowserViewModel = new SectionBrowserViewModel();
|
_sectionBrowserViewModel = sectionBrowserViewModel;
|
||||||
_sectionBrowserViewModel.Initialise(this);
|
_blockGroupBrowserViewModel = blockGroupBrowserViewModel;
|
||||||
|
_startPageViewModel = startPageViewModel;
|
||||||
|
|
||||||
_scriptViewModels = new ObservableCollection<IItemFilterScriptViewModel>();
|
_sectionBrowserViewModel.Initialise(this);
|
||||||
|
_blockGroupBrowserViewModel.Initialise(this);
|
||||||
|
_startPageViewModel.Initialise(this);
|
||||||
|
|
||||||
|
_openDocuments = new ObservableCollection<IDocument>();
|
||||||
|
|
||||||
OpenAboutWindowCommand = new RelayCommand(OnOpenAboutWindowCommand);
|
OpenAboutWindowCommand = new RelayCommand(OnOpenAboutWindowCommand);
|
||||||
OpenScriptCommand = new RelayCommand(OnOpenScriptCommand);
|
OpenScriptCommand = new RelayCommand(OnOpenScriptCommand);
|
||||||
SaveScriptCommand = new RelayCommand(OnSaveScriptCommand, () => ActiveDocument != null);
|
SaveScriptCommand = new RelayCommand(OnSaveScriptCommand, () => ActiveDocument != null && ActiveDocument.IsScript);
|
||||||
SaveScriptAsCommand = new RelayCommand(OnSaveScriptAsCommand, () => ActiveDocument != null);
|
SaveScriptAsCommand = new RelayCommand(OnSaveScriptAsCommand, () => ActiveDocument != null && ActiveDocument.IsScript);
|
||||||
CopyScriptCommand = new RelayCommand(OnCopyScriptCommand, () => ActiveDocument != null);
|
CopyScriptCommand = new RelayCommand(OnCopyScriptCommand, () => ActiveDocument != null && ActiveDocument.IsScript);
|
||||||
CopyBlockCommand = new RelayCommand(OnCopyBlockCommand, () => ActiveDocument != null && ActiveDocument.SelectedBlockViewModel != null);
|
CopyBlockCommand = new RelayCommand(OnCopyBlockCommand, () => ActiveDocument != null && ActiveDocument.IsScript && ((IItemFilterScriptViewModel)ActiveDocument).SelectedBlockViewModel != null);
|
||||||
PasteCommand = new RelayCommand(OnPasteCommand, () => ActiveDocument != null && ActiveDocument.SelectedBlockViewModel != null);
|
PasteCommand = new RelayCommand(OnPasteCommand, () => ActiveDocument != null && ActiveDocument.IsScript && ((IItemFilterScriptViewModel)ActiveDocument).SelectedBlockViewModel != null);
|
||||||
NewScriptCommand = new RelayCommand(OnNewScriptCommand);
|
NewScriptCommand = new RelayCommand(OnNewScriptCommand);
|
||||||
CloseScriptCommand = new RelayCommand<IItemFilterScriptViewModel>(OnCloseScriptCommand, v => ActiveDocument != null);
|
CloseScriptCommand = new RelayCommand<IDocument>(OnCloseScriptCommand, v => ActiveDocument != null && ActiveDocument.IsScript);
|
||||||
ReplaceColorsCommand = new RelayCommand(OnReplaceColorsCommand, () => ActiveDocument != null);
|
ReplaceColorsCommand = new RelayCommand(OnReplaceColorsCommand, () => ActiveDocument != null && ActiveDocument.IsScript);
|
||||||
|
|
||||||
//LoadScriptFromFile("C:\\ThioleLootFilter.txt");
|
//LoadScriptFromFile("C:\\ThioleLootFilter.txt");
|
||||||
|
|
||||||
SetItemFilterScriptDirectory();
|
SetItemFilterScriptDirectory();
|
||||||
|
|
||||||
|
_openDocuments.Add(_startPageViewModel);
|
||||||
|
ActiveDocument = startPageViewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RelayCommand OpenScriptCommand { get; private set; }
|
public RelayCommand OpenScriptCommand { get; private set; }
|
||||||
|
@ -73,38 +90,30 @@ namespace Filtration.ViewModels
|
||||||
public RelayCommand PasteCommand { get; private set; }
|
public RelayCommand PasteCommand { get; private set; }
|
||||||
public RelayCommand CopyScriptCommand { get; private set; }
|
public RelayCommand CopyScriptCommand { get; private set; }
|
||||||
public RelayCommand NewScriptCommand { get; private set; }
|
public RelayCommand NewScriptCommand { get; private set; }
|
||||||
public RelayCommand<IItemFilterScriptViewModel> CloseScriptCommand { get; private set; }
|
public RelayCommand<IDocument> CloseScriptCommand { get; private set; }
|
||||||
public RelayCommand OpenAboutWindowCommand { get; private set; }
|
public RelayCommand OpenAboutWindowCommand { get; private set; }
|
||||||
public RelayCommand ReplaceColorsCommand { get; private set; }
|
public RelayCommand ReplaceColorsCommand { get; private set; }
|
||||||
|
|
||||||
public ObservableCollection<IItemFilterScriptViewModel> ScriptViewModels
|
public ObservableCollection<IDocument> OpenDocuments
|
||||||
{
|
{
|
||||||
get { return _scriptViewModels; }
|
get { return _openDocuments; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<ToolViewModel> _tools;
|
private List<IToolViewModel> _tools;
|
||||||
|
|
||||||
public IEnumerable<ToolViewModel> Tools
|
public IEnumerable<IToolViewModel> Tools
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (_tools == null)
|
if (_tools == null)
|
||||||
{
|
{
|
||||||
_tools = new List<ToolViewModel> { _sectionBrowserViewModel };
|
_tools = new List<IToolViewModel> {_sectionBrowserViewModel, _blockGroupBrowserViewModel};
|
||||||
}
|
}
|
||||||
|
|
||||||
return _tools;
|
return _tools;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public SectionBrowserViewModel SectionBrowserViewModel
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _sectionBrowserViewModel;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string WindowTitle
|
public string WindowTitle
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -115,14 +124,19 @@ namespace Filtration.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[DoNotWire]
|
public IDocument ActiveDocument
|
||||||
public IItemFilterScriptViewModel ActiveDocument
|
|
||||||
{
|
{
|
||||||
get { return _activeDocument; }
|
get { return _activeDocument; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_activeDocument = value;
|
_activeDocument = value;
|
||||||
RaisePropertyChanged();
|
RaisePropertyChanged();
|
||||||
|
|
||||||
|
if (value.IsScript)
|
||||||
|
{
|
||||||
|
_activeScriptViewModel = (IItemFilterScriptViewModel)value;
|
||||||
|
}
|
||||||
|
|
||||||
if (ActiveDocumentChanged != null)
|
if (ActiveDocumentChanged != null)
|
||||||
{
|
{
|
||||||
ActiveDocumentChanged(this, EventArgs.Empty);
|
ActiveDocumentChanged(this, EventArgs.Empty);
|
||||||
|
@ -134,6 +148,12 @@ namespace Filtration.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IItemFilterScriptViewModel ActiveScriptViewModel
|
||||||
|
{
|
||||||
|
get { return _activeScriptViewModel; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public event EventHandler ActiveDocumentChanged;
|
public event EventHandler ActiveDocumentChanged;
|
||||||
|
|
||||||
public bool NoScriptsOpen
|
public bool NoScriptsOpen
|
||||||
|
@ -175,8 +195,9 @@ namespace Filtration.ViewModels
|
||||||
|
|
||||||
var newViewModel = _itemFilterScriptViewModelFactory.Create();
|
var newViewModel = _itemFilterScriptViewModelFactory.Create();
|
||||||
newViewModel.Initialise(_loadedScript);
|
newViewModel.Initialise(_loadedScript);
|
||||||
ScriptViewModels.Add(newViewModel);
|
_activeScriptViewModel = newViewModel;
|
||||||
ActiveDocument = newViewModel;
|
OpenDocuments.Add((IDocument)newViewModel);
|
||||||
|
ActiveDocument = (IDocument)newViewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetItemFilterScriptDirectory()
|
private void SetItemFilterScriptDirectory()
|
||||||
|
@ -206,7 +227,7 @@ namespace Filtration.ViewModels
|
||||||
{
|
{
|
||||||
if (!ValidateScript()) return;
|
if (!ValidateScript()) return;
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(ActiveDocument.Script.FilePath))
|
if (string.IsNullOrEmpty(_activeScriptViewModel.Script.FilePath))
|
||||||
{
|
{
|
||||||
OnSaveScriptAsCommand();
|
OnSaveScriptAsCommand();
|
||||||
return;
|
return;
|
||||||
|
@ -214,8 +235,8 @@ namespace Filtration.ViewModels
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_persistenceService.SaveItemFilterScript(ActiveDocument.Script);
|
_persistenceService.SaveItemFilterScript(_activeScriptViewModel.Script);
|
||||||
ActiveDocument.RemoveDirtyFlag();
|
_activeScriptViewModel.RemoveDirtyFlag();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -240,31 +261,31 @@ namespace Filtration.ViewModels
|
||||||
|
|
||||||
if (result != DialogResult.OK) return;
|
if (result != DialogResult.OK) return;
|
||||||
|
|
||||||
var previousFilePath = ActiveDocument.Script.FilePath;
|
var previousFilePath = _activeScriptViewModel.Script.FilePath;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ActiveDocument.Script.FilePath = saveDialog.FileName;
|
_activeScriptViewModel.Script.FilePath = saveDialog.FileName;
|
||||||
_persistenceService.SaveItemFilterScript(ActiveDocument.Script);
|
_persistenceService.SaveItemFilterScript(_activeScriptViewModel.Script);
|
||||||
ActiveDocument.RemoveDirtyFlag();
|
_activeScriptViewModel.RemoveDirtyFlag();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
MessageBox.Show(@"Error saving filter file - " + e.Message, @"Save Error", MessageBoxButtons.OK,
|
MessageBox.Show(@"Error saving filter file - " + e.Message, @"Save Error", MessageBoxButtons.OK,
|
||||||
MessageBoxIcon.Error);
|
MessageBoxIcon.Error);
|
||||||
ActiveDocument.Script.FilePath = previousFilePath;
|
_activeScriptViewModel.Script.FilePath = previousFilePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnReplaceColorsCommand()
|
private void OnReplaceColorsCommand()
|
||||||
{
|
{
|
||||||
_replaceColorsViewModel.Initialise(ActiveDocument.Script);
|
_replaceColorsViewModel.Initialise(_activeScriptViewModel.Script);
|
||||||
var replaceColorsWindow = new ReplaceColorsWindow {DataContext = _replaceColorsViewModel};
|
var replaceColorsWindow = new ReplaceColorsWindow {DataContext = _replaceColorsViewModel};
|
||||||
replaceColorsWindow.ShowDialog();
|
replaceColorsWindow.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool ValidateScript()
|
private bool ValidateScript()
|
||||||
{
|
{
|
||||||
var result = ActiveDocument.Script.Validate();
|
var result = _activeScriptViewModel.Script.Validate();
|
||||||
|
|
||||||
if (result.Count == 0) return true;
|
if (result.Count == 0) return true;
|
||||||
|
|
||||||
|
@ -283,17 +304,17 @@ namespace Filtration.ViewModels
|
||||||
|
|
||||||
private void OnCopyScriptCommand()
|
private void OnCopyScriptCommand()
|
||||||
{
|
{
|
||||||
Clipboard.SetText(_itemFilterScriptTranslator.TranslateItemFilterScriptToString(_activeDocument.Script));
|
Clipboard.SetText(_itemFilterScriptTranslator.TranslateItemFilterScriptToString(_activeScriptViewModel.Script));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCopyBlockCommand()
|
private void OnCopyBlockCommand()
|
||||||
{
|
{
|
||||||
_activeDocument.CopyBlock(_activeDocument.SelectedBlockViewModel);
|
_activeScriptViewModel.CopyBlock(_activeScriptViewModel.SelectedBlockViewModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnPasteCommand()
|
private void OnPasteCommand()
|
||||||
{
|
{
|
||||||
_activeDocument.PasteBlock(_activeDocument.SelectedBlockViewModel);
|
_activeScriptViewModel.PasteBlock(_activeScriptViewModel.SelectedBlockViewModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnNewScriptCommand()
|
private void OnNewScriptCommand()
|
||||||
|
@ -302,40 +323,66 @@ namespace Filtration.ViewModels
|
||||||
var newViewModel = _itemFilterScriptViewModelFactory.Create();
|
var newViewModel = _itemFilterScriptViewModelFactory.Create();
|
||||||
newViewModel.Initialise(newScript);
|
newViewModel.Initialise(newScript);
|
||||||
newViewModel.Description = "New Script";
|
newViewModel.Description = "New Script";
|
||||||
ScriptViewModels.Add(newViewModel);
|
_activeScriptViewModel = newViewModel;
|
||||||
ActiveDocument = newViewModel;
|
OpenDocuments.Add((IDocument)newViewModel);
|
||||||
|
ActiveDocument = (IDocument)newViewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCloseScriptCommand(IItemFilterScriptViewModel scriptViewModel)
|
private void OnCloseScriptCommand(IDocument documentToClose)
|
||||||
{
|
{
|
||||||
ActiveDocument = scriptViewModel;
|
Close(documentToClose);
|
||||||
if (!ActiveDocument.IsDirty)
|
}
|
||||||
|
|
||||||
|
public void Close(IDocument documentToClose)
|
||||||
|
{
|
||||||
|
ActiveDocument = documentToClose;
|
||||||
|
if (ActiveDocument.IsScript)
|
||||||
{
|
{
|
||||||
ScriptViewModels.Remove(ActiveDocument);
|
if (!_activeScriptViewModel.IsDirty)
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var result = MessageBox.Show(@"Want to save your changes to this script?",
|
|
||||||
@"Filtration", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
|
|
||||||
switch (result)
|
|
||||||
{
|
{
|
||||||
case DialogResult.Yes:
|
RemoveDocument(ActiveDocument);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var result = MessageBox.Show(@"Want to save your changes to this script?",
|
||||||
|
@"Filtration", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
|
||||||
|
switch (result)
|
||||||
{
|
{
|
||||||
OnSaveScriptCommand();
|
case DialogResult.Yes:
|
||||||
ScriptViewModels.Remove(ActiveDocument);
|
{
|
||||||
break;
|
OnSaveScriptCommand();
|
||||||
}
|
RemoveDocument(ActiveDocument);
|
||||||
case DialogResult.No:
|
break;
|
||||||
{
|
}
|
||||||
ScriptViewModels.Remove(ActiveDocument);
|
case DialogResult.No:
|
||||||
break;
|
{
|
||||||
}
|
RemoveDocument(ActiveDocument);
|
||||||
case DialogResult.Cancel:
|
break;
|
||||||
{
|
}
|
||||||
break;
|
case DialogResult.Cancel:
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RemoveDocument(documentToClose);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void RemoveDocument(IDocument documentToRemove)
|
||||||
|
{
|
||||||
|
if (documentToRemove.IsScript)
|
||||||
|
{
|
||||||
|
_sectionBrowserViewModel.ClearDown();
|
||||||
|
}
|
||||||
|
|
||||||
|
OpenDocuments.Remove(documentToRemove);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +1,38 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
|
||||||
namespace Filtration.ViewModels
|
namespace Filtration.ViewModels
|
||||||
{
|
{
|
||||||
internal interface ISectionBrowserViewModel
|
internal interface ISectionBrowserViewModel : IToolViewModel
|
||||||
{
|
{
|
||||||
|
void ClearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class SectionBrowserViewModel : ToolViewModel, ISectionBrowserViewModel
|
internal class SectionBrowserViewModel : ToolViewModel, ISectionBrowserViewModel
|
||||||
{
|
{
|
||||||
private IMainWindowViewModel _mainWindowViewModel;
|
|
||||||
private IEnumerable<IItemFilterBlockViewModel> _sectionBlockViewModels;
|
private IEnumerable<IItemFilterBlockViewModel> _sectionBlockViewModels;
|
||||||
private IItemFilterBlockViewModel _selectedSectionBlockViewModel;
|
private IItemFilterBlockViewModel _selectedSectionBlockViewModel;
|
||||||
|
|
||||||
public SectionBrowserViewModel() : base("Section Browser")
|
public SectionBrowserViewModel() : base("Section Browser")
|
||||||
{
|
{
|
||||||
|
|
||||||
ContentId = ToolContentId;
|
ContentId = ToolContentId;
|
||||||
}
|
var icon = new BitmapImage();
|
||||||
|
icon.BeginInit();
|
||||||
public void Initialise(IMainWindowViewModel mainWindowViewModel)
|
icon.UriSource = new Uri("pack://application:,,,/Filtration;component/Resources/Icons/add_section_icon.png");
|
||||||
{
|
icon.EndInit();
|
||||||
_mainWindowViewModel = mainWindowViewModel;
|
IconSource = icon;
|
||||||
_mainWindowViewModel.ActiveDocumentChanged += OnActiveDocumentChanged;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public const string ToolContentId = "SectionBrowserTool";
|
public const string ToolContentId = "SectionBrowserTool";
|
||||||
|
|
||||||
|
public override void Initialise(IMainWindowViewModel mainWindowViewModel)
|
||||||
|
{
|
||||||
|
base.Initialise(mainWindowViewModel);
|
||||||
|
MainWindowViewModel.ActiveDocumentChanged += OnActiveDocumentChanged;
|
||||||
|
}
|
||||||
|
|
||||||
public IEnumerable<IItemFilterBlockViewModel> SectionBlockViewModels
|
public IEnumerable<IItemFilterBlockViewModel> SectionBlockViewModels
|
||||||
{
|
{
|
||||||
get { return _sectionBlockViewModels; }
|
get { return _sectionBlockViewModels; }
|
||||||
|
@ -43,13 +49,30 @@ namespace Filtration.ViewModels
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_selectedSectionBlockViewModel = value;
|
_selectedSectionBlockViewModel = value;
|
||||||
|
if (MainWindowViewModel.ActiveDocument.IsScript)
|
||||||
|
{
|
||||||
|
MainWindowViewModel.ActiveScriptViewModel.SectionBrowserSelectedBlockViewModel = value;
|
||||||
|
}
|
||||||
RaisePropertyChanged();
|
RaisePropertyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnActiveDocumentChanged(object sender, EventArgs e)
|
private void OnActiveDocumentChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SectionBlockViewModels = _mainWindowViewModel.ActiveDocument != null ? _mainWindowViewModel.ActiveDocument.ItemFilterSectionViewModels : null;
|
if (MainWindowViewModel.ActiveScriptViewModel != null && MainWindowViewModel.ActiveDocument.IsScript)
|
||||||
|
{
|
||||||
|
SectionBlockViewModels = MainWindowViewModel.ActiveScriptViewModel.ItemFilterSectionViewModels;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClearDown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ClearDown()
|
||||||
|
{
|
||||||
|
SectionBlockViewModels = null;
|
||||||
|
SelectedSectionBlockViewModel = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
using GalaSoft.MvvmLight.CommandWpf;
|
||||||
|
|
||||||
|
namespace Filtration.ViewModels
|
||||||
|
{
|
||||||
|
internal interface IStartPageViewModel : IDocument
|
||||||
|
{
|
||||||
|
void Initialise(IMainWindowViewModel mainWindowViewModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class StartPageViewModel : PaneViewModel, IStartPageViewModel
|
||||||
|
{
|
||||||
|
private IMainWindowViewModel _mainWindowViewModel;
|
||||||
|
|
||||||
|
public StartPageViewModel()
|
||||||
|
{
|
||||||
|
Title = "Start Page";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Initialise(IMainWindowViewModel mainWindowViewModel)
|
||||||
|
{
|
||||||
|
_mainWindowViewModel = mainWindowViewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RelayCommand OpenScriptCommand { get { return _mainWindowViewModel.OpenScriptCommand; } }
|
||||||
|
public RelayCommand NewScriptCommand { get { return _mainWindowViewModel.NewScriptCommand; } }
|
||||||
|
|
||||||
|
public bool IsScript { get { return false; } }
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,11 @@
|
||||||
namespace Filtration.ViewModels
|
namespace Filtration.ViewModels
|
||||||
{
|
{
|
||||||
class ToolViewModel : PaneViewModel
|
internal interface IToolViewModel
|
||||||
|
{
|
||||||
|
void Initialise(IMainWindowViewModel mainWindowViewModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
class ToolViewModel : PaneViewModel, IToolViewModel
|
||||||
{
|
{
|
||||||
public ToolViewModel(string name)
|
public ToolViewModel(string name)
|
||||||
{
|
{
|
||||||
|
@ -23,5 +28,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected IMainWindowViewModel MainWindowViewModel { get; private set; }
|
||||||
|
|
||||||
|
public virtual void Initialise(IMainWindowViewModel mainWindowViewModel)
|
||||||
|
{
|
||||||
|
MainWindowViewModel = mainWindowViewModel;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using Filtration.ViewModels;
|
||||||
|
|
||||||
|
namespace Filtration.Views.AttachedProperties
|
||||||
|
{
|
||||||
|
internal class SelectingItemAttachedProperty
|
||||||
|
{
|
||||||
|
public static readonly DependencyProperty SelectingItemProperty = DependencyProperty.RegisterAttached(
|
||||||
|
"SelectingItem",
|
||||||
|
typeof(IItemFilterBlockViewModel),
|
||||||
|
typeof(SelectingItemAttachedProperty),
|
||||||
|
new PropertyMetadata(default(IItemFilterBlockViewModel), OnSelectingItemChanged));
|
||||||
|
|
||||||
|
public static IItemFilterBlockViewModel GetSelectingItem(DependencyObject target)
|
||||||
|
{
|
||||||
|
return (IItemFilterBlockViewModel)target.GetValue(SelectingItemProperty);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetSelectingItem(DependencyObject target, IItemFilterBlockViewModel value)
|
||||||
|
{
|
||||||
|
target.SetValue(SelectingItemProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void OnSelectingItemChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
|
||||||
|
{
|
||||||
|
var listBox = sender as ListBox;
|
||||||
|
if (listBox == null || listBox.SelectedItem == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
listBox.Dispatcher.InvokeAsync(() =>
|
||||||
|
{
|
||||||
|
listBox.UpdateLayout();
|
||||||
|
listBox.ScrollIntoView(listBox.SelectedItem);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Xceed.Wpf.AvalonDock.Layout;
|
using Xceed.Wpf.AvalonDock.Layout;
|
||||||
|
|
||||||
namespace Filtration.Views
|
namespace Filtration.Views.AvalonDock
|
||||||
{
|
{
|
||||||
class LayoutInitializer : ILayoutUpdateStrategy
|
class LayoutInitializer : ILayoutUpdateStrategy
|
||||||
{
|
{
|
||||||
|
@ -15,12 +15,29 @@ namespace Filtration.Views
|
||||||
destinationContainer.FindParent<LayoutFloatingWindow>() != null)
|
destinationContainer.FindParent<LayoutFloatingWindow>() != null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "ToolsPane");
|
//if (anchorableToShow.ContentId == "SectionBrowserTool")
|
||||||
if (toolsPane != null)
|
//{
|
||||||
{
|
// var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "SectionBrowserPane");
|
||||||
toolsPane.Children.Add(anchorableToShow);
|
// if (toolsPane != null)
|
||||||
return true;
|
// {
|
||||||
}
|
// anchorableToShow.CanHide = false;
|
||||||
|
// toolsPane.Children.Add(anchorableToShow);
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (anchorableToShow.ContentId == "BlockGroupBrowserTool")
|
||||||
|
//{
|
||||||
|
// var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "BlockGroupBrowserPane");
|
||||||
|
// if (toolsPane != null)
|
||||||
|
// {
|
||||||
|
// anchorableToShow.CanHide = false;
|
||||||
|
// toolsPane.Children.Add(anchorableToShow);
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using Filtration.ViewModels;
|
using Filtration.ViewModels;
|
||||||
|
|
||||||
namespace Filtration.Views
|
namespace Filtration.Views.AvalonDock
|
||||||
{
|
{
|
||||||
class PanesStyleSelector : StyleSelector
|
class PanesStyleSelector : StyleSelector
|
||||||
{
|
{
|
||||||
public Style ToolStyle { get; set; }
|
public Style ToolStyle { get; set; }
|
||||||
public Style ScriptStyle { get; set; }
|
public Style DocumentStyle { get; set; }
|
||||||
|
|
||||||
public override Style SelectStyle(object item, DependencyObject container)
|
public override Style SelectStyle(object item, DependencyObject container)
|
||||||
{
|
{
|
||||||
|
@ -16,11 +16,11 @@ namespace Filtration.Views
|
||||||
return ToolStyle;
|
return ToolStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item is IItemFilterScriptViewModel)
|
if (item is IDocument)
|
||||||
{
|
{
|
||||||
return ScriptStyle;
|
return DocumentStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
return base.SelectStyle(item, container);
|
return base.SelectStyle(item, container);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -3,15 +3,14 @@ using System.Windows.Controls;
|
||||||
using Filtration.ViewModels;
|
using Filtration.ViewModels;
|
||||||
using Xceed.Wpf.AvalonDock.Layout;
|
using Xceed.Wpf.AvalonDock.Layout;
|
||||||
|
|
||||||
namespace Filtration.Views
|
namespace Filtration.Views.AvalonDock
|
||||||
{
|
{
|
||||||
class PanesTemplateSelector : DataTemplateSelector
|
class PanesTemplateSelector : DataTemplateSelector
|
||||||
{
|
{
|
||||||
public DataTemplate ItemFilterScriptTemplate { get; set; }
|
public DataTemplate ItemFilterScriptTemplate { get; set; }
|
||||||
|
public DataTemplate BlockGroupBrowserTemplate { get; set; }
|
||||||
public DataTemplate SectionBrowserTemplate { get; set; }
|
public DataTemplate SectionBrowserTemplate { get; set; }
|
||||||
|
public DataTemplate StartPageTemplate { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public override DataTemplate SelectTemplate(object item, DependencyObject container)
|
public override DataTemplate SelectTemplate(object item, DependencyObject container)
|
||||||
{
|
{
|
||||||
|
@ -27,6 +26,16 @@ namespace Filtration.Views
|
||||||
return SectionBrowserTemplate;
|
return SectionBrowserTemplate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item is BlockGroupBrowserViewModel)
|
||||||
|
{
|
||||||
|
return BlockGroupBrowserTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item is StartPageViewModel)
|
||||||
|
{
|
||||||
|
return StartPageTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
return base.SelectTemplate(item, container);
|
return base.SelectTemplate(item, container);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
<UserControl x:Class="Filtration.Views.BlockGroupBrowserView"
|
||||||
|
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:models="clr-namespace:Filtration.Models"
|
||||||
|
xmlns:viewModels="clr-namespace:Filtration.ViewModels"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DataContext="{d:DesignInstance Type=viewModels:BlockGroupBrowserViewModel}"
|
||||||
|
d:DesignHeight="300" d:DesignWidth="300">
|
||||||
|
<UserControl.Resources>
|
||||||
|
|
||||||
|
</UserControl.Resources>
|
||||||
|
<Grid>
|
||||||
|
<TreeView ItemsSource="{Binding BlockGroups}">
|
||||||
|
<TreeView.Resources>
|
||||||
|
<HierarchicalDataTemplate DataType="{x:Type models:ItemFilterBlockGroup}" ItemsSource="{Binding ChildGroups}">
|
||||||
|
<WrapPanel>
|
||||||
|
<CheckBox IsThreeState="True" />
|
||||||
|
<TextBlock Text="{Binding GroupName}" />
|
||||||
|
</WrapPanel>
|
||||||
|
</HierarchicalDataTemplate>
|
||||||
|
</TreeView.Resources>
|
||||||
|
</TreeView>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
|
@ -0,0 +1,28 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace Filtration.Views
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for BlockGroupBrowserView.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class BlockGroupBrowserView : UserControl
|
||||||
|
{
|
||||||
|
public BlockGroupBrowserView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,6 +4,7 @@
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:views="clr-namespace:Filtration.Views"
|
xmlns:views="clr-namespace:Filtration.Views"
|
||||||
|
xmlns:attachedProperties="clr-namespace:Filtration.Views.AttachedProperties"
|
||||||
xmlns:viewModels="clr-namespace:Filtration.ViewModels"
|
xmlns:viewModels="clr-namespace:Filtration.ViewModels"
|
||||||
xmlns:userControls="clr-namespace:Filtration.UserControls"
|
xmlns:userControls="clr-namespace:Filtration.UserControls"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
@ -87,6 +88,7 @@
|
||||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||||
VirtualizingStackPanel.VirtualizationMode="Recycling"
|
VirtualizingStackPanel.VirtualizationMode="Recycling"
|
||||||
ItemTemplateSelector="{StaticResource BlockTemplateSelector}"
|
ItemTemplateSelector="{StaticResource BlockTemplateSelector}"
|
||||||
|
attachedProperties:SelectingItemAttachedProperty.SelectingItem="{Binding SectionBrowserSelectedBlockViewModel}"
|
||||||
SelectedItem="{Binding SelectedBlockViewModel}" x:Name="BlocksListBox">
|
SelectedItem="{Binding SelectedBlockViewModel}" x:Name="BlocksListBox">
|
||||||
<ListBox.InputBindings>
|
<ListBox.InputBindings>
|
||||||
<KeyBinding Key="Delete" Command="{Binding DeleteBlockCommand}" />
|
<KeyBinding Key="Delete" Command="{Binding DeleteBlockCommand}" />
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
using System.Windows.Controls;
|
namespace Filtration.Views
|
||||||
|
|
||||||
namespace Filtration.Views
|
|
||||||
{
|
{
|
||||||
public partial class ItemFilterScriptView
|
public partial class ItemFilterScriptView
|
||||||
{
|
{
|
||||||
|
@ -8,11 +6,5 @@ namespace Filtration.Views
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SectionBrowserListBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
var listBox = (ListBox) sender;
|
|
||||||
BlocksListBox.ScrollIntoView(listBox.SelectedItem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
xmlns:avalonDock="http://schemas.xceed.com/wpf/xaml/avalondock"
|
xmlns:avalonDock="http://schemas.xceed.com/wpf/xaml/avalondock"
|
||||||
xmlns:converters="clr-namespace:Filtration.Converters"
|
xmlns:converters="clr-namespace:Filtration.Converters"
|
||||||
xmlns:views="clr-namespace:Filtration.Views"
|
xmlns:views="clr-namespace:Filtration.Views"
|
||||||
|
xmlns:viewsAvalonDock="clr-namespace:Filtration.Views.AvalonDock"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DataContext="{d:DesignInstance Type=viewModels:MainWindowViewModel}"
|
d:DataContext="{d:DesignInstance Type=viewModels:MainWindowViewModel}"
|
||||||
Title="{Binding WindowTitle}" Height="707" Width="930" BorderThickness="1" BorderBrush="Black">
|
Title="{Binding WindowTitle}" Height="707" Width="930" BorderThickness="1" BorderBrush="Black">
|
||||||
|
@ -50,26 +51,37 @@
|
||||||
<Grid>
|
<Grid>
|
||||||
<avalonDock:DockingManager x:Name="dockManager"
|
<avalonDock:DockingManager x:Name="dockManager"
|
||||||
AnchorablesSource="{Binding Tools}"
|
AnchorablesSource="{Binding Tools}"
|
||||||
DocumentsSource="{Binding ScriptViewModels}"
|
AllowMixedOrientation="True"
|
||||||
|
DocumentsSource="{Binding OpenDocuments}"
|
||||||
ActiveContent="{Binding ActiveDocument, Mode=TwoWay, Converter={StaticResource ActiveDocumentConverter}}">
|
ActiveContent="{Binding ActiveDocument, Mode=TwoWay, Converter={StaticResource ActiveDocumentConverter}}">
|
||||||
<avalonDock:DockingManager.LayoutItemTemplateSelector>
|
<avalonDock:DockingManager.LayoutItemTemplateSelector>
|
||||||
<views:PanesTemplateSelector>
|
<viewsAvalonDock:PanesTemplateSelector>
|
||||||
<views:PanesTemplateSelector.ItemFilterScriptTemplate>
|
<viewsAvalonDock:PanesTemplateSelector.ItemFilterScriptTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<views:ItemFilterScriptView DataContext="{Binding}" />
|
<views:ItemFilterScriptView DataContext="{Binding}" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</views:PanesTemplateSelector.ItemFilterScriptTemplate>
|
</viewsAvalonDock:PanesTemplateSelector.ItemFilterScriptTemplate>
|
||||||
<views:PanesTemplateSelector.SectionBrowserTemplate>
|
<viewsAvalonDock:PanesTemplateSelector.BlockGroupBrowserTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<views:BlockGroupBrowserView DataContext="{Binding}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</viewsAvalonDock:PanesTemplateSelector.BlockGroupBrowserTemplate>
|
||||||
|
<viewsAvalonDock:PanesTemplateSelector.SectionBrowserTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<views:SectionBrowserView DataContext="{Binding}" />
|
<views:SectionBrowserView DataContext="{Binding}" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</views:PanesTemplateSelector.SectionBrowserTemplate>
|
</viewsAvalonDock:PanesTemplateSelector.SectionBrowserTemplate>
|
||||||
</views:PanesTemplateSelector>
|
<viewsAvalonDock:PanesTemplateSelector.StartPageTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<views:StartPageView DataContext="{Binding}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</viewsAvalonDock:PanesTemplateSelector.StartPageTemplate>
|
||||||
|
</viewsAvalonDock:PanesTemplateSelector>
|
||||||
</avalonDock:DockingManager.LayoutItemTemplateSelector>
|
</avalonDock:DockingManager.LayoutItemTemplateSelector>
|
||||||
|
|
||||||
<avalonDock:DockingManager.LayoutItemContainerStyleSelector>
|
<avalonDock:DockingManager.LayoutItemContainerStyleSelector>
|
||||||
<views:PanesStyleSelector>
|
<viewsAvalonDock:PanesStyleSelector>
|
||||||
<views:PanesStyleSelector.ToolStyle>
|
<viewsAvalonDock:PanesStyleSelector.ToolStyle>
|
||||||
<Style TargetType="{x:Type avalonDock:LayoutAnchorableItem}">
|
<Style TargetType="{x:Type avalonDock:LayoutAnchorableItem}">
|
||||||
<Setter Property="Title" Value="{Binding Model.Title}"/>
|
<Setter Property="Title" Value="{Binding Model.Title}"/>
|
||||||
<Setter Property="IconSource" Value="{Binding Model.IconSource}"/>
|
<Setter Property="IconSource" Value="{Binding Model.IconSource}"/>
|
||||||
|
@ -78,51 +90,30 @@
|
||||||
<Setter Property="IsSelected" Value="{Binding Model.IsSelected, Mode=TwoWay}"/>
|
<Setter Property="IsSelected" Value="{Binding Model.IsSelected, Mode=TwoWay}"/>
|
||||||
<Setter Property="IsActive" Value="{Binding Model.IsActive, Mode=TwoWay}"/>
|
<Setter Property="IsActive" Value="{Binding Model.IsActive, Mode=TwoWay}"/>
|
||||||
</Style>
|
</Style>
|
||||||
</views:PanesStyleSelector.ToolStyle>
|
</viewsAvalonDock:PanesStyleSelector.ToolStyle>
|
||||||
<views:PanesStyleSelector.ScriptStyle>
|
<viewsAvalonDock:PanesStyleSelector.DocumentStyle>
|
||||||
<Style TargetType="{x:Type avalonDock:LayoutItem}">
|
<Style TargetType="{x:Type avalonDock:LayoutItem}">
|
||||||
<Setter Property="Title" Value="{Binding Model.Title}"/>
|
<Setter Property="Title" Value="{Binding Model.Title}"/>
|
||||||
<!--<Setter Property="ToolTip" Value="{Binding Model.FilePath}"/>
|
<!--<Setter Property="ToolTip" Value="{Binding Model.FilePath}"/> -->
|
||||||
<Setter Property="CloseCommand" Value="{Binding Model.CloseCommand}"/>-->
|
<Setter Property="CloseCommand" Value="{Binding Model.CloseCommand}"/>
|
||||||
<Setter Property="IconSource" Value="{Binding Model.IconSource}"/>
|
<Setter Property="IconSource" Value="{Binding Model.IconSource}"/>
|
||||||
<Setter Property="ContentId" Value="{Binding Model.ContentId}"/>
|
<Setter Property="ContentId" Value="{Binding Model.ContentId}"/>
|
||||||
</Style>
|
</Style>
|
||||||
</views:PanesStyleSelector.ScriptStyle>
|
</viewsAvalonDock:PanesStyleSelector.DocumentStyle>
|
||||||
</views:PanesStyleSelector>
|
</viewsAvalonDock:PanesStyleSelector>
|
||||||
</avalonDock:DockingManager.LayoutItemContainerStyleSelector>
|
</avalonDock:DockingManager.LayoutItemContainerStyleSelector>
|
||||||
<avalonDock:DockingManager.LayoutUpdateStrategy>
|
<avalonDock:DockingManager.LayoutUpdateStrategy>
|
||||||
<views:LayoutInitializer></views:LayoutInitializer>
|
<viewsAvalonDock:LayoutInitializer></viewsAvalonDock:LayoutInitializer>
|
||||||
</avalonDock:DockingManager.LayoutUpdateStrategy>
|
</avalonDock:DockingManager.LayoutUpdateStrategy>
|
||||||
|
|
||||||
<avalonDock:LayoutRoot>
|
<avalonDock:LayoutRoot>
|
||||||
<avalonDock:LayoutPanel Orientation="Horizontal">
|
<avalonDock:LayoutPanel Orientation="Horizontal">
|
||||||
<avalonDock:LayoutAnchorablePane Name="ToolsPane" DockWidth="150" />
|
<avalonDock:LayoutAnchorablePane Name="SectionBrowserPane" DockWidth="150" />
|
||||||
<avalonDock:LayoutDocumentPane/>
|
<avalonDock:LayoutDocumentPane/>
|
||||||
|
<avalonDock:LayoutAnchorablePane Name="BlockGroupBrowserPane" DockWidth="150" />
|
||||||
</avalonDock:LayoutPanel>
|
</avalonDock:LayoutPanel>
|
||||||
</avalonDock:LayoutRoot>
|
</avalonDock:LayoutRoot>
|
||||||
</avalonDock:DockingManager>
|
</avalonDock:DockingManager>
|
||||||
|
|
||||||
|
|
||||||
<!--<controls:MetroTabControl ItemsSource="{Binding ScriptViewModels}" SelectedItem="{Binding CurrentScriptViewModel}" Name="TabControl" Background="White">
|
|
||||||
<TabControl.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<StackPanel Orientation="Horizontal" Margin="5,0,0,0">
|
|
||||||
<TextBlock Text="{Binding DisplayName}" FontSize="16" VerticalAlignment="Center" Margin="0,0,3,0" />
|
|
||||||
<userControls:CrossButton Height="12" Command="{Binding ElementName=TabControl, Path=DataContext.CloseScriptCommand}" CommandParameter="{Binding}" />
|
|
||||||
</StackPanel>
|
|
||||||
</DataTemplate>
|
|
||||||
</TabControl.ItemTemplate>
|
|
||||||
<TabControl.ContentTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<controls:MetroContentControl>
|
|
||||||
<views:ItemFilterScriptView DataContext="{Binding}" />
|
|
||||||
</controls:MetroContentControl>
|
|
||||||
</DataTemplate>
|
|
||||||
</TabControl.ContentTemplate>
|
|
||||||
</controls:MetroTabControl>-->
|
|
||||||
<TextBlock FontStyle="Italic" Margin="5" FontSize="13" Visibility="{Binding NoScriptsOpen, Converter={StaticResource BooleanToVisibilityConverter}}">Welcome to Filtration, to get started either
|
|
||||||
<Hyperlink Command="{Binding NewScriptCommand}">create a new script</Hyperlink> or <Hyperlink Command="{Binding OpenScriptCommand}">open an existing script</Hyperlink></TextBlock>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</controls:MetroWindow>
|
</controls:MetroWindow>
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
<ListBox ItemsSource="{Binding SectionBlockViewModels}"
|
<ListBox ItemsSource="{Binding SectionBlockViewModels}"
|
||||||
SelectedItem="{Binding SelectedSectionBlockViewModel}"
|
SelectedItem="{Binding SelectedSectionBlockViewModel}"
|
||||||
x:Name="SectionBrowserListBox"
|
x:Name="SectionBrowserListBox"
|
||||||
|
|
||||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"><!--SelectionChanged="SectionBrowserListBox_OnSelectionChanged"-->
|
ScrollViewer.HorizontalScrollBarVisibility="Hidden"><!--SelectionChanged="SectionBrowserListBox_OnSelectionChanged"-->
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
<UserControl x:Class="Filtration.Views.StartPageView"
|
||||||
|
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"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="300" d:DesignWidth="600">
|
||||||
|
<Grid>
|
||||||
|
<TextBlock FontStyle="Italic" Margin="5" FontSize="13">
|
||||||
|
Welcome to Filtration, to get started either
|
||||||
|
<Hyperlink Command="{Binding NewScriptCommand}">create a new script</Hyperlink> or <Hyperlink Command="{Binding OpenScriptCommand}">open an existing script</Hyperlink>
|
||||||
|
</TextBlock>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
|
@ -0,0 +1,28 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace Filtration.Views
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for StartPageView.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class StartPageView : UserControl
|
||||||
|
{
|
||||||
|
public StartPageView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -30,11 +30,21 @@ namespace Filtration.WindsorInstallers
|
||||||
.ImplementedBy<ReplaceColorsViewModel>()
|
.ImplementedBy<ReplaceColorsViewModel>()
|
||||||
.LifeStyle.Singleton);
|
.LifeStyle.Singleton);
|
||||||
|
|
||||||
|
container.Register(
|
||||||
|
Component.For<IStartPageViewModel>()
|
||||||
|
.ImplementedBy<StartPageViewModel>()
|
||||||
|
.LifeStyle.Singleton);
|
||||||
|
|
||||||
container.Register(
|
container.Register(
|
||||||
Component.For<ISectionBrowserViewModel>()
|
Component.For<ISectionBrowserViewModel>()
|
||||||
.ImplementedBy<SectionBrowserViewModel>()
|
.ImplementedBy<SectionBrowserViewModel>()
|
||||||
.LifeStyle.Singleton);
|
.LifeStyle.Singleton);
|
||||||
|
|
||||||
|
container.Register(
|
||||||
|
Component.For<IBlockGroupBrowserViewModel>()
|
||||||
|
.ImplementedBy<BlockGroupBrowserViewModel>()
|
||||||
|
.LifeStyle.Singleton);
|
||||||
|
|
||||||
container.AddFacility<TypedFactoryFacility>();
|
container.AddFacility<TypedFactoryFacility>();
|
||||||
container.Register(
|
container.Register(
|
||||||
Component.For<IItemFilterBlockViewModelFactory>().AsFactory());
|
Component.For<IItemFilterBlockViewModelFactory>().AsFactory());
|
||||||
|
|
Loading…
Reference in New Issue