I have a ViewModel which contains a Boolean property which tells you if the user has authenticated or not.
I have a WrapPanel which is bound to a collection of profiles. The DataTemplate for these profiles has an icon - a closed padlock for when the user is not authenticated and an open one for when the user is authenticated. Ideally these would be bound to the Boolean on the ViewModel but the DataContext for the templates is the individual profile objects.
I have tried,
- Setting the
Source
selector in the binding as specified here although it appear Windows Phone 7 does not supportx:Reference
- I tried also the Inversion of Control(?) method detailed here (but
containerLocator
was not found on my object) - I tried applying a
Style.Trigger
but these are not supported in Windows Phone 7 - I also tried accessing the XAML elements in the code behind and updating programmatically on event triggers, however I could not get a handle on the
Image
element inside the DataTemplate