Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
Custom caption not used in DataTemplate
posted

When using the XamColorPicker in a DataTemplate the custom captions appear to be ignored.

I have a simple project where the XamColorPicker is used in the DataTemplate of an ItemsControl:

<Window x:Class="WpfApplication8.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ig="http://schemas.infragistics.com/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <ItemsControl Margin="0,3,5,3"
                      ItemsSource="{Binding}">
            <ItemsControl.ItemTemplate>
                <DataTemplate DataType="string">
                    <StackPanel Orientation="Horizontal">
                        <ig:XamColorPicker  
                          Width="80"
                           AdvancedButtonCaption="Custom"  
                           CurrentColorCaption="Custom:"
                           CurrentPaletteCaption="Custom:" 
                           DerivedColorPalettesCaption="Custom:" 
                           RecentColorPaletteCaption="Custom:" />
                    </StackPanel>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </Grid>
</Window>

And the following code behind:



public partial class MainWindow : Window
{
	public MainWindow()
	{
		InitializeComponent();
 
		DataContext = new List<string> {"test"};
	}
}

The custom labels are ignored. If you place the XamColorPicker outside of the ItemsControl the properties are applied as you would expect.