Created
February 25, 2020 10:40
-
-
Save SpacePurr/b9d3ef76ab46f3237f49ae34f6e3259b to your computer and use it in GitHub Desktop.
tabcontrol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<TabControl Grid.Row="0" ItemsSource="{Binding Models}" SelectedItem="{Binding CurrentTab, Mode=TwoWay}" Loaded="FrameworkElement_OnLoaded" > | |
<i:Interaction.Triggers> | |
<i:EventTrigger EventName="SelectionChanged"> | |
<ei:CallMethodAction MethodName="Selector_OnSelectionChanged" TargetObject="{Binding}"/> | |
</i:EventTrigger> | |
</i:Interaction.Triggers> | |
<TabControl.ItemTemplate> | |
<DataTemplate> | |
<StackPanel Orientation="Horizontal"> | |
<TextBlock Text="{Binding Model.FileName, FallbackValue='3D View', Mode=TwoWay, Converter={StaticResource FileNameConverter}}"/> | |
<TextBlock Text=" "/> | |
<Button Style="{StaticResource MaterialDesignIconButton}" Height="12" Width="12" HorizontalAlignment="Right" VerticalAlignment="Top" Command="{Binding CloseCommand}"> | |
<Image Source="/TDMS 3D Control;component/Resources/img_tab_close.ico" RenderOptions.BitmapScalingMode="HighQuality"/> | |
</Button> | |
</StackPanel> | |
</DataTemplate> | |
</TabControl.ItemTemplate> | |
<TabControl.ContentTemplate> | |
<DataTemplate DataType="{x:Type vm:ModelTab}"> | |
<views:ModelView/> | |
</DataTemplate> | |
</TabControl.ContentTemplate> | |
</TabControl> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment