Binding zu UserPermission führt im Designer nicht mehr zu Exception (Standardhaft zu true - hat Rechte)

This commit is contained in:
2024-11-15 13:04:15 +01:00
parent c37ef9f3ce
commit e9b00a4a1d
2 changed files with 20 additions and 11 deletions

View File

@@ -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;

View File

@@ -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;