Hi,
I used the lastly uploaded sample "113371_160022-all-templates-for-customizing-20090115-1617.zip" and modified it for binding and some how it is not working.
In RadWindow.xaml file following lines are added.
1. At the top following code added for defining template
</ContentControl.Resources>
<DataTemplate x:Key="LayerPanelBarItemTemplate">
<StackPanel Orientation="Horizontal" Margin="5,0,0,0" >
<Image Source="{Binding Description}" Width="20" VerticalAlignment="Center"/>
<TextBlock Text=" " />
<TextBlock Text="{Binding Name}" Width="Auto" />
</StackPanel>
</DataTemplate>
</ContentControl.Resources>
2. At the end of file following code added.
<telerikNavigation:RadPanelBar x:Name="Panel" ItemsSource="{Binding Layers}" ItemTemplate="{StaticResource LayerPanelBarItemTemplate}">
</telerikNavigation:RadPanelBar>
In RadWindow.xaml.cs file following code are added in load function and two classes added.
void RadWindowBlend_Loaded(object sender, RoutedEventArgs e)
{
this.Panel.DataContext = new Test();
}
public class Test
{
public Layer[] Layers
{
get
{
return new Layer[]
{
new Layer("ExportModel"),new Layer("ImportModel"),new Layer("ModifyUser"),new Layer("Validation")
};
}
}
}
public class Layer
{
public Layer(string _name)
{
Name = _name;
Description =
"";
}
public string Name { get; set; }
public string Description{ get; set; }
}
With this code, the output displayed on the screen is "TelerikThemingApplication.Layer" 4 times.
How i get the actual layer names ? In one of my application I want to display name and image by using HeaderTemplate/ItemTemplate.
but somehow HeaderTemplate/ItemTemplate cannot be binded.
-Rajesh