diff --git a/Drachenhorn.Core/Lang/LanguageManager.cs b/Drachenhorn.Core/Lang/LanguageManager.cs
index 9277f86..174ac5e 100644
--- a/Drachenhorn.Core/Lang/LanguageManager.cs
+++ b/Drachenhorn.Core/Lang/LanguageManager.cs
@@ -5,6 +5,7 @@
using System.Resources;
using Drachenhorn.Xml;
using Easy.Logger.Interfaces;
+using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Ioc;
namespace Drachenhorn.Core.Lang
@@ -13,7 +14,7 @@ public class LanguageManager : BindableBase, INotifyLanguageChanged
{
#region Properties
- private readonly ResourceManager _resourceManager =
+ private readonly ResourceManager _resourceManager =
new ResourceManager("Drachenhorn.Core.Lang.lang", typeof(LanguageManager).Assembly);
private CultureInfo _currentCulture = CultureInfo.CurrentUICulture;
@@ -47,6 +48,9 @@ public CultureInfo CurrentCulture
/// Translated Text.
public string GetLanguageText(string identifier)
{
+ if (ViewModelBase.IsInDesignModeStatic)
+ return identifier;
+
try
{
return _resourceManager.GetString(identifier, CurrentCulture)?.Replace("\\n", "\n");
diff --git a/Drachenhorn.Core/Settings/ISettings.cs b/Drachenhorn.Core/Settings/ISettings.cs
index 6830c2b..61b9cc5 100644
--- a/Drachenhorn.Core/Settings/ISettings.cs
+++ b/Drachenhorn.Core/Settings/ISettings.cs
@@ -12,8 +12,7 @@ public interface ISettings : INotifyPropertyChanged
CultureInfo CurrentCulture { get; set; }
string Version { get; }
- string GitCommit { get; }
- string GitCommitLink { get; }
+ string NewVersion { get; }
VisualThemeType VisualTheme { get; set; }
string AccentColor { get; set; }
diff --git a/Drachenhorn.Desktop/Converter/NullVisibilityConverter.cs b/Drachenhorn.Desktop/Converter/NullVisibilityConverter.cs
index ce8e8ff..189dad1 100644
--- a/Drachenhorn.Desktop/Converter/NullVisibilityConverter.cs
+++ b/Drachenhorn.Desktop/Converter/NullVisibilityConverter.cs
@@ -14,10 +14,19 @@ public class NullVisibilityConverter : IValueConverter
///
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
- if (value == null)
- return Visibility.Collapsed;
- else
- return Visibility.Visible;
+ var onNull = Visibility.Collapsed;
+ var notNull = Visibility.Visible;
+
+ if (parameter != null && parameter.ToString() == "Invert")
+ {
+ onNull = Visibility.Visible;
+ notNull = Visibility.Collapsed;
+ }
+
+ if (value == null || string.IsNullOrEmpty(value.ToString()))
+ return onNull;
+
+ return notNull;
}
///
diff --git a/Drachenhorn.Desktop/Drachenhorn.Desktop.csproj b/Drachenhorn.Desktop/Drachenhorn.Desktop.csproj
index d7f353c..9ad2f37 100644
--- a/Drachenhorn.Desktop/Drachenhorn.Desktop.csproj
+++ b/Drachenhorn.Desktop/Drachenhorn.Desktop.csproj
@@ -469,9 +469,6 @@
Images\White\Common\Yes.png
-
- Always
-
Always
diff --git a/Drachenhorn.Desktop/UI/Lang/TranslateExtension.cs b/Drachenhorn.Desktop/UI/Lang/TranslateExtension.cs
index 3adbe64..3388897 100644
--- a/Drachenhorn.Desktop/UI/Lang/TranslateExtension.cs
+++ b/Drachenhorn.Desktop/UI/Lang/TranslateExtension.cs
@@ -20,7 +20,7 @@ public TranslateExtension(string name) : base("[%" + name + "]")
try
{
if (ViewModelBase.IsInDesignModeStatic)
- Source = new LanguageManager {CurrentCulture = CultureInfo.CurrentCulture};
+ Source = new LanguageManager();
else
Source = SimpleIoc.Default.GetInstance();
}
diff --git a/Drachenhorn.Desktop/UserControls/Common/SettingsViewControl.xaml b/Drachenhorn.Desktop/UserControls/Common/SettingsViewControl.xaml
index 22de217..9ca3400 100644
--- a/Drachenhorn.Desktop/UserControls/Common/SettingsViewControl.xaml
+++ b/Drachenhorn.Desktop/UserControls/Common/SettingsViewControl.xaml
@@ -92,51 +92,45 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
+
+
+
-
-
-
-
-
-
-
-
+
-
+
diff --git a/Drachenhorn.Desktop/UserControls/Common/SettingsViewControl.xaml.cs b/Drachenhorn.Desktop/UserControls/Common/SettingsViewControl.xaml.cs
index 738b56b..56f953f 100644
--- a/Drachenhorn.Desktop/UserControls/Common/SettingsViewControl.xaml.cs
+++ b/Drachenhorn.Desktop/UserControls/Common/SettingsViewControl.xaml.cs
@@ -54,7 +54,7 @@ private void LanguageComboBox_SelectionChanged(object sender, SelectionChangedEv
}
}
- private void UpdateButton_OnClick(object sender, RoutedEventArgs e)
+ private void CheckUpdateButton_OnClick(object sender, RoutedEventArgs e)
{
UpdateRing.IsActive = true;
diff --git a/Drachenhorn.Desktop/UserSettings/Settings.cs b/Drachenhorn.Desktop/UserSettings/Settings.cs
index 9c7fc71..b5110dc 100644
--- a/Drachenhorn.Desktop/UserSettings/Settings.cs
+++ b/Drachenhorn.Desktop/UserSettings/Settings.cs
@@ -23,13 +23,6 @@ public class Settings : BindableBase, ISettings
public Settings()
{
- var path = Path.Combine(Environment.CurrentDirectory, "commit");
- if (File.Exists(path))
- GitCommit = File.ReadAllText(Path.Combine(Environment.CurrentDirectory, "commit")).Replace("\r", "")
- .Replace("\n", "");
- else
- GitCommit = "No Commit found";
-
PropertyChanged += (sender, args) => { Save(); };
}
@@ -41,8 +34,6 @@ public Settings()
[XmlIgnore] private SheetTemplate _currentTemplate;
- [XmlIgnore] private string _gitCommit;
-
[XmlIgnore] private bool _isNew = true;
[XmlIgnore] private VisualThemeType _visualTheme;
@@ -117,28 +108,7 @@ public CultureInfo CurrentCulture
public string Version => SquirrelManager.CurrentVersion;
[XmlIgnore]
- public string GitCommit
- {
- get => _gitCommit;
- private set
- {
- if (_gitCommit == value)
- return;
- _gitCommit = value;
- OnPropertyChanged();
- }
- }
-
- [XmlIgnore]
- public string GitCommitLink
- {
- get
- {
- if (GitCommit.Contains(" "))
- return null;
- return @"https://github.com/lightlike/Drachenhorn/commit/" + GitCommit;
- }
- }
+ public string NewVersion => SquirrelManager.NewVersion;
[XmlElement("VisualTheme")]
public VisualThemeType VisualTheme
diff --git a/Drachenhorn.Desktop/UserSettings/SquirrelManager.cs b/Drachenhorn.Desktop/UserSettings/SquirrelManager.cs
index 8525765..cedb6d0 100644
--- a/Drachenhorn.Desktop/UserSettings/SquirrelManager.cs
+++ b/Drachenhorn.Desktop/UserSettings/SquirrelManager.cs
@@ -33,6 +33,8 @@ private set
_newVersion = value;
}
}
+
+
private static string _currentVersion;
public static string CurrentVersion
@@ -43,18 +45,18 @@ public static string CurrentVersion
{
try
{
- using (var mgr = new UpdateManager(null))
+ using (var mgr = new UpdateManager("C:"))
{
_currentVersion = mgr.CurrentlyInstalledVersion().ToString();
}
}
catch (Exception e)
{
+ _currentVersion = "X.X.X";
+
SimpleIoc.Default.GetInstance().GetLogger()
.Debug("Unable to load Squirrel Version.", e);
}
-
- _currentVersion = "Application not installed.";
}
return _currentVersion;
diff --git a/Drachenhorn.Desktop/commit b/Drachenhorn.Desktop/commit
deleted file mode 100644
index 21bf4de..0000000
--- a/Drachenhorn.Desktop/commit
+++ /dev/null
@@ -1 +0,0 @@
-Application not published
\ No newline at end of file