Posted 17 years ago
		by Owen Christensen
			
				-
Software Engineer,
				Minitab Inc.
			
	

<ribbon:RibbonGallery Label="Gallery">
  <ribbon:RibbonGallery.ItemsSource>
    <x:Array Type="{x:Type mediaImaging:BitmapImage}">
      <mediaImaging:BitmapImage UriSource="Start.png" ribbon:RibbonControlService.CommandParameter="Start"/>
    </x:Array>
  </ribbon:RibbonGallery.ItemsSource>
  <ribbon:RibbonGallery.ItemTemplate>
    <DataTemplate>
      <Image Source="{Binding BindsDirectlyToSource=True}" Margin="2" Stretch="None" ribbon:RibbonControlService.CommandParameter="{Binding Path=(ribbon:RibbonControlService.CommandParameter), Mode=OneTime}"/>
    </DataTemplate>
  </ribbon:RibbonGallery.ItemTemplate>
  <ribbon:RibbonGallery.ItemContainerStyle>
    <Style TargetType="{x:Type ribbon:GalleryItem}">
      <Setter Property="Command" Value="{StaticResource MyCommand}"/>
      <Setter Property="CommandParameter">
        <Setter.Value>
          <ribbon:CheckableCommandParameter Tag="{Binding Path=(ribbon:RibbonControlService.CommandParameter), Mode=OneTime}"/>
        </Setter.Value>
      </Setter>
    </Style>
  </ribbon:RibbonGallery.ItemContainerStyle>
</ribbon:RibbonGallery>
System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=(0); DataItem=null; target element is 'CheckableCommandParameter' (HashCode=26426675); target property is 'Tag' (type 'Object')
Am I doing something dumb here?

