Hi,
I'm trying to use the HeaderTemplate to customize the header of the ContentPane, but I get a binding error saying that the "XXX property not found on ABC.MyViewModel"...(the usual binding error message listed in the Output window). So I know that the binding is set up correctly.
So I know for sure that my ViewModel has the property I'm trying to bind to, and binding to the ViewModel works perfectly fine except when doing it from the HeaderTemplate of the ContentPane, so I need some help figuring out what's wrong here...? Anyone had similar issues?Here's my ContentPane style;
<Style TargetType="ig:ContentPane" BasedOn=""> <Setter Property="HeaderTemplate"> <Setter.Value> <DataTemplate> <StackPanel> <TextBlock Text="{Binding Path=Title}"/> </StackPanel> </DataTemplate> </Setter.Value> </Setter> </Style>
-Thanks!
It actually can't be an object. The reason is, that the Header isn't just used for the ContentPane. It's used everywhere. For example, if you put it in a TabGroupPane, the tabHeader will use that header. Or if you open up the shortcuts dialog by hitting "ctrl" + "+" the value being displayed for that pane is the ContentPane.
When its an object and not a string, it can only be displayed once in the VisualTree, otherwise you'll get an exception.
-SteveZ
Ok, so I missed the fact that the Header property of the ContentPane is actually a string and not an object (which I expected it to be), so it explains why the binding will fail.
It would be nice if the ContentPane.Header could be an object and not a string.