0

In the following file, there is example for COmboBox - control template. http://msdn.microsoft.com/en-us/library/ms752094(v=vs.85).aspx

I tried to add a content template for content presenter using following XAML. But it displays value "1" as "[1,1]".

How do I bind the selectedValue to the tyext of textblock ?

<ContentPresenter x:Name="ContentSite" Visibility="Visible" IsHitTestVisible="False" Content="{TemplateBinding SelectionBoxItem}"
                                ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                                VerticalAlignment="Center" HorizontalAlignment="Stretch">
                                <ContentPresenter.ContentTemplate>
                                    <DataTemplate>
                                        <TextBlock Background="#FFFF99" Text="{Binding }" />
                                    </DataTemplate>
                                </ContentPresenter.ContentTemplate>
                            </ContentPresenter>
Relativity
  • 6,690
  • 22
  • 78
  • 128

1 Answers1

0

I have made a fix for this. Have a GRID around the content presenter...and set the background color of that GRID in control template's trigger.

Relativity
  • 6,690
  • 22
  • 78
  • 128