diff --git a/Creator/Helper/SimpleCommandLineParser.cs b/Creator/Helper/SimpleCommandLineParser.cs
index 655f111..bc9b96c 100644
--- a/Creator/Helper/SimpleCommandLineParser.cs
+++ b/Creator/Helper/SimpleCommandLineParser.cs
@@ -98,7 +98,8 @@ namespace KattekerCreator.Helper
if (textWriter == null) textWriter = Console.Out;
LoopProperties(pi =>
{
- var displayName = GetDisplayName(pi) ?? pi.Name;
+ var displayName = GetDisplayName(pi);
+ if (displayName == null) return;
var value = pi.GetValue(_parsedObject);
textWriter.Write(displayName.PadRight(20, ' '));
if (value == null)
diff --git a/Creator/PathFragments.cs b/Creator/PathFragments.cs
index 9635620..d74a432 100644
--- a/Creator/PathFragments.cs
+++ b/Creator/PathFragments.cs
@@ -3,7 +3,7 @@ using System.Linq;
namespace KattekerCreator
{
- public class PathFragments
+ public struct PathFragments
{
private readonly string[] _fragments;
@@ -19,7 +19,5 @@ namespace KattekerCreator
public override int GetHashCode() => (_fragments != null ? _fragments.GetHashCode() : 0);
public override string ToString() => string.Join(Path.DirectorySeparatorChar.ToString(), _fragments.Take(_fragments.Length - 1));
-
- protected bool Equals(PathFragments other) => Equals(_fragments, other._fragments);
}
}
\ No newline at end of file
diff --git a/Example/Bootstrapper.cs b/Example/Bootstrapper.cs
index eab5baa..e426ae1 100644
--- a/Example/Bootstrapper.cs
+++ b/Example/Bootstrapper.cs
@@ -10,7 +10,7 @@ namespace Example
protected override void InitializeShell()
{
- (Shell as Window)?.Show();
+ Application.Current.MainWindow?.Show();
}
}
}
\ No newline at end of file
diff --git a/Example/Example.csproj b/Example/Example.csproj
index 53a0543..27f7402 100644
--- a/Example/Example.csproj
+++ b/Example/Example.csproj
@@ -57,16 +57,11 @@
..\packages\Prism.Wpf.6.3.0\lib\net45\Prism.Wpf.dll
-
..\packages\Prism.Wpf.6.3.0\lib\net45\System.Windows.Interactivity.dll
-
-
-
-
4.0
@@ -94,6 +89,7 @@
+
Code
@@ -128,10 +124,6 @@
{07e2de31-80a0-43da-b307-1ca47cd930a1}
Katteker.UserInterface
-
- {a45e1c59-ba9e-452c-a5e2-50de49d53e92}
- Katteker
-
diff --git a/Example/MainWindow.xaml b/Example/MainWindow.xaml
index de75894..288ce56 100644
--- a/Example/MainWindow.xaml
+++ b/Example/MainWindow.xaml
@@ -3,22 +3,41 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
+ xmlns:local="clr-namespace:Example"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:prism="http://prismlibrary.com/"
Title="MainWindow"
Width="800"
Height="450"
+ d:DataContext="{d:DesignInstance local:MainWindowViewModel}"
+ prism:ViewModelLocator.AutoWireViewModel="True"
Background="#E20074"
- ContentRendered="MainWindow_OnContentRendered"
mc:Ignorable="d">
+
+
+
+
+
-
-
+
+
-
-
-
-
+
+
+
+
diff --git a/Example/MainWindow.xaml.cs b/Example/MainWindow.xaml.cs
index e0fe5c8..67b0abe 100644
--- a/Example/MainWindow.xaml.cs
+++ b/Example/MainWindow.xaml.cs
@@ -18,15 +18,5 @@ namespace Example
a.ManifestModule.GetPEKind(out var peKind, out var machine);
Title = $"{version} | {peKind} | {machine}";
}
-
- private async void MainWindow_OnContentRendered(object sender, EventArgs e)
- {
- await Katteker.UserInterface.CheckForUpdateAsync(true).ConfigureAwait(false);
- }
-
- private async void ButtonBase_OnClick(object sender, RoutedEventArgs e)
- {
- await Katteker.UserInterface.CheckForUpdateAsync().ConfigureAwait(false);
- }
}
}
diff --git a/Example/MainWindowViewModel.cs b/Example/MainWindowViewModel.cs
new file mode 100644
index 0000000..6e0e01a
--- /dev/null
+++ b/Example/MainWindowViewModel.cs
@@ -0,0 +1,22 @@
+using System.Threading.Tasks;
+using System.Windows.Input;
+using Prism.Commands;
+using Prism.Mvvm;
+
+namespace Example
+{
+ public class MainWindowViewModel : BindableBase
+ {
+ public MainWindowViewModel()
+ {
+ UpdateCommand = new DelegateCommand(async x => await UpdateAsync(x).ConfigureAwait(false));
+ }
+
+ private Task UpdateAsync(string startup) =>
+ bool.TryParse(startup, out var isStartup)
+ ? Katteker.UserInterface.CheckForUpdateAsync(isStartup)
+ : Task.FromResult(true);
+
+ public ICommand UpdateCommand { get; }
+ }
+}
\ No newline at end of file
diff --git a/Example/Properties/AssemblyInfo.cs b/Example/Properties/AssemblyInfo.cs
index c4776c1..bb4111b 100644
--- a/Example/Properties/AssemblyInfo.cs
+++ b/Example/Properties/AssemblyInfo.cs
@@ -49,5 +49,5 @@ using System.Windows;
// 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.1.2")]
-[assembly: AssemblyFileVersion("1.1.2")]
+[assembly: AssemblyVersion("1.1.5")]
+[assembly: AssemblyFileVersion("1.1.5")]
diff --git a/Katteker/Katteker.csproj b/Katteker/Katteker.csproj
index 4aa8f77..a199d6f 100644
--- a/Katteker/Katteker.csproj
+++ b/Katteker/Katteker.csproj
@@ -34,7 +34,6 @@
-