Hi,
I had a separate radpane xaml class, it would dynamically generated radpane if it needs.
My problem is when I bound HeaderName to Header without HeaderTemplate code(where I commented), it is working fine to show headername only. But if I uncommented HeaderTemplate code, I only got image show in the UI, no text.
Below is my code:
<
telerik:RadPane
x:Class
=
"TemplatorWPF.LoadSource"
x:Name
=
"RadPaneSource"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:local
=
"clr-namespace:_ViewModel;assembly=_ViewModel"
mc:Ignorable
=
"d"
Header
=
"{Binding HeaderName}"
d:DesignHeight
=
"300"
d:DesignWidth
=
"300"
>
<!--<
telerik:RadPane.HeaderTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
Image
Source
=
"../Resources/templator - level 1.png"
/>
<
TextBlock
Text
=
"{Binding HeaderName}"
/>
</
StackPanel
>
</
DataTemplate
>
</
telerik:RadPane.HeaderTemplate
>-->
<
telerik:RadPane.Resources
>
6 Answers, 1 is accepted

I found a way to fix it.
Change
<
TextBlock
Text
=
"{Binding HeaderName}"
/>
<
TextBlock
Text
=
"{Binding }"
/>.
Also it seems no matter when you use Title or Header, eg: Header=
"{Binding HeaderName}" or Title=
"{Binding HeaderName}", both work fine, but each time when I change it to other, it will generate a exception at first time.
I still need help, I also need bind image as well, it doesn't work.
<
telerik:RadPane
x:Class
=
"TemplatorWPF.LoadSource"
x:Name
=
"RadPaneSource"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:local
=
"clr-namespace:_ViewModel;assembly=_ViewModel"
mc:Ignorable
=
"d"
Header
=
"{Binding HeaderName}"
d:DesignHeight
=
"300"
d:DesignWidth
=
"300"
>
<
telerik:RadPane.HeaderTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
Image
Source
=
"{Binding HeaderImage}"
/>
<
TextBlock
Text
=
"{Binding }"
/>
</
StackPanel
>
</
DataTemplate
>
</
telerik:RadPane.HeaderTemplate
>
<
telerik:RadPane.Resources
>
What I would suggest you is to bind the Header to be the whole View-model and to turn back the the binding to be to the HeaderName property. The problem is that the HeaderTemplate has for its DataContext the value of the Header property so you will not be able to bind both the image and the text if you provide just one of the values.
Hope this helps.
Miroslav Nedyalkov
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Thanks for helping me.
I tried this then it work.
Header
=
"{Binding HeaderName}"
to Header=
"{Binding}"
and in headerTemplate
<
telerik:RadPane.HeaderTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
Image
Source
=
"{Binding HeaderImage}"
/>
<
TextBlock
Text
=
"{Binding HeaderName}"
/>
</
StackPanel
>
</
DataTemplate
>
Cheers,
Fendy

I'm a bit new to docking. The basic concept I am fine with. The nuts and bolts I am a bit clumsy with yet.
I am "opening" a file for which I have a file view model established. I override ToString or the Header binding.
I create my new RadFilePane and set its DataContext. Then add it to a DocumentHost through AddPane.
Seemingly, so far so good, something is at least docking, or seems to. However, I get no Header showing, no images either, in spite of the binding to (I presume?) the view model Image property (an ImageSource).
When I figure it out, I'll know it that much better.
Thanks.
Best regards.

I can see we have opened another forum thread and I have already answered you there. Could please check my answer and I'll also ask you continue the conversation there.
Regards,
Kalin
Telerik
Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.