GalleryItem::IsSelected is not working at the first time

Dec 6, 2010 at 10:37 PM

I tried to select a galleryItem within a dropdown button, but the gallery item is not selected when the first time the dropdown is opened. It works at the second time and after.

This is broken after the source code label 55631.

To reproduce: Use the xaml and code behind below:

private void dropdownButton_DropDownOpened(object sender, System.EventArgs e)

 {

         Gallery gallery = dropdownButton.Items[0] as Gallery;

         GalleryItem gi = gallery.Items[0] as GalleryItem;

         gi.IsSelected = true;

       }

 

<Fluent:DropDownButton Name="dropdownButton" Header="SplitButton" DropDownOpened="dropdownButton_DropDownOpened">

                       <Fluent:Gallery>

                           <Fluent:GalleryItem>

                               <Image Source="Images\RedLarge.png" Stretch="None" AutomationProperties.Name="Red"/>

                           </Fluent:GalleryItem>

                           <Image Source="Images\RedLarge.png" Stretch="None"/>

                       </Fluent:Gallery>

                   </Fluent:DropDownButton>

 

Thanks,

Xiaoling