Binding zu UserPermission führt im Designer nicht mehr zu Exception (Standardhaft zu true - hat Rechte)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user