diff --git a/README.md b/README.md
index e8593f5..5d25ebd 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,8 @@
[](https://github.com/Dirkster99/MLib/releases/latest)
[](http://nuget.org/packages/Dirkster.MLib)
+ 
+
# MLib
MLib is a set of WPF theming libraries based on MahApps.Metro,
MUI,
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000..898e4f2
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,37 @@
+version: 1.3.{build}
+
+branches:
+ only:
+ - master
+
+configuration: Release
+
+platform: Any CPU
+
+image: Visual Studio 2019 Preview
+
+install:
+ - cmd: choco install dotnetcore-sdk --pre
+
+before_build:
+ - cmd: nuget restore source\MDemo.sln
+
+build:
+ parallel: true
+ verbosity: minimal
+
+artifacts:
+- path: source\Components\MLib\bin\Release
+ name: MLib
+
+- path: source\Components\MWindowDialogLib\bin\Release
+ name: MWindowDialogLib
+
+- path: source\Components\MWindowLib\bin\Release
+ name: MWindowLib
+
+- path: source\MDemo\bin\Release
+ name: MDemo
+
+- path: source\PDF Binder\PDF Binder\bin\Release
+ name: PDF Binder
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/App.config b/source/00_DemoTemplates/Apps/ThemedDemo/App.config
deleted file mode 100644
index 7cb0cd1..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/App.config
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/App.xaml b/source/00_DemoTemplates/Apps/ThemedDemo/App.xaml
deleted file mode 100644
index a369442..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/App.xaml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/App.xaml.cs b/source/00_DemoTemplates/Apps/ThemedDemo/App.xaml.cs
deleted file mode 100644
index 360a4e5..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/App.xaml.cs
+++ /dev/null
@@ -1,291 +0,0 @@
-namespace ThemedDemo
-{
- using log4net;
- using log4net.Config;
- using MLib.Interfaces;
- using Models;
- using MWindowInterfacesLib.Interfaces;
- using Settings.Interfaces;
- using Settings.UserProfile;
- using System;
- using System.Diagnostics;
- using System.Globalization;
- using System.Threading;
- using System.Windows;
- using ViewModels;
-
- ///
- /// Interaction logic for App.xaml
- ///
- public partial class App : Application
- {
- #region fields
- protected static log4net.ILog Logger;
-
- private ViewModels.AppViewModel _appVM = null;
- private MainWindow _mainWindow = null;
- #endregion fields
-
- #region constructors
- static App()
- {
- XmlConfigurator.Configure();
- Logger = LogManager.GetLogger("default");
-
- // Create service model to ensure available services
- ServiceInjector.InjectServices();
- }
- #endregion constructors
-
- #region methods
- private void Application_Startup(object sender, StartupEventArgs e)
- {
- try
- {
- // Set shutdown mode here (and reset further below) to enable showing custom dialogs (messageboxes)
- // durring start-up without shutting down application when the custom dialogs (messagebox) closes
- ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown;
- }
- catch
- {
- }
-
- var settings = GetService(); // add the default themes
- var appearance = GetService();
- AppLifeCycleViewModel lifeCycle = null;
-
- try
- {
- lifeCycle = new AppLifeCycleViewModel();
- lifeCycle.LoadConfigOnAppStartup(settings, appearance);
-
- appearance.SetTheme(settings.Themes
- , settings.Options.GetOptionValue("Appearance", "ThemeDisplayName")
- , ThemeViewModel.GetCurrentAccentColor(settings));
-
- // Construct Application ViewMOdel and mainWindow
- _appVM = new ViewModels.AppViewModel(lifeCycle);
- _appVM.SetSessionData(settings.SessionData);
-
- // Customize services specific items for this application
- // Program message box service for Modern UI (Metro Light and Dark)
- // var msgBox = GetService();
- // msgBox.Style = MsgBoxStyle.WPFThemed;
-
- }
- catch (Exception exp)
- {
- Debug.WriteLine(exp.Message);
- }
-
- try
- {
- var selectedLanguage = settings.Options.GetOptionValue("Options", "LanguageSelected");
-
- Thread.CurrentThread.CurrentCulture = new CultureInfo(selectedLanguage);
- Thread.CurrentThread.CurrentUICulture = new CultureInfo(selectedLanguage);
- }
- catch
- {
- }
-
- // Create the optional appearance viewmodel and apply
- // current settings to start-up with correct colors etc...
- ////var appearSettings = new AppearanceViewModel(settings.Themes);
- ////appearSettings.ApplyOptionsFromModel(settings.Options);
-
- // Initialize WPF theming and friends ...
- _appVM.InitForMainWindow(GetService()
- , settings.Options.GetOptionValue("Appearance", "ThemeDisplayName"));
-
- Application.Current.MainWindow = _mainWindow = new MainWindow();
- MainWindow.DataContext = _appVM;
-
- AppCore.CreateAppDataFolder();
-
- if (MainWindow != null && _appVM != null)
- {
- // and show it to the user ...
- MainWindow.Loaded += MainWindow_Loaded;
- MainWindow.Closing += OnClosing;
-
- // When the ViewModel asks to be closed, close the window.
- // Source: http://msdn.microsoft.com/en-us/magazine/dd419663.aspx
- MainWindow.Closed += delegate
- {
- // Save session data and close application
- OnClosed(_appVM, _mainWindow);
-
- var dispose = _appVM as IDisposable;
- if (dispose != null)
- dispose.Dispose();
-
- _mainWindow.DataContext = null;
- _appVM = null;
- _mainWindow = null;
- };
-
- ConstructMainWindowSession(_appVM, _mainWindow);
- MainWindow.Show();
- }
- }
-
- ///
- /// Method is invoked when the mainwindow is loaded and visble to the user.
- ///
- ///
- ///
- private void MainWindow_Loaded(object sender, RoutedEventArgs e)
- {
- try
- {
- ShutdownMode = ShutdownMode.OnLastWindowClose;
- }
- catch (Exception exp)
- {
- Logger.Error(exp);
- }
-
- /***
- try
- {
- Application.Current.MainWindow = mMainWin = new MainWindow();
- ShutdownMode = System.Windows.ShutdownMode.OnLastWindowClose;
-
- AppCore.CreateAppDataFolder();
-
- if (mMainWin != null && app != null)
- {
- mMainWin.Closing += OnClosing;
-
-
- ConstructMainWindowSession(app, mMainWin);
- mMainWin.Show();
- }
- }
- catch (Exception exp)
- {
- Logger.Error(exp);
- }
- ***/
- }
-
- ///
- /// COnstruct MainWindow an attach datacontext to it.
- ///
- ///
- ///
- private void ConstructMainWindowSession(AppViewModel workSpace, IViewSize win)
- {
- try
- {
- var settings = GetService();
-
- // Establish command binding to accept user input via commanding framework
- // workSpace.InitCommandBinding(win);
-
- ViewPosSizeModel viewSz;
- settings.SessionData.WindowPosSz.TryGetValue(settings.SessionData.MainWindowName
- , out viewSz);
-
- viewSz.SetWindowsState(win);
-
- string lastActiveFile = settings.SessionData.LastActiveSolution;
-
- MainWindow mainWin = win as MainWindow;
- }
- catch (Exception exp)
- {
- Logger.Error(exp);
- }
- }
-
- ///
- /// Save session data on closing
- ///
- ///
- ///
- private void OnClosing(object sender, System.ComponentModel.CancelEventArgs e)
- {
- try
- {
- AppViewModel wsVM = base.MainWindow.DataContext as AppViewModel;
-
- if (wsVM != null)
- {
- var MainWindowCanClose = MainWindow as IMetroWindow;
-
- if (MainWindowCanClose != null)
- {
- if (MainWindowCanClose.IsContentDialogVisible == true)
- {
- e.Cancel = true; // Lets not close with open dialog
- return;
- }
- }
-
- // Close all open files and check whether application is ready to close
- if (wsVM.AppLifeCycle.Exit_CheckConditions(wsVM) == true)
- {
- // (other than exception and error handling)
- wsVM.AppLifeCycle.OnRequestClose(true);
-
- e.Cancel = false;
- }
- else
- {
- wsVM.AppLifeCycle.CancelShutDown();
- e.Cancel = true;
- }
- }
- }
- catch (Exception exp)
- {
- Logger.Error(exp);
- }
- }
-
- ///
- /// Execute closing function and persist session data to be reloaded on next restart
- ///
- ///
- ///
- private void OnClosed(AppViewModel appVM, IViewSize win)
- {
- try
- {
- var settings = GetService();
-
- ViewPosSizeModel viewSz;
- settings.SessionData.WindowPosSz.TryGetValue(settings.SessionData.MainWindowName
- , out viewSz);
- viewSz.GetWindowsState(win);
-
- _appVM.GetSessionData(settings.SessionData);
-
- // Save/initialize program options that determine global programm behaviour
- appVM.AppLifeCycle.SaveConfigOnAppClosed(win);
- }
- catch (Exception exp)
- {
- Logger.Error(exp);
- //// var msg = GetService();
- ////
- //// msg.Show(exp.ToString(), "Unexpected Error",
- //// MsgBox.MsgBoxButtons.OK, MsgBox.MsgBoxImage.Error);
- }
- }
-
- ///
- /// This method gets the service locator instance
- /// that is used in turn to get an application specific service instance.
- ///
- ///
- ///
- private TServiceContract GetService() where TServiceContract : class
- {
- return ServiceLocator.ServiceContainer.Instance.GetService();
- }
- #endregion methods
- }
-}
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/Behaviors/SelectionChangedBehavior.cs b/source/00_DemoTemplates/Apps/ThemedDemo/Behaviors/SelectionChangedBehavior.cs
deleted file mode 100644
index 2c5ab3e..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/Behaviors/SelectionChangedBehavior.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-namespace ThemedDemo.Behaviors
-{
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Controls.Primitives;
- using System.Windows.Input;
-
- ///
- /// Attached behaviour to implement a selection changed command on a Selector (combobox).
- /// The Selector (combobox) generates a SelectionChanged event which in turn generates a
- /// Command (in this behavior), which in turn is, when bound, invoked on the viewmodel.
- ///
- public static class SelectionChangedCommand
- {
- // Field of attached ICommand property
- private static readonly DependencyProperty ChangedCommandProperty = DependencyProperty.RegisterAttached(
- "ChangedCommand",
- typeof(ICommand),
- typeof(SelectionChangedCommand),
- new PropertyMetadata(null, OnSelectionChangedCommandChange));
-
- ///
- /// Setter method of the attached DropCommand property
- ///
- ///
- ///
- public static void SetChangedCommand(DependencyObject source, ICommand value)
- {
- source.SetValue(ChangedCommandProperty, value);
- }
-
- ///
- /// Getter method of the attached DropCommand property
- ///
- ///
- ///
- public static ICommand GetChangedCommand(DependencyObject source)
- {
- return (ICommand)source.GetValue(ChangedCommandProperty);
- }
-
- ///
- /// This method is hooked in the definition of the .
- /// It is called whenever the attached property changes - in our case the event of binding
- /// and unbinding the property to a sink is what we are looking for.
- ///
- ///
- ///
- private static void OnSelectionChangedCommandChange(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- Selector uiElement = d as Selector; // Remove the handler if it exist to avoid memory leaks
-
- if (uiElement != null)
- {
- uiElement.SelectionChanged -= Selection_Changed;
- uiElement.KeyUp -= uiElement_KeyUp;
-
- var command = e.NewValue as ICommand;
- if (command != null)
- {
- // the property is attached so we attach the Drop event handler
- uiElement.SelectionChanged += Selection_Changed;
- uiElement.KeyUp += uiElement_KeyUp;
- }
- }
- }
-
- private static void uiElement_KeyUp(object sender, KeyEventArgs e)
- {
- if (e == null)
- return;
-
- // Forward key event only if user has hit the return, BackSlash, or Slash key
- if (e.Key != Key.Return)
- return;
-
- ComboBox uiElement = sender as ComboBox;
-
- // Sanity check just in case this was somehow send by something else
- if (uiElement == null)
- return;
-
- ICommand changedCommand = SelectionChangedCommand.GetChangedCommand(uiElement);
-
- // There may not be a command bound to this after all
- if (changedCommand == null)
- return;
-
- // Check whether this attached behaviour is bound to a RoutedCommand
- if (changedCommand is RoutedCommand)
- {
- // Execute the routed command
- (changedCommand as RoutedCommand).Execute(uiElement.Text, uiElement);
- }
- else
- {
- // Execute the Command as bound delegate
- changedCommand.Execute(uiElement.Text);
- }
- }
-
- ///
- /// This method is called when the selection changed event occurs. The sender should be the control
- /// on which this behaviour is attached - so we convert the sender into a
- /// and receive the Command through the getter listed above.
- ///
- /// This implementation supports binding of delegate commands and routed commands.
- ///
- ///
- ///
- private static void Selection_Changed(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
- {
- Selector uiElement = sender as Selector;
-
- // Sanity check just in case this was somehow send by something else
- if (uiElement == null)
- return;
-
- ICommand changedCommand = SelectionChangedCommand.GetChangedCommand(uiElement);
-
- // There may not be a command bound to this after all
- if (changedCommand == null)
- return;
-
- // Check whether this attached behaviour is bound to a RoutedCommand
- if (changedCommand is RoutedCommand)
- {
- // Execute the routed command
- (changedCommand as RoutedCommand).Execute(e.AddedItems, uiElement);
- }
- else
- {
- // Execute the Command as bound delegate
- changedCommand.Execute(e.AddedItems);
- }
- }
- }
-}
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/BindToMLib/MWindowLib/DarkLightBrushs.xaml b/source/00_DemoTemplates/Apps/ThemedDemo/BindToMLib/MWindowLib/DarkLightBrushs.xaml
deleted file mode 100644
index 034e55e..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/BindToMLib/MWindowLib/DarkLightBrushs.xaml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
- Blue
-
-
-
-
- #FFF4F4F5
-
- #FF2D2D30
-
-
-
-
-
-
- #FF3F3F41
-
-
-
-
\ No newline at end of file
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/Demos/Behaviors/SelectionChangedBehavior.cs .cs b/source/00_DemoTemplates/Apps/ThemedDemo/Demos/Behaviors/SelectionChangedBehavior.cs .cs
deleted file mode 100644
index b2db3e1..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/Demos/Behaviors/SelectionChangedBehavior.cs .cs
+++ /dev/null
@@ -1,138 +0,0 @@
-namespace ThemedDemo.Demos.Behaviors
-{
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Controls.Primitives;
- using System.Windows.Input;
-
- ///
- /// Attached behaviour to implement a selection changed command on a Selector (combobox).
- /// The Selector (combobox) generates a SelectionChanged event which in turn generates a
- /// Command (in this behavior), which in turn is, when bound, invoked on the viewmodel.
- ///
- public static class SelectionChangedCommand
- {
- // Field of attached ICommand property
- private static readonly DependencyProperty ChangedCommandProperty = DependencyProperty.RegisterAttached(
- "ChangedCommand",
- typeof(ICommand),
- typeof(SelectionChangedCommand),
- new PropertyMetadata(null, OnSelectionChangedCommandChange));
-
- ///
- /// Setter method of the attached DropCommand property
- ///
- ///
- ///
- public static void SetChangedCommand(DependencyObject source, ICommand value)
- {
- source.SetValue(ChangedCommandProperty, value);
- }
-
- ///
- /// Getter method of the attached DropCommand property
- ///
- ///
- ///
- public static ICommand GetChangedCommand(DependencyObject source)
- {
- return (ICommand)source.GetValue(ChangedCommandProperty);
- }
-
- ///
- /// This method is hooked in the definition of the .
- /// It is called whenever the attached property changes - in our case the event of binding
- /// and unbinding the property to a sink is what we are looking for.
- ///
- ///
- ///
- private static void OnSelectionChangedCommandChange(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- Selector uiElement = d as Selector; // Remove the handler if it exist to avoid memory leaks
-
- if (uiElement != null)
- {
- uiElement.SelectionChanged -= Selection_Changed;
- uiElement.KeyUp -= uiElement_KeyUp;
-
- var command = e.NewValue as ICommand;
- if (command != null)
- {
- // the property is attached so we attach the Drop event handler
- uiElement.SelectionChanged += Selection_Changed;
- uiElement.KeyUp += uiElement_KeyUp;
- }
- }
- }
-
- private static void uiElement_KeyUp(object sender, KeyEventArgs e)
- {
- if (e == null)
- return;
-
- // Forward key event only if user has hit the return, BackSlash, or Slash key
- if (e.Key != Key.Return)
- return;
-
- ComboBox uiElement = sender as ComboBox;
-
- // Sanity check just in case this was somehow send by something else
- if (uiElement == null)
- return;
-
- ICommand changedCommand = SelectionChangedCommand.GetChangedCommand(uiElement);
-
- // There may not be a command bound to this after all
- if (changedCommand == null)
- return;
-
- // Check whether this attached behaviour is bound to a RoutedCommand
- if (changedCommand is RoutedCommand)
- {
- // Execute the routed command
- (changedCommand as RoutedCommand).Execute(uiElement.Text, uiElement);
- }
- else
- {
- // Execute the Command as bound delegate
- changedCommand.Execute(uiElement.Text);
- }
- }
-
- ///
- /// This method is called when the selection changed event occurs. The sender should be the control
- /// on which this behaviour is attached - so we convert the sender into a
- /// and receive the Command through the getter listed above.
- ///
- /// This implementation supports binding of delegate commands and routed commands.
- ///
- ///
- ///
- private static void Selection_Changed(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
- {
- Selector uiElement = sender as Selector;
-
- // Sanity check just in case this was somehow send by something else
- if (uiElement == null)
- return;
-
- ICommand changedCommand = SelectionChangedCommand.GetChangedCommand(uiElement);
-
- // There may not be a command bound to this after all
- if (changedCommand == null)
- return;
-
- // Check whether this attached behaviour is bound to a RoutedCommand
- if (changedCommand is RoutedCommand)
- {
- // Execute the routed command
- (changedCommand as RoutedCommand).Execute(e.AddedItems, uiElement);
- }
- else
- {
- // Execute the Command as bound delegate
- changedCommand.Execute(e.AddedItems);
- }
- }
- }
-}
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/Demos/Models/FolderBrowserResult.cs b/source/00_DemoTemplates/Apps/ThemedDemo/Demos/Models/FolderBrowserResult.cs
deleted file mode 100644
index bbec5b1..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/Demos/Models/FolderBrowserResult.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-namespace ThemedDemo.Demos.Models
-{
- public class FolderBrowserResult
- {
- #region constructors
- public FolderBrowserResult()
- {
- this.Path = default(string);
- this.Result = null;
- }
- #endregion constructors
-
- #region properties
- public string Path { get; private set; }
-
- public bool? Result { get; private set; }
- #endregion properties
-
- #region methods
- public void SetResult(bool result)
- {
- this.Result = result;
- }
-
- public void SetPath(string path)
- {
- if (string.IsNullOrEmpty(path) == false)
- Path = path;
- else
- Path = default(string);
- }
- #endregion methods
- }
-}
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/Demos/ViewModels/DemoViewModel.cs b/source/00_DemoTemplates/Apps/ThemedDemo/Demos/ViewModels/DemoViewModel.cs
deleted file mode 100644
index 58efca6..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/Demos/ViewModels/DemoViewModel.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-namespace ThemedDemo.Demos.ViewModels
-{
- using System.Linq;
- using System.Windows.Input;
-
- public class DemoViewModel : ThemedDemo.ViewModels.Base.ViewModelBase
- {
- #region private fields
- #endregion private fields
-
- #region constructors
- ///
- /// Class constructor
- ///
- public DemoViewModel()
- {
- }
- #endregion constructors
-
- #region properties
- #endregion properties
-
- #region methods
- #endregion methods
- }
-}
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/Demos/Views/FolderBrowserContentDialogView.xaml b/source/00_DemoTemplates/Apps/ThemedDemo/Demos/Views/FolderBrowserContentDialogView.xaml
deleted file mode 100644
index 5e84496..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/Demos/Views/FolderBrowserContentDialogView.xaml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/Demos/Views/FolderBrowserContentDialogView.xaml.cs b/source/00_DemoTemplates/Apps/ThemedDemo/Demos/Views/FolderBrowserContentDialogView.xaml.cs
deleted file mode 100644
index 17b8832..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/Demos/Views/FolderBrowserContentDialogView.xaml.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-namespace ThemedDemo.Demos.Views
-{
- using System.Windows.Controls;
-
- ///
- /// Interaction logic for FolderBrowserContentDialogView.xaml
- ///
- /// This type of dialog can be shown as overlay over the actual MainWindow.
- ///
- public partial class FolderBrowserContentDialogView : UserControl
- {
- public FolderBrowserContentDialogView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/Demos/Views/FolderBrowserDialog.xaml b/source/00_DemoTemplates/Apps/ThemedDemo/Demos/Views/FolderBrowserDialog.xaml
deleted file mode 100644
index b0ddb30..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/Demos/Views/FolderBrowserDialog.xaml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/Demos/Views/FolderBrowserDialog.xaml.cs b/source/00_DemoTemplates/Apps/ThemedDemo/Demos/Views/FolderBrowserDialog.xaml.cs
deleted file mode 100644
index 9776c68..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/Demos/Views/FolderBrowserDialog.xaml.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-namespace ThemedDemo.Demos.Views
-{
- using FolderBrowser.Dialogs.Interfaces;
- using System.Windows;
-
- ///
- /// Interaction logic for FolderBrowserDialog.xaml
- ///
- public partial class FolderBrowserDialog : MWindowLib.MetroWindow
- {
- #region constructor
- ///
- /// Standard constructor
- ///
- public FolderBrowserDialog()
- {
- InitializeComponent();
-
- Closing += FolderBrowserDialog_Closing;
- }
-
- private void FolderBrowserDialog_Closing(object sender, System.ComponentModel.CancelEventArgs e)
- {
- // Make sure that dialog cannot be closed while task is being processed...
- var dlg = DataContext as IDialogViewModel;
-
- if (dlg == null)
- return;
-
- if (dlg.TreeBrowser != null)
- {
- if (dlg.TreeBrowser.IsBrowsing == true)
- e.Cancel = true;
- }
- }
- #endregion constructor
-
- #region methods
- private void Ok_Click(object sender, RoutedEventArgs e)
- {
- DialogResult = true;
- }
- #endregion methods
- }
-}
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/MainWindow.xaml b/source/00_DemoTemplates/Apps/ThemedDemo/MainWindow.xaml
deleted file mode 100644
index 52062d8..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/MainWindow.xaml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This is a simple demo program for a breadcumb directory picker control.
-
-
-
-
-
-
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/MainWindow.xaml.cs b/source/00_DemoTemplates/Apps/ThemedDemo/MainWindow.xaml.cs
deleted file mode 100644
index 2048708..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/MainWindow.xaml.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-namespace ThemedDemo
-{
- using Settings.UserProfile;
- using ViewModels;
-
- ///
- /// Interaction logic for MainWindow.xaml
- ///
- public partial class MainWindow : MWindowLib.MetroWindow
- , IViewSize // Implements saving and loading/repositioning of Window
- {
- public MainWindow()
- {
- InitializeComponent();
- Loaded += MainWindow_Loaded;
- }
-
- private void MainWindow_Loaded(object sender, System.Windows.RoutedEventArgs e)
- {
- Loaded -= MainWindow_Loaded;
-
- var viewModel = this.DataContext as AppViewModel;
-
- }
- }
-}
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/Models/AppCore.cs b/source/00_DemoTemplates/Apps/ThemedDemo/Models/AppCore.cs
deleted file mode 100644
index 6f7107d..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/Models/AppCore.cs
+++ /dev/null
@@ -1,128 +0,0 @@
-namespace ThemedDemo.Models
-{
- using System;
- using System.Globalization;
- using System.Reflection;
-
- ///
- /// Class supplies a set of common static helper methodes that help
- /// localizing application specific items such as setting folders etc.
- ///
- public class AppCore
- {
- #region properties
- ///
- /// Get the name of the executing assembly (usually name of *.exe file)
- ///
- internal static string AssemblyTitle
- {
- get
- {
- return Assembly.GetEntryAssembly().GetName().Name;
- }
- }
-
- //
- // Summary:
- // Gets the path or UNC location of the loaded file that contains the manifest.
- //
- // Returns:
- // The location of the loaded file that contains the manifest. If the loaded
- // file was shadow-copied, the location is that of the file after being shadow-copied.
- // If the assembly is loaded from a byte array, such as when using the System.Reflection.Assembly.Load(System.Byte[])
- // method overload, the value returned is an empty string ("").
- internal static string AssemblyEntryLocation
- {
- get
- {
- return System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
- }
- }
-
- ///
- /// Get a path to the directory where the user store his documents
- ///
- public static string MyDocumentsUserDir
- {
- get
- {
- return Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
- }
- }
-
- public static string Company
- {
- get
- {
- return "ThemedDemo";
- }
- }
- public static string Application_Title
- {
- get
- {
- return "ThemedDemo";
- }
- }
-
- ///
- /// Get a path to the directory where the application
- /// can persist/load user data on session exit and re-start.
- ///
- public static string DirAppData
- {
- get
- {
- return Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
- System.IO.Path.DirectorySeparatorChar +
- AppCore.Company;
- }
- }
-
-//// ///
-//// /// Get path and file name to application specific settings file
-//// ///
-//// public static string DirFileAppSettingsData
-//// {
-//// get
-//// {
-//// return System.IO.Path.Combine(AppCore.DirAppData,
-//// string.Format(CultureInfo.InvariantCulture, "{0}.App.settings", AppCore.AssemblyTitle));
-//// }
-//// }
-
- ///
- /// Get path and file name to application specific session file
- ///
- public static string DirFileAppSessionData
- {
- get
- {
- return System.IO.Path.Combine(AppCore.DirAppData,
- string.Format(CultureInfo.InvariantCulture, "{0}.App.session", AppCore.AssemblyTitle));
- }
- }
- #endregion properties
-
- #region methods
- ///
- /// Create a dedicated directory to store program settings and session data
- ///
- ///
- public static bool CreateAppDataFolder()
- {
- try
- {
- if (System.IO.Directory.Exists(AppCore.DirAppData) == false)
- System.IO.Directory.CreateDirectory(AppCore.DirAppData);
- }
- catch
- {
- return false;
- }
-
- return true;
- }
- #endregion methods
- }
-}
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/Models/SettingDefaults.cs b/source/00_DemoTemplates/Apps/ThemedDemo/Models/SettingDefaults.cs
deleted file mode 100644
index 1767f9e..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/Models/SettingDefaults.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-namespace ThemedDemo.Models
-{
- using Settings.Interfaces;
- using SettingsModel.Interfaces;
- using System.Windows.Media;
-
- ///
- /// Class contains all methods necessary to initialize the applications settings model.
- ///
- internal static class SettingDefaults
- {
- ///
- /// Create the minimal settings model that should be used for every application.
- /// This model does not include advanced features like theming etc...
- ///
- ///
- public static void CreateGeneralSettings(IEngine options)
- {
- const string groupName = "Options";
-
- options.AddOption(groupName, "ReloadOpenFilesFromLastSession", typeof(bool), false, true);
- options.AddOption(groupName, "SourceFilePath", typeof(string), false, @"C:\temp\source\");
- options.AddOption(groupName, "LanguageSelected", typeof(string), false, "en-US");
-
- // var schema = optsEngine.AddListOption(groupName, "BookmarkedFolders", typeof(string), false, new List());
- // schema.List_AddValue(@"C:\TEMP", @"C:\TEMP");
- // schema.List_AddValue(@"C:\Windows", @"C:\Windows");
- }
-
- ///
- /// Create the minimal settings model that should be used for every application.
- ///
- ///
- public static void CreateAppearanceSettings(IEngine options, ISettingsManager settings)
- {
- const string groupName = "Appearance";
-
- options.AddOption(groupName, "ThemeDisplayName", typeof(string), false, "Dark");
- options.AddOption(groupName, "ApplyWindowsDefaultAccent", typeof(bool), false, true);
- options.AddOption(groupName, "AccentColor", typeof(Color), false, Color.FromRgb(0x33, 0x99, 0xff));
-
- // options.AddOption(groupName, "DefaultIconSize", typeof(int), false, settings.DefaultIconSize);
- // options.AddOption(groupName, "DefaultFontSize", typeof(int), false, settings.DefaultFontSize);
- // options.AddOption(groupName, "FixedFontSize", typeof(int), false, settings.DefaultFixedFontSize);
- }
- }
-}
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/Properties/AssemblyInfo.cs b/source/00_DemoTemplates/Apps/ThemedDemo/Properties/AssemblyInfo.cs
deleted file mode 100644
index 30a3f3f..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("ThemedDemo")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("ThemedDemo")]
-[assembly: AssemblyCopyright("Copyright © 2018")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-//In order to begin building localizable applications, set
-//CultureYouAreCodingWith in your .csproj file
-//inside a . For example, if you are using US english
-//in your source files, set the to en-US. Then uncomment
-//the NeutralResourceLanguage attribute below. Update the "en-US" in
-//the line below to match the UICulture setting in the project file.
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly: ThemeInfo(
- ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
- //(used if a resource is not found in the page,
- // or application resource dictionaries)
- ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
- //(used if a resource is not found in the page,
- // app, or any theme specific resource dictionaries)
-)]
-
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// 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")]
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/Properties/Resources.Designer.cs b/source/00_DemoTemplates/Apps/ThemedDemo/Properties/Resources.Designer.cs
deleted file mode 100644
index 1979e7f..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace ThemedDemo.Properties
-{
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources
- {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources()
- {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if ((resourceMan == null))
- {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ThemedDemo.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture
- {
- get
- {
- return resourceCulture;
- }
- set
- {
- resourceCulture = value;
- }
- }
- }
-}
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/Properties/Resources.resx b/source/00_DemoTemplates/Apps/ThemedDemo/Properties/Resources.resx
deleted file mode 100644
index af7dbeb..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/Properties/Settings.Designer.cs b/source/00_DemoTemplates/Apps/ThemedDemo/Properties/Settings.Designer.cs
deleted file mode 100644
index 2e039fa..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace ThemedDemo.Properties
-{
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
- {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default
- {
- get
- {
- return defaultInstance;
- }
- }
- }
-}
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/Properties/Settings.settings b/source/00_DemoTemplates/Apps/ThemedDemo/Properties/Settings.settings
deleted file mode 100644
index 033d7a5..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/ServiceInjector.cs b/source/00_DemoTemplates/Apps/ThemedDemo/ServiceInjector.cs
deleted file mode 100644
index 762b385..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/ServiceInjector.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-namespace ThemedDemo
-{
- using MLib;
- using MLib.Interfaces;
- using ServiceLocator;
- using Settings;
- using Settings.Interfaces;
-
- ///
- /// Creates and initializes all services.
- ///
- public static class ServiceInjector
- {
- ///
- /// Loads service objects into the ServiceContainer on startup of application.
- ///
- /// Returns the current instance
- /// to let caller work with service container items right after creation.
- public static ServiceContainer InjectServices()
- {
- var appearance = AppearanceManager.GetInstance();
- ServiceContainer.Instance.AddService(SettingsManager.GetInstance(appearance.CreateThemeInfos()));
- ServiceContainer.Instance.AddService(appearance);
-
- return ServiceContainer.Instance;
- }
- }
-}
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/ThemedDemo.csproj b/source/00_DemoTemplates/Apps/ThemedDemo/ThemedDemo.csproj
deleted file mode 100644
index 9bdedfe..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/ThemedDemo.csproj
+++ /dev/null
@@ -1,188 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {58BD0E02-6BFF-43F0-9B93-D3371E97794B}
- WinExe
- ThemedDemo
- ThemedDemo
- v4.5.2
- 512
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- 4
- true
-
-
- AnyCPU
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- AnyCPU
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
- true
- bin\x64\Debug\
- DEBUG;TRACE
- full
- x64
- prompt
- MinimumRecommendedRules.ruleset
- true
-
-
- bin\x64\Release\
- TRACE
- true
- pdbonly
- x64
- prompt
- MinimumRecommendedRules.ruleset
- true
-
-
- true
- bin\x86\Debug\
- DEBUG;TRACE
- full
- x86
- prompt
- MinimumRecommendedRules.ruleset
- true
-
-
- bin\x86\Release\
- TRACE
- true
- pdbonly
- x86
- prompt
- MinimumRecommendedRules.ruleset
- true
-
-
-
- ..\..\packages\log4net.2.0.8\lib\net45-full\log4net.dll
-
-
- ..\..\packages\Dirkster.MWindowLib.1.1.0\lib\net452\Microsoft.Expression.Interactions.dll
-
-
- ..\..\packages\Dirkster.MLib.1.1.0\lib\net4\MLib.dll
-
-
- ..\..\packages\Dirkster.MWindowLib.1.1.0\lib\net452\MWindowInterfacesLib.dll
-
-
- ..\..\packages\Dirkster.MWindowLib.1.1.0\lib\net452\MWindowLib.dll
-
-
-
-
- ..\..\packages\Dirkster.MWindowLib.1.1.0\lib\net452\System.Windows.Interactivity.dll
-
-
-
-
-
-
- 4.0
-
-
- ..\..\packages\Dirkster.UserNotifications.1.5.0\lib\net40\UserNotification.dll
-
-
-
-
-
-
-
- MSBuild:Compile
- Designer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MSBuild:Compile
- Designer
-
-
- App.xaml
- Code
-
-
- MainWindow.xaml
- Code
-
-
- Designer
- MSBuild:Compile
-
-
-
-
- Code
-
-
- True
- True
- Resources.resx
-
-
- True
- Settings.settings
- True
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
-
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
-
-
-
-
-
- {252126d1-e1d9-49c3-910b-fcf2266265ef}
- ServiceLocator
-
-
- {9b0ba841-5a2f-4ed3-a908-253dbca70e77}
- SettingsModel
-
-
- {2807b493-cc2e-402e-901a-eb138698fedc}
- Settings
-
-
-
-
-
\ No newline at end of file
diff --git a/source/00_DemoTemplates/Apps/ThemedDemo/ViewModels/AppLifeCycleViewModel.cs b/source/00_DemoTemplates/Apps/ThemedDemo/ViewModels/AppLifeCycleViewModel.cs
deleted file mode 100644
index f79b34d..0000000
--- a/source/00_DemoTemplates/Apps/ThemedDemo/ViewModels/AppLifeCycleViewModel.cs
+++ /dev/null
@@ -1,359 +0,0 @@
-namespace ThemedDemo.ViewModels
-{
- using MLib.Interfaces;
- using Models;
- using Settings.Interfaces;
- using Settings.UserProfile;
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Windows.Input;
-
- ///
- /// Implements application life cycle relevant properties and methods,
- /// such as: state for shutdown, shutdown_cancel, command for shutdown,
- /// and methods for save and load application configuration.
- ///
- public class AppLifeCycleViewModel : Base.ViewModelBase
- {
- #region fields
- protected static readonly log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
-
- private bool? mDialogCloseResult = null;
- private bool mShutDownInProgress = false;
- private bool mShutDownInProgress_Cancel = false;
-
- private ICommand mExitApp = null;
- #endregion fields
-
- #region properties
- ///
- /// Gets a string for display of the application title.
- ///
- public string Application_Title
- {
- get
- {
- return Models.AppCore.Application_Title;
- }
- }
-
- ///
- /// Get path and file name to application specific settings file
- ///
- public string DirFileAppSettingsData
- {
- get
- {
- return System.IO.Path.Combine(Models.AppCore.DirAppData,
- string.Format(CultureInfo.InvariantCulture, "{0}.App.settings",
- Models.AppCore.AssemblyTitle));
- }
- }
-
- ///
- /// This can be used to close the attached view via ViewModel
- ///
- /// Source: http://stackoverflow.com/questions/501886/wpf-mvvm-newbie-how-should-the-viewmodel-close-the-form
- ///
- public bool? DialogCloseResult
- {
- get
- {
- return mDialogCloseResult;
- }
-
- private set
- {
- if (mDialogCloseResult != value)
- {
- mDialogCloseResult = value;
- NotifyPropertyChanged(() => DialogCloseResult);
- }
- }
- }
-
- ///
- /// Gets a command to exit (end) the application.
- ///
- public ICommand ExitApp
- {
- get
- {
- if (mExitApp == null)
- {
- mExitApp = new Base.RelayCommand