Hi,
I'm trying to programmatically set the selected item in a gallery tool. It works when I look at the properties in the debugger. This doesn't seem to do much else, however: The ItemSelected event is not triggered, and when I click on the button to see the gallery items, the one I set as selected is not highlighted.
Is there some kind of magic involved in doing this, or is it a bug? My gallery in XAML is patterned after the one from the XamFeatureBrowser - nothing particularly fancy (I want to use it as a theme selector.)
Thanks,Michel
You probably need to set the ItemBehavior to StateButton. Otherwise it will just act like a button which will invoke the ItemClicked event and not show any selection state.
Andrew Smith"] You probably need to set the ItemBehavior to StateButton. Otherwise it will just act like a button which will invoke the ItemClicked event and not show any selection state.
Hi Andrew,
It was already set to StateButton. I also tried Button, just in case. No event gets triggered when assigning SelectedItem programmatically, in both cases. I tried these events: ItemSelected, ItemActivated, ItemClicked. Works fine when selecting a gallery item using the mouse, but that's not good enough here (on startup, I read the last theme used from the config file and need to set it programmatically.)
Any idea?