Custom XAML property

Posted by Scott Silvi on Stack Overflow See other posts from Stack Overflow or by Scott Silvi
Published on 2011-02-11T23:24:09Z Indexed on 2011/02/11 23:25 UTC
Read the original article Hit count: 212

Hey all -

I've seen a library that allows me to do this inside my XAML, which sets the visibility of the control based on whether or not the user is in a role: s:Authorization.RequiresRole="Admin"

Using that library with my database requires a bunch of coding that I can't really do right now. Ultimately here's what I want to know...

I have received the authenticated users role from my SPROC, and its currently stored in my App.xaml.cs as a property (not necessary for the final solution, just FYI for now). I want to create a property (dependency property? attached property?) that allows me to say something very similar to what the other library has: RequiresRole="Admin", which would collapse the visibility if the user is not in the Admin role. Can anyone point me in the right direction on this?

Thanks,

Scott

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about dependency-properties