or

| <Window x:Class="sample.Window1" |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:telNavigationControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" |
| xmlns:telControlsControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" |
| xmlns:sample="clr-namespace:sample" |
| Title="Sample Window" Height="300" Width="300"> |
| <Window.Resources> |
| <Style x:Key="TelerikTabItemContainerStyle" TargetType="{x:Type telNavigationControls:RadTabItem}"> |
| <Setter Property="HeaderTemplate"> |
| <Setter.Value> |
| <DataTemplate> |
| <Button x:Name="closeButton" Content="Test Button" Height="25" sample:RoutedEventHelper.EnableRoutedClick="True"/> |
| </DataTemplate> |
| </Setter.Value> |
| </Setter> |
| </Style> |
| </Window.Resources> |
| <Grid> |
| <telNavigationControls:RadTabControl x:Name="mainTabControl" ItemContainerStyle="{StaticResource TelerikTabItemContainerStyle}" > |
| <telNavigationControls:RadTabItem > |
| <telNavigationControls:RadTabItem.Content> |
| <Button HorizontalAlignment="Center" VerticalAlignment="Center" Content="Test" IsDefault="True" /> |
| </telNavigationControls:RadTabItem.Content> |
| </telNavigationControls:RadTabItem> |
| </telNavigationControls:RadTabControl> |
| </Grid> |
| </Window> |
| using System; |
| using System.Collections.Generic; |
| using System.Linq; |
| using System.Text; |
| using System.Windows; |
| using System.Windows.Controls; |
| using Telerik.Windows; |
| using Telerik.Windows.Controls; |
| namespace sample |
| { |
| class RoutedEventHelper |
| { |
| // TAB CLOSE BUTTON EVENT |
| public static readonly RoutedEvent TabCloseButtonPressedEvent = EventManager.RegisterRoutedEvent( |
| "TabCloseButtonPressed", |
| RoutingStrategy.Bubble, |
| typeof(RoutedEventHandler), |
| typeof(RoutedEventHelper)); |
| // DEPENDENCY PROPERTY FOR TAB ITEM HEADER BUTTON |
| public static readonly DependencyProperty EnableRoutedClickProperty = DependencyProperty.RegisterAttached( |
| "EnableRoutedClick", |
| typeof(bool), |
| typeof(RoutedEventHelper), |
| new PropertyMetadata(OnEnableRoutedClickChanged)); |
| // Add an attached property |
| public static bool GetEnableRoutedClick(DependencyObject obj) |
| { |
| return (bool)obj.GetValue(EnableRoutedClickProperty); |
| } |
| public static void SetEnableRoutedClick(DependencyObject obj, bool value) |
| { |
| obj.SetValue(EnableRoutedClickProperty, value); |
| } |
| // TAB EVENT HANDLER |
| private static void OnEnableRoutedClickChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) |
| { |
| var button = sender as Button; |
| if (button != null) |
| button.Click += CloseButton_Click; |
| } |
| private static void CloseButton_Click(object sender, RoutedEventArgs e) |
| { |
| var button = sender as Button; |
| if (button == null) return; |
| button.RaiseEvent(new RoutedEventArgs(TabCloseButtonPressedEvent, button)); |
| } |
| } |
| } |
| <Grid> |
| <telNavigationControls:RadTabControl x:Name="mainTabControl" Grid.Row="0" HorizontalAlignment="Stretch" |
| VerticalAlignment="Stretch" DisplayMemberPath="Content" DropDownDisplayMode="Collapsed" ScrollMode="Viewport" |
| Background="#dde1ea" telControlsControls:StyleManager.Theme="Windows7" SnapsToDevicePixels="True" SelectedIndex="0"> |
| <!--FIRST TAB ITEM--> |
| <telNavigationControls:RadTabItem Header="Tab 1"> |
| <telNavigationControls:RadTabItem.Content> |
| <telDockingControls:RadDocking HasDocumentHost="False"> |
| <telDockingControls:RadSplitContainer > |
| <telDockingControls:RadPaneGroup > |
| <telDockingControls:RadPane Title="Tab1" Style="{StaticResource TelerikRadPaneStyle}"/> |
| </telDockingControls:RadPaneGroup> |
| </telDockingControls:RadSplitContainer> |
| </telDockingControls:RadDocking> |
| </telNavigationControls:RadTabItem.Content> |
| </telNavigationControls:RadTabItem> |
| <!--SECOND TAB ITEM--> |
| <telNavigationControls:RadTabItem Header="Tab 2"> |
| <telNavigationControls:RadTabItem.Content > |
| <telDockingControls:RadDocking HasDocumentHost="False"> |
| <telDockingControls:RadSplitContainer > |
| <telDockingControls:RadPaneGroup > |
| <telDockingControls:RadPane Title="Tab2" Style="{StaticResource TelerikRadPaneStyle}"/> |
| </telDockingControls:RadPaneGroup> |
| </telDockingControls:RadSplitContainer> |
| </telDockingControls:RadDocking> |
| </telNavigationControls:RadTabItem.Content> |
| </telNavigationControls:RadTabItem> |
| </telNavigationControls:RadTabControl> |
| </Grid> |
| <Style x:Key="TelerikRadPaneStyle" TargetType="{x:Type telDockingControls:RadPane}"> |
| <Setter Property="CanUserPin" Value="False" /> |
| <Setter Property="CanFloat" Value="True" /> |
| <Setter Property="CanUserClose" Value="False" /> |
| <Setter Property="ContextMenuTemplate"> |
| <Setter.Value> |
| <DataTemplate> |
| <telNavigationControls:RadContextMenu Visibility="Collapsed" /> |
| </DataTemplate> |
| </Setter.Value> |
| </Setter> |
| <Setter Property="TitleTemplate"> |
| <Setter.Value> |
| <DataTemplate > |
| <Grid > |
| <Grid.ColumnDefinitions> |
| <ColumnDefinition Width="Auto" /> |
| </Grid.ColumnDefinitions> |
| <Button Grid.Column="0" Width="100" Content="Test Button" HorizontalAlignment="Center"/> |
| </Grid> |
| </DataTemplate> |
| </Setter.Value> |
| </Setter> |
| </Style> |
| <telerik:InformationLayer x:Name="informationLayer" > |
| <Border |
| telerik:MapLayer.Location="{Binding Path=LocationData.CurrentLocation}" |
| Background="#00FFFFFF">..... |
| public Location CurrentLocation |
| { |
| get |
| { |
| return panel.CurrentLocation; |
| } |
| private set |
| { |
| panel.CurrentLocation = value; |
| OnPropertyChanged("CurrentLocation"); |
| } |
| } |