diff --git a/BeWo/BeWoApp.xaml.cs b/BeWo/BeWoApp.xaml.cs index 6f2893c94..d14a2239c 100644 --- a/BeWo/BeWoApp.xaml.cs +++ b/BeWo/BeWoApp.xaml.cs @@ -44,7 +44,6 @@ namespace BeWo { private static DebugMessageLogView _DebugMessageLogView; - private static FrameworkElement _lockedContent; public static LoginControl LoginControl; @@ -55,6 +54,8 @@ namespace BeWo public static int RenderTier = 0; + public static bool IsInDesignMode = DesignerProperties.GetIsInDesignMode(new DependencyObject()); + internal static string IpAddress = string.Empty; internal static string Tenant = string.Empty; diff --git a/BeWo/Converter/UserPermission2BoolConverter.cs b/BeWo/Converter/UserPermission2BoolConverter.cs index a4a18ae83..e61ade63d 100644 --- a/BeWo/Converter/UserPermission2BoolConverter.cs +++ b/BeWo/Converter/UserPermission2BoolConverter.cs @@ -14,20 +14,28 @@ namespace BeWo.Converter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - if (value is UserRightType type) + try { - return BeWoApp.HasLoggedOnUserRight(type); - } + if (value is UserRightType type) + { + return BeWoApp.HasLoggedOnUserRight(type); + } - if (parameter is UserRightType type2) - { - return BeWoApp.HasLoggedOnUserRight(type2); - } + if (parameter is UserRightType type2) + { + return BeWoApp.HasLoggedOnUserRight(type2); + } - if (parameter is string setting && !string.IsNullOrWhiteSpace(setting)) + if (parameter is string setting && !string.IsNullOrWhiteSpace(setting)) + { + if (setting == SettingsKeys.AllowGkvAbrechnung) + return BeWoApp.AppSettings.AllowGkvAbrechnung; + } + } + catch (Exception) { - if (setting == SettingsKeys.AllowGkvAbrechnung) - return BeWoApp.AppSettings.AllowGkvAbrechnung; + if (BeWoApp.IsInDesignMode) + return true; } return false;