I have a page that contains a RadTabControl much like this:
<tn:RadTabControl Background="White"
fxui:ContentLayout.ContentName="body"
ItemsSource="{Binding Views, Converter={StaticResource pageListTabConverter}}"
SelectedItem="{Binding SelectedView, Mode=TwoWay, Converter={StaticResource pageTabConverter}}" />
In my converters I am handling multiple types of views to be displayed to the user. In these converters I set the tab HeaderText as such:
tab = new RadTabItem {Content = view, DataContext = view.Model};
var headerBinding = new Binding("HeaderText") {Source = view.Model};
tab.SetBinding(HeaderedContentControl.HeaderProperty, headerBinding);
What I'm interested in doing is being able to set the HeaderTemplate style to contain a button so I can let the user click this button to close the object. In your examples however this is all setup through the xaml. Is there a way to do this programmatically?
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<Grid Margin="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Name}" Grid.Column="1" FontSize="11"
Margin="5 0 5 0" VerticalAlignment="Center" />
<Button Content="x" FontSize="11" VerticalAlignment="Center"
Grid.Column="2" />
</Grid>
</DataTemplate>
</Setter.Value>
</Setter>
Thanks in advanced.
<tn:RadTabControl Background="White"
fxui:ContentLayout.ContentName="body"
ItemsSource="{Binding Views, Converter={StaticResource pageListTabConverter}}"
SelectedItem="{Binding SelectedView, Mode=TwoWay, Converter={StaticResource pageTabConverter}}" />
In my converters I am handling multiple types of views to be displayed to the user. In these converters I set the tab HeaderText as such:
tab = new RadTabItem {Content = view, DataContext = view.Model};
var headerBinding = new Binding("HeaderText") {Source = view.Model};
tab.SetBinding(HeaderedContentControl.HeaderProperty, headerBinding);
What I'm interested in doing is being able to set the HeaderTemplate style to contain a button so I can let the user click this button to close the object. In your examples however this is all setup through the xaml. Is there a way to do this programmatically?
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<Grid Margin="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Name}" Grid.Column="1" FontSize="11"
Margin="5 0 5 0" VerticalAlignment="Center" />
<Button Content="x" FontSize="11" VerticalAlignment="Center"
Grid.Column="2" />
</Grid>
</DataTemplate>
</Setter.Value>
</Setter>
Thanks in advanced.