private void UpdateVisibility()
 {
     if (LoggedInUserType.HasFlag(RequiredUserType))
     {
         AssociatedObject.Visibility = Visibility.Visible;
         AssociatedObject.IsEnabled  = true;
     }
     else
     {
         AssociatedObject.Visibility = Visibility.Collapsed;
         AssociatedObject.IsEnabled  = false;
     }
 }
Example #2
0
 public static AuthorizationPolicyBuilder RequireUserType(this AuthorizationPolicyBuilder builder,
                                                          LoggedInUserType type)
 {
     builder.AddRequirements(new StudentRequirement(type));
     return(builder);
 }
Example #3
0
 public StudentRequirement(LoggedInUserType loggedInAs)
 {
     LoggedInAs = loggedInAs;
 }