It appears as though trying to access the SelectedItem of a ColorPickerGallery, when it is inside a PopupButton, does not work.
Please see my code below, but I am simply trying to use the ColorPickerGallery inside of the PopupContent of a PopupButton. Currently, I have the SelectedItem bound to the Background of a Button inside of the PopupContent (code I got off of the forum here).
However, I have also tried this using a Command, and also by creating a "SelectedItem" property that inherits from INotify.
None of these seem to trigger the newly SelectedItem.
Any suggestions?
Thanks,
James
Code:
Please see my code below, but I am simply trying to use the ColorPickerGallery inside of the PopupContent of a PopupButton. Currently, I have the SelectedItem bound to the Background of a Button inside of the PopupContent (code I got off of the forum here).
However, I have also tried this using a Command, and also by creating a "SelectedItem" property that inherits from INotify.
None of these seem to trigger the newly SelectedItem.
Any suggestions?
Thanks,
James
Code:
<shared:PopupButton x:Name="_myPopupButton"
Content="Test Me"
Width="75"
DisplayMode="Merged">
<shared:PopupButton.PopupContent>
<Border Width="176"
Background="White"
BorderBrush="Gray"
BorderThickness="1">
<StackPanel>
<ribbon:ColorPickerGallery InitialColumnCount="10"
HorizontalAlignment="Center"
SelectedItem="{Binding ElementName=TargetButton, Path=Background, Mode=TwoWay}">
<ribbon:ColorPickerGallery.CategorizedItemsSource>
<x:Array Type="{x:Type media:SolidColorBrush}">
<media:SolidColorBrush ribbon:PopupGallery.Category="Theme Colors" ribbon:ColorPickerGallery.LayoutBehavior="Shaded" Color="#FFFFFF" ribbon:ScreenTipService.ScreenTipHeader="White" />
<media:SolidColorBrush ribbon:PopupGallery.Category="Theme Colors" ribbon:ColorPickerGallery.LayoutBehavior="Shaded" Color="#000000" ribbon:ScreenTipService.ScreenTipHeader="Black" />
<media:SolidColorBrush ribbon:PopupGallery.Category="Theme Colors" ribbon:ColorPickerGallery.LayoutBehavior="Shaded" Color="#EEECE1" ribbon:ScreenTipService.ScreenTipHeader="Tan" />
<media:SolidColorBrush ribbon:PopupGallery.Category="Theme Colors" ribbon:ColorPickerGallery.LayoutBehavior="Shaded" Color="#1F497D" ribbon:ScreenTipService.ScreenTipHeader="Dark Blue" />
<media:SolidColorBrush ribbon:PopupGallery.Category="Theme Colors" ribbon:ColorPickerGallery.LayoutBehavior="Shaded" Color="#4F81BD" ribbon:ScreenTipService.ScreenTipHeader="Blue" />
<media:SolidColorBrush ribbon:PopupGallery.Category="Theme Colors" ribbon:ColorPickerGallery.LayoutBehavior="Shaded" Color="#C0504D" ribbon:ScreenTipService.ScreenTipHeader="Red" />
<media:SolidColorBrush ribbon:PopupGallery.Category="Theme Colors" ribbon:ColorPickerGallery.LayoutBehavior="Shaded" Color="#9BBB59" ribbon:ScreenTipService.ScreenTipHeader="Olive Green" />
<media:SolidColorBrush ribbon:PopupGallery.Category="Theme Colors" ribbon:ColorPickerGallery.LayoutBehavior="Shaded" Color="#8064A2" ribbon:ScreenTipService.ScreenTipHeader="Purple" />
<media:SolidColorBrush ribbon:PopupGallery.Category="Theme Colors" ribbon:ColorPickerGallery.LayoutBehavior="Shaded" Color="#4BACC6" ribbon:ScreenTipService.ScreenTipHeader="Aqua" />
<media:SolidColorBrush ribbon:PopupGallery.Category="Theme Colors" ribbon:ColorPickerGallery.LayoutBehavior="Shaded" Color="#F79646" ribbon:ScreenTipService.ScreenTipHeader="Orange" />
</x:Array>
</ribbon:ColorPickerGallery.CategorizedItemsSource>
</ribbon:ColorPickerGallery>
<Button x:Name="TargetButton" Background="Red">Target Button</Button>
</StackPanel>
</Border>
</shared:PopupButton.PopupContent>
</shared:PopupButton>