I am working with a TabControl in XAML,
however I only want certain TabItems to be available depending on the user.
Admins = 1 therefore should have full access to the TabControl,
Non admins = 0 therefore should only have specific tabs available.
How can I hide specific tabs depending on the user?
Thanks.
There are many ways of doing this, and I suppose which one you use depends on where the
IsAdminflag is storedMy personal preference is a
DataTriggerwhich is based off a staticUserobject which is set when the user first logs inSettingswould be a static class that contains aCurrentUserproperty that is set when the application starts up and the user logs in.CurrentUserhas a boolean property calledIsAdmin