diff --git a/Dapplo.CaliburnMicro.Demo/Dapplo.CaliburnMicro.Demo.csproj b/Dapplo.CaliburnMicro.Demo/Dapplo.CaliburnMicro.Demo.csproj
index 81729d70..f0fa661b 100644
--- a/Dapplo.CaliburnMicro.Demo/Dapplo.CaliburnMicro.Demo.csproj
+++ b/Dapplo.CaliburnMicro.Demo/Dapplo.CaliburnMicro.Demo.csproj
@@ -86,15 +86,19 @@
..\packages\Hardcodet.NotifyIcon.Wpf.1.0.8\lib\net451\Hardcodet.Wpf.TaskbarNotification.dllTrue
-
- ..\packages\MahApps.Metro.1.3.0-ALPHA179\lib\net45\MahApps.Metro.dll
+
+ ..\packages\MahApps.Metro.1.3.0-ALPHA182\lib\net45\MahApps.Metro.dll
+ True
+
+
+ ..\packages\MahApps.Metro.IconPacks.Material.1.0.0\lib\net452\MahApps.Metro.IconPacks.Material.dllTrue
- ..\packages\MahApps.Metro.1.3.0-ALPHA179\lib\net45\System.Windows.Interactivity.dll
+ ..\packages\MahApps.Metro.1.3.0-ALPHA182\lib\net45\System.Windows.Interactivity.dllTrue
@@ -127,6 +131,7 @@
+
@@ -178,6 +183,10 @@
DesignerMSBuild:Compile
+
+ MSBuild:Compile
+ Designer
+ DesignerMSBuild:Compile
diff --git a/Dapplo.CaliburnMicro.Demo/Languages/IWizardTranslations.cs b/Dapplo.CaliburnMicro.Demo/Languages/IWizardTranslations.cs
index 85e52b16..0322333a 100644
--- a/Dapplo.CaliburnMicro.Demo/Languages/IWizardTranslations.cs
+++ b/Dapplo.CaliburnMicro.Demo/Languages/IWizardTranslations.cs
@@ -44,5 +44,6 @@ public interface IWizardTranslations : ILanguage, INotifyPropertyChanged
string TitleStep2 { get; }
string TitleStep3 { get; }
string TitleStep4 { get; }
+ string TitleStep5 { get; }
}
}
\ No newline at end of file
diff --git a/Dapplo.CaliburnMicro.Demo/Languages/language-de-DE.xml b/Dapplo.CaliburnMicro.Demo/Languages/language-de-DE.xml
index db963322..02b30402 100644
--- a/Dapplo.CaliburnMicro.Demo/Languages/language-de-DE.xml
+++ b/Dapplo.CaliburnMicro.Demo/Languages/language-de-DE.xml
@@ -45,5 +45,6 @@
Schritt 2Schritt 3Schritt 4
+ Schritt 5
\ No newline at end of file
diff --git a/Dapplo.CaliburnMicro.Demo/Languages/language-en-US.xml b/Dapplo.CaliburnMicro.Demo/Languages/language-en-US.xml
index fff62770..85b80f48 100644
--- a/Dapplo.CaliburnMicro.Demo/Languages/language-en-US.xml
+++ b/Dapplo.CaliburnMicro.Demo/Languages/language-en-US.xml
@@ -45,5 +45,6 @@
Step 2Step 3Step 4
+ Step 5
\ No newline at end of file
diff --git a/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/ConfigMenuItem.cs b/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/ConfigMenuItem.cs
index 5f9db46d..11f6be7b 100644
--- a/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/ConfigMenuItem.cs
+++ b/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/ConfigMenuItem.cs
@@ -33,7 +33,7 @@
using Dapplo.CaliburnMicro.Menu;
using Dapplo.Log.Facade;
using Dapplo.Utils;
-using MahApps.Metro.Controls;
+using MahApps.Metro.IconPacks;
#endregion
@@ -60,9 +60,9 @@ public void OnImportsSatisfied()
{
UiContext.RunOn(() =>
{
- Icon = new PackIconModern
+ Icon = new PackIconMaterial
{
- Kind = PackIconModernKind.Settings
+ Kind = PackIconMaterialKind.Settings
};
// automatically update the DisplayName
this.BindDisplayName(ContextMenuTranslations, nameof(IContextMenuTranslations.Configure));
diff --git a/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/ExitMenuItem.cs b/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/ExitMenuItem.cs
index f3eb837a..eeabab32 100644
--- a/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/ExitMenuItem.cs
+++ b/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/ExitMenuItem.cs
@@ -30,8 +30,8 @@
using Dapplo.CaliburnMicro.Extensions;
using Dapplo.CaliburnMicro.Menu;
using Dapplo.Utils;
-using MahApps.Metro.Controls;
using System.Windows;
+using MahApps.Metro.IconPacks;
#endregion
diff --git a/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/SomeWindowMenuItem.cs b/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/SomeWindowMenuItem.cs
index 8590bc57..028ca397 100644
--- a/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/SomeWindowMenuItem.cs
+++ b/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/SomeWindowMenuItem.cs
@@ -33,7 +33,7 @@
using Dapplo.CaliburnMicro.Menu;
using Dapplo.Log.Facade;
using Dapplo.Utils;
-using MahApps.Metro.Controls;
+using MahApps.Metro.IconPacks;
#endregion
@@ -60,9 +60,9 @@ public void OnImportsSatisfied()
{
UiContext.RunOn(() =>
{
- Icon = new PackIconModern
+ Icon = new PackIconMaterial
{
- Kind = PackIconModernKind.List
+ Kind = PackIconMaterialKind.ViewList
};
// automatically update the DisplayName
this.BindDisplayName(ContextMenuTranslations, nameof(IContextMenuTranslations.SomeWindow));
diff --git a/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/WithChildrenMenuItem.cs b/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/WithChildrenMenuItem.cs
index 4342fbe7..24713a95 100644
--- a/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/WithChildrenMenuItem.cs
+++ b/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/WithChildrenMenuItem.cs
@@ -33,7 +33,7 @@
using Dapplo.CaliburnMicro.Menu;
using Dapplo.Log.Facade;
using Dapplo.Utils;
-using MahApps.Metro.Controls;
+using MahApps.Metro.IconPacks;
#endregion
diff --git a/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/WizardMenuItem.cs b/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/WizardMenuItem.cs
index d6c4ac0d..07588112 100644
--- a/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/WizardMenuItem.cs
+++ b/Dapplo.CaliburnMicro.Demo/UseCases/ContextMenu/WizardMenuItem.cs
@@ -33,6 +33,7 @@
using Dapplo.CaliburnMicro.Menu;
using Dapplo.Utils;
using MahApps.Metro.Controls;
+using MahApps.Metro.IconPacks;
#endregion
@@ -59,9 +60,9 @@ public void OnImportsSatisfied()
{
// automatically update the DisplayName
this.BindDisplayName(ContextMenuTranslations, nameof(IContextMenuTranslations.Wizard));
- Icon = new PackIconFontAwesome
+ Icon = new PackIconMaterial
{
- Kind = PackIconFontAwesomeKind.Magic
+ Kind = PackIconMaterialKind.Alarm
};
});
}
diff --git a/Dapplo.CaliburnMicro.Demo/UseCases/Menu/SaveAsMenuItem.cs b/Dapplo.CaliburnMicro.Demo/UseCases/Menu/SaveAsMenuItem.cs
index d209ba4c..820c13d9 100644
--- a/Dapplo.CaliburnMicro.Demo/UseCases/Menu/SaveAsMenuItem.cs
+++ b/Dapplo.CaliburnMicro.Demo/UseCases/Menu/SaveAsMenuItem.cs
@@ -31,6 +31,7 @@
using Dapplo.CaliburnMicro.Menu;
using Dapplo.Utils;
using MahApps.Metro.Controls;
+using MahApps.Metro.IconPacks;
#endregion
@@ -53,9 +54,9 @@ public void OnImportsSatisfied()
{
// automatically update the DisplayName
this.BindDisplayName(MenuTranslations, nameof(IMenuTranslations.SaveAs));
- Icon = new PackIconEntypo
+ Icon = new PackIconMaterial
{
- Kind = PackIconEntypoKind.Save
+ Kind = PackIconMaterialKind.ContentSave
};
});
}
diff --git a/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/ViewModels/WizardExampleViewModel.cs b/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/ViewModels/WizardExampleViewModel.cs
index c7cb216a..88b17a94 100644
--- a/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/ViewModels/WizardExampleViewModel.cs
+++ b/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/ViewModels/WizardExampleViewModel.cs
@@ -26,12 +26,14 @@
#region Usings
using System.Collections.Generic;
+using System.ComponentModel;
using System.ComponentModel.Composition;
using System.Linq;
using Dapplo.CaliburnMicro.Demo.Languages;
using Dapplo.CaliburnMicro.Extensions;
using Dapplo.CaliburnMicro.Wizard;
using Dapplo.CaliburnMicro.Wizard.ViewModels;
+using Dapplo.CaliburnMicro.Collections;
#endregion
@@ -66,11 +68,11 @@ public bool IsStep2Enabled
public void OnImportsSatisfied()
{
- WizardProgress = new WizardProgressViewModel(this);
// automatically update the DisplayName
this.BindDisplayName(WizardTranslations, nameof(IWizardTranslations.Title));
- // Set the WizardScreens by ordering them
- WizardScreens = WizardItems.OrderBy(x => x.Order);
+ // Set the WizardScreens as TrulyObservableCollection (needed for the WizardProgressViewModel) and by ordering them
+ WizardScreens = new TrulyObservableCollection(WizardItems.OrderBy(x => x.Order));
+ WizardProgress = new WizardProgressViewModel(this);
}
protected override void OnActivate()
diff --git a/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/ViewModels/WizardStep3ViewModel.cs b/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/ViewModels/WizardStep3ViewModel.cs
index 76cf6b74..a7da9a6a 100644
--- a/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/ViewModels/WizardStep3ViewModel.cs
+++ b/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/ViewModels/WizardStep3ViewModel.cs
@@ -52,6 +52,7 @@ public override void Initialize()
{
// automatically update the DisplayName
_displayNameUpdater = this.BindDisplayName(WizardTranslations, nameof(IWizardTranslations.TitleStep3));
+ IsVisible = false;
}
public override void Terminate()
diff --git a/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/ViewModels/WizardStep5ViewModel.cs b/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/ViewModels/WizardStep5ViewModel.cs
new file mode 100644
index 00000000..f37801eb
--- /dev/null
+++ b/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/ViewModels/WizardStep5ViewModel.cs
@@ -0,0 +1,62 @@
+#region Dapplo 2016 - GNU Lesser General Public License
+
+// Dapplo - building blocks for .NET applications
+// Copyright (C) 2016 Dapplo
+//
+// For more information see: http://dapplo.net/
+// Dapplo repositories are hosted on GitHub: https://github.com/dapplo
+//
+// This file is part of Dapplo.CaliburnMicro
+//
+// Dapplo.CaliburnMicro is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Dapplo.CaliburnMicro is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Lesser General Public License for more details.
+//
+// You should have a copy of the GNU Lesser General Public License
+// along with Dapplo.CaliburnMicro. If not, see .
+
+#endregion
+
+#region Usings
+
+using System;
+using System.ComponentModel.Composition;
+using Dapplo.CaliburnMicro.Demo.Languages;
+using Dapplo.CaliburnMicro.Extensions;
+using Dapplo.CaliburnMicro.Wizard;
+
+#endregion
+
+namespace Dapplo.CaliburnMicro.Demo.UseCases.Wizard.ViewModels
+{
+ [Export(typeof(IWizardScreen))]
+ public sealed class WizardStep5ViewModel : WizardScreen
+ {
+ private IDisposable _displayNameUpdater;
+
+ public WizardStep5ViewModel()
+ {
+ Order = 5;
+ }
+
+ [Import]
+ private IWizardTranslations WizardTranslations { get; set; }
+
+ public override void Initialize()
+ {
+ // automatically update the DisplayName
+ _displayNameUpdater = this.BindDisplayName(WizardTranslations, nameof(IWizardTranslations.TitleStep5));
+ }
+
+ public override void Terminate()
+ {
+ _displayNameUpdater?.Dispose();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/Views/WizardExampleView.xaml b/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/Views/WizardExampleView.xaml
index bc19c4ff..0f76f532 100644
--- a/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/Views/WizardExampleView.xaml
+++ b/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/Views/WizardExampleView.xaml
@@ -2,6 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
+ xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
Icon="/Resources/icon.ico"
Width="400" Height="400">
@@ -22,11 +23,11 @@
diff --git a/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/Views/WizardStep3View.xaml b/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/Views/WizardStep3View.xaml
index 279d8826..ec46c1d3 100644
--- a/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/Views/WizardStep3View.xaml
+++ b/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/Views/WizardStep3View.xaml
@@ -5,6 +5,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300">
-
+
\ No newline at end of file
diff --git a/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/Views/WizardStep5View.xaml b/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/Views/WizardStep5View.xaml
new file mode 100644
index 00000000..1bbede14
--- /dev/null
+++ b/Dapplo.CaliburnMicro.Demo/UseCases/Wizard/Views/WizardStep5View.xaml
@@ -0,0 +1,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Dapplo.CaliburnMicro.Demo/packages.config b/Dapplo.CaliburnMicro.Demo/packages.config
index 712b9ab1..0425e6a9 100644
--- a/Dapplo.CaliburnMicro.Demo/packages.config
+++ b/Dapplo.CaliburnMicro.Demo/packages.config
@@ -10,5 +10,6 @@
-
+
+
\ No newline at end of file
diff --git a/Dapplo.CaliburnMicro.Metro/Dapplo.CaliburnMicro.Metro.csproj b/Dapplo.CaliburnMicro.Metro/Dapplo.CaliburnMicro.Metro.csproj
index f6a00661..5456da3d 100644
--- a/Dapplo.CaliburnMicro.Metro/Dapplo.CaliburnMicro.Metro.csproj
+++ b/Dapplo.CaliburnMicro.Metro/Dapplo.CaliburnMicro.Metro.csproj
@@ -51,8 +51,8 @@
..\packages\Dapplo.Addons.0.3.55\lib\net45\Dapplo.Addons.dllTrue
-
- ..\packages\MahApps.Metro.1.3.0-ALPHA179\lib\net45\MahApps.Metro.dll
+
+ ..\packages\MahApps.Metro.1.3.0-ALPHA182\lib\net45\MahApps.Metro.dllTrue
@@ -61,7 +61,7 @@
- ..\packages\MahApps.Metro.1.3.0-ALPHA179\lib\net45\System.Windows.Interactivity.dll
+ ..\packages\MahApps.Metro.1.3.0-ALPHA182\lib\net45\System.Windows.Interactivity.dllTrue
diff --git a/Dapplo.CaliburnMicro.Metro/packages.config b/Dapplo.CaliburnMicro.Metro/packages.config
index eac7ace8..e77bfecf 100644
--- a/Dapplo.CaliburnMicro.Metro/packages.config
+++ b/Dapplo.CaliburnMicro.Metro/packages.config
@@ -3,5 +3,5 @@
-
+
\ No newline at end of file
diff --git a/Dapplo.CaliburnMicro/Collections/TrulyObservableCollection.cs b/Dapplo.CaliburnMicro/Collections/TrulyObservableCollection.cs
new file mode 100644
index 00000000..4ba56bed
--- /dev/null
+++ b/Dapplo.CaliburnMicro/Collections/TrulyObservableCollection.cs
@@ -0,0 +1,88 @@
+#region Dapplo 2016 - GNU Lesser General Public License
+
+// Dapplo - building blocks for .NET applications
+// Copyright (C) 2016 Dapplo
+//
+// For more information see: http://dapplo.net/
+// Dapplo repositories are hosted on GitHub: https://github.com/dapplo
+//
+// This file is part of Dapplo.CaliburnMicro
+//
+// Dapplo.CaliburnMicro is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Dapplo.CaliburnMicro is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Lesser General Public License for more details.
+//
+// You should have a copy of the GNU Lesser General Public License
+// along with Dapplo.CaliburnMicro. If not, see .
+
+#endregion
+
+#region Usings
+
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+using System.ComponentModel;
+
+#endregion
+
+namespace Dapplo.CaliburnMicro.Collections
+{
+ ///
+ /// A which comes from here
+ ///
+ /// Type for the collection items
+ public sealed class TrulyObservableCollection : ObservableCollection
+ where T : INotifyPropertyChanged
+ {
+ ///
+ /// Constructor
+ ///
+ public TrulyObservableCollection()
+ {
+ CollectionChanged += FullObservableCollectionCollectionChanged;
+ }
+
+ ///
+ /// Constructor which a IEnumerable
+ ///
+ ///
+ public TrulyObservableCollection(IEnumerable pItems) : this()
+ {
+ foreach (var item in pItems)
+ {
+ Add(item);
+ }
+ }
+
+ private void FullObservableCollectionCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
+ {
+ if (e.NewItems != null)
+ {
+ foreach (var item in e.NewItems)
+ {
+ ((INotifyPropertyChanged) item).PropertyChanged += ItemPropertyChanged;
+ }
+ }
+ if (e.OldItems != null)
+ {
+ foreach (var item in e.OldItems)
+ {
+ ((INotifyPropertyChanged) item).PropertyChanged -= ItemPropertyChanged;
+ }
+ }
+ }
+
+ private void ItemPropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ var args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, sender, sender, IndexOf((T) sender));
+ OnCollectionChanged(args);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Dapplo.CaliburnMicro/Dapplo.CaliburnMicro.csproj b/Dapplo.CaliburnMicro/Dapplo.CaliburnMicro.csproj
index 2187ae63..15d1d154 100644
--- a/Dapplo.CaliburnMicro/Dapplo.CaliburnMicro.csproj
+++ b/Dapplo.CaliburnMicro/Dapplo.CaliburnMicro.csproj
@@ -87,6 +87,7 @@
+
diff --git a/Dapplo.CaliburnMicro/Wizard/ViewModels/WizardProgressViewModel.cs b/Dapplo.CaliburnMicro/Wizard/ViewModels/WizardProgressViewModel.cs
index 955625ab..24c4449d 100644
--- a/Dapplo.CaliburnMicro/Wizard/ViewModels/WizardProgressViewModel.cs
+++ b/Dapplo.CaliburnMicro/Wizard/ViewModels/WizardProgressViewModel.cs
@@ -23,9 +23,12 @@
#endregion
+using System;
using System.Windows.Media;
using Caliburn.Micro;
using System.Windows;
+using System.ComponentModel;
+using System.Windows.Data;
namespace Dapplo.CaliburnMicro.Wizard.ViewModels
{
@@ -73,6 +76,11 @@ public Brush DisabledColorBrush
}
}
+ ///
+ /// A sorted view on the WizardScreens
+ ///
+ public ICollectionView WizardScreensView { get; set; }
+
///
/// The IWizard
///
@@ -85,6 +93,10 @@ public Brush DisabledColorBrush
public WizardProgressViewModel(IWizard wizard)
{
Wizard = wizard;
+ if (Wizard.WizardScreens == null)
+ {
+ throw new ArgumentNullException(nameof(wizard.WizardScreens));
+ }
// Retrieve the values from MapApps, if they can be found
if (Application.Current.Resources.Contains(MapAppsHighlightBrush))
{
@@ -94,6 +106,17 @@ public WizardProgressViewModel(IWizard wizard)
{
_disabledColorBrush = Application.Current.Resources[MapAppsAccentColorBrush4] as SolidColorBrush;
}
+
+ // Make sure the view is created via the dispatcher
+ Application.Current.Dispatcher.Invoke(() =>
+ {
+ WizardScreensView = CollectionViewSource.GetDefaultView(wizard.WizardScreens);
+ WizardScreensView.Filter = o =>
+ {
+ IWizardScreen wizardScreen = o as IWizardScreen;
+ return wizardScreen?.IsVisible == true;
+ };
+ });
}
}
}
\ No newline at end of file
diff --git a/Dapplo.CaliburnMicro/Wizard/Views/WizardProgressView.xaml b/Dapplo.CaliburnMicro/Wizard/Views/WizardProgressView.xaml
index f0169ae6..88f93cf1 100644
--- a/Dapplo.CaliburnMicro/Wizard/Views/WizardProgressView.xaml
+++ b/Dapplo.CaliburnMicro/Wizard/Views/WizardProgressView.xaml
@@ -15,7 +15,7 @@
-
+