diff --git a/source/MLibTest/MLibTest/Demos/PanesTemplateSelector.cs b/source/MLibTest/MLibTest/Demos/PanesTemplateSelector.cs
index 3480fba8..ddfe94bc 100644
--- a/source/MLibTest/MLibTest/Demos/PanesTemplateSelector.cs
+++ b/source/MLibTest/MLibTest/Demos/PanesTemplateSelector.cs
@@ -4,6 +4,7 @@
using System.Windows;
using Xceed.Wpf.AvalonDock.Layout;
using AvalonDock.MVVMTestApp;
+ using AvalonDock.Tools;
///
/// Implements a for AvalonDock's documents and toolwindows.
@@ -35,6 +36,11 @@ public PanesTemplateSelector()
///
public DataTemplate ColorPickerViewTemplate { get; set; }
+ ///
+ /// Gets a template for simple testing tool windows.
+ ///
+ public DataTemplate Tooln_ViewTemplate { get; set; }
+
///
/// Determines the matching view for a specific given type of viewmodel.
///
@@ -54,6 +60,9 @@ public override System.Windows.DataTemplate SelectTemplate(object item,
if (item is ColorPickerViewModel)
return ColorPickerViewTemplate;
+ if (item is Tool1_ViewModel || item is Tool2_ViewModel || item is Tool3_ViewModel)
+ return Tooln_ViewTemplate;
+
return base.SelectTemplate(item, container);
}
}
diff --git a/source/MLibTest/MLibTest/Demos/ViewModels/ColorPickerViewModel.cs b/source/MLibTest/MLibTest/Demos/ViewModels/Tools/ColorPickerViewModel.cs
similarity index 99%
rename from source/MLibTest/MLibTest/Demos/ViewModels/ColorPickerViewModel.cs
rename to source/MLibTest/MLibTest/Demos/ViewModels/Tools/ColorPickerViewModel.cs
index 096b6360..580db7e7 100644
--- a/source/MLibTest/MLibTest/Demos/ViewModels/ColorPickerViewModel.cs
+++ b/source/MLibTest/MLibTest/Demos/ViewModels/Tools/ColorPickerViewModel.cs
@@ -1,4 +1,4 @@
-namespace AvalonDock.MVVMTestApp
+namespace AvalonDock.Tools
{
using MLibTest.Demos.ViewModels.Interfaces;
using System;
@@ -7,8 +7,8 @@
using System.Windows.Input;
using MLibTest.ViewModels.Base;
using MLib.Interfaces;
- using System.Windows;
using Settings.Interfaces;
+ using AvalonDock.MVVMTestApp;
///
/// Implements the viewmodel that drives the view a Color Picker tool window.
diff --git a/source/MLibTest/MLibTest/Demos/ViewModels/AD/FileStatsViewModel.cs b/source/MLibTest/MLibTest/Demos/ViewModels/Tools/FileStatsViewModel.cs
similarity index 98%
rename from source/MLibTest/MLibTest/Demos/ViewModels/AD/FileStatsViewModel.cs
rename to source/MLibTest/MLibTest/Demos/ViewModels/Tools/FileStatsViewModel.cs
index 28596f35..4c9f2fca 100644
--- a/source/MLibTest/MLibTest/Demos/ViewModels/AD/FileStatsViewModel.cs
+++ b/source/MLibTest/MLibTest/Demos/ViewModels/Tools/FileStatsViewModel.cs
@@ -1,5 +1,6 @@
-namespace AvalonDock.MVVMTestApp
+namespace AvalonDock.Tools
{
+ using AvalonDock.MVVMTestApp;
using MLibTest.Demos.ViewModels.Interfaces;
using System;
using System.IO;
diff --git a/source/MLibTest/MLibTest/Demos/ViewModels/Tools/Tool1_ViewModel.cs b/source/MLibTest/MLibTest/Demos/ViewModels/Tools/Tool1_ViewModel.cs
new file mode 100644
index 00000000..b1cc29da
--- /dev/null
+++ b/source/MLibTest/MLibTest/Demos/ViewModels/Tools/Tool1_ViewModel.cs
@@ -0,0 +1,184 @@
+namespace AvalonDock.Tools
+{
+ using MLibTest.Demos.ViewModels.Interfaces;
+ using System;
+ using System.Windows.Media.Imaging;
+ using System.Windows.Media;
+ using System.Windows.Input;
+ using MLibTest.ViewModels.Base;
+ using MLib.Interfaces;
+ using Settings.Interfaces;
+ using AvalonDock.MVVMTestApp;
+
+ ///
+ /// Implements the viewmodel that drives a sample tool window view.
+ ///
+ internal class Tool1_ViewModel : ToolViewModel
+ {
+ #region fields
+ ///
+ /// Identifies the of this tool window.
+ ///
+ public const string ToolContentId = "Tool1_Tool";
+
+ ///
+ /// Identifies the caption string used for this tool window.
+ ///
+ public const string ToolTitle = "Tool 1";
+
+ private IWorkSpaceViewModel _workSpaceViewModel = null;
+
+ private Color _SelectedBackgroundColor;
+ private Color _SelectedAccentColor;
+ private ICommand _ResetAccentColorCommand;
+ #endregion fields
+
+ #region constructors
+ ///
+ /// Class constructor
+ ///
+ /// Is the link to the application's viewmodel
+ /// to enable (event based) communication between this viewmodel and the application.
+ public Tool1_ViewModel(IWorkSpaceViewModel workSpaceViewModel)
+ : base(ToolTitle)
+ {
+ _workSpaceViewModel = workSpaceViewModel;
+
+ SetupADToolDefaults();
+ SetupToolDefaults();
+ }
+
+ ///
+ /// Hidden default class constructor
+ ///
+ protected Tool1_ViewModel()
+ : base(ToolTitle)
+ {
+ SetupADToolDefaults();
+ SetupToolDefaults();
+ }
+ #endregion constructors
+
+ #region properties
+ ///
+ /// Gets/sets the currently selected accent color for the color picker in the tool window's view.
+ ///
+ public Color SelectedBackgroundColor
+ {
+ get { return _SelectedBackgroundColor; }
+ set
+ {
+ if (_SelectedBackgroundColor != value)
+ {
+ _SelectedBackgroundColor = value;
+ RaisePropertyChanged(() => SelectedBackgroundColor);
+ }
+ }
+ }
+
+ ///
+ /// Gets/sets the currently selected accent color for the color picker in the tool window's view.
+ ///
+ public Color SelectedAccentColor
+ {
+ get { return _SelectedAccentColor; }
+ set
+ {
+ if (_SelectedAccentColor != value)
+ {
+ _SelectedAccentColor = value;
+ RaisePropertyChanged(() => SelectedAccentColor);
+ }
+ }
+ }
+
+ ///
+ /// Gets a command to reset the currently selected accent color
+ /// and reloads all current resources to make sure that the
+ /// accent is changed consistently.
+ ///
+ public ICommand ResetAccentColorCommand
+ {
+ get
+ {
+ if (_ResetAccentColorCommand == null)
+ {
+ _ResetAccentColorCommand = new RelayCommand