Hi,
I would like to enable/disable/hide certain functions based on log/in/out within an application. This is not working as expected. Can someone please direct me as to what I can do to get this to work correctly?
<someControl Text="New Action" Loaded="BtnSomeAction_Loaded" ToolTip="New Action" Visibility="{Binding Converter={StaticResource canDoSomethingBasedOnUserRights}, Mode=OneWay, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}"/>
Converter code:
public class CanDoSomethingBasedOnUserRights : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (someValidationConstraint)
? Visibility.Visible
: Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
You can switch the converter to enabling the control as well. Can someone please advise as to what I am doing wrong?
Thanks,
Me
What I have tried:
Based on the above, I am not sure what I have missed... :/.. Should I make that particular resource dynamic? (Obviously haven't tried that yet but not sure if that will help)