Quantcast
Channel: Silverlight 5 forum
Viewing all articles
Browse latest Browse all 1083

TabItem.Content set only with xaml?

$
0
0

This way mot work. Cannot set content like this example code.

<DataTemplate x:Key="DataTemplateNS"><TextBlock Text="W" VerticalAlignment="Center" HorizontalAlignment="Center" /></DataTemplate>

<ControlTemplate x:Key="ControlTemplate_MyBlueTabItemContent">
   <TextBlock Text="B" VerticalAlignment="Center" HorizontalAlignment="Center" />
</DataTemplate>

<TabItem Content="{StaticResource ControlTemplate_MyBlueTabItemContent}" />


This work, but I want to use simple Xam, like top code example. How to do it without use runtime code, only simple xaml?

var tabSM = rtcC.Items[0] as RadTabItem;
var dtSM = (this.Resources["dtSM"] as DataTemplate);
tabSM.Content = dtSM.LoadContent();

Standard tabitem content where put usercontrol into the item tab tag is not good, becouse I will use converter to change tabitem content dynamicly. Here is example of full xaml code + converter.According diferent type I will change my converter. DataTemplate not work too. Mising important dynamic content for example itemscontrol item is hide.

<TabItem  Content="{Binding ElementName=rbPos, Path=IsChecked, Converter={StaticResource boolToDataTemplateConverter},ConverterParameter={StaticResource dtPos} }" />




Viewing all articles
Browse latest Browse all 1083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>