added MergedDictionaries in Generic.xaml to split custom controls in seperate xaml files,

implemented add button visually in ExtendedTabControl
master
Jonas Arnold 3 years ago
parent 59f674f663
commit b0e63d0437
  1. 7
      MultiTerm.Wpf.CustomControl/ExtendedTabControl/ExtendedTabControl.xaml
  2. 12
      MultiTerm.Wpf.CustomControl/Themes/Generic.xaml
  3. 1
      MultiTerm.Wpf/MultiTerm.Wpf.csproj
  4. 13
      MultiTerm.Wpf/View/ShellView.xaml

@ -4,7 +4,7 @@
<SolidColorBrush x:Key="TabItem.Selected.Background" Color="#FFFFFF"/>
<SolidColorBrush x:Key="TabItem.Selected.Border" Color="#ACACAC"/>
<Style x:Key="TabControlStyle1" TargetType="{x:Type local:ExtendedTabControl}">
<Style TargetType="{x:Type local:ExtendedTabControl}">
<Setter Property="Padding" Value="2"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
@ -24,7 +24,10 @@
<RowDefinition x:Name="RowDefinition0" Height="Auto"/>
<RowDefinition x:Name="RowDefinition1" Height="*"/>
</Grid.RowDefinitions>
<TabPanel x:Name="headerPanel" Background="Transparent" Grid.Column="0" IsItemsHost="true" Margin="2,2,2,0" Grid.Row="0" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1"/>
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0">
<TabPanel x:Name="headerPanel" Background="Transparent" IsItemsHost="true" Margin="2,2,2,0" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1"/>
<Button Margin="2,2,2,2" Height="{TemplateBinding Height}" Width="{TemplateBinding Height}">+</Button>
</StackPanel>
<Border x:Name="contentPanel" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.Column="0" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="1" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Border>

@ -0,0 +1,12 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:MultiTerm.Wpf.CustomControl">
<!-- below all xaml files for custom controls shall be added -->
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/MultiTerm.Wpf.CustomControl;component/ExtendedTabControl/ExtendedTabControl.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

@ -15,6 +15,7 @@
<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj" />
<ProjectReference Include="..\MultiTerm.Core\MultiTerm.Core.csproj" />
<ProjectReference Include="..\MultiTerm.Wpf.CustomControl\MultiTerm.Wpf.CustomControl.csproj" />
</ItemGroup>
</Project>

@ -6,6 +6,7 @@
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:conv="clr-namespace:MultiTerm.Wpf.ValueConverters"
xmlns:controls="clr-namespace:MultiTerm.Wpf.Controls"
xmlns:custom_controls="clr-namespace:MultiTerm.Wpf.CustomControl;assembly=MultiTerm.Wpf.CustomControl"
xmlns:vm="clr-namespace:MultiTerm.Core.ViewModel;assembly=MultiTerm.Core"
xmlns:v="clr-namespace:MultiTerm.Wpf.View"
xmlns:core_common="clr-namespace:MultiTerm.Core.Common;assembly=MultiTerm.Core"
@ -125,13 +126,13 @@
<RibbonSeparator/>
</RibbonMenuButton>-->
</StackPanel>
<TabControl DockPanel.Dock="Right"
<custom_controls:ExtendedTabControl DockPanel.Dock="Right"
x:Name="terminalTabControl"
ItemsSource="{Binding TerminalViewModels}"
SelectedItem="{Binding SelectedTerminalViewModel}">
<!-- Tab Template -->
<TabControl.ItemTemplate>
<custom_controls:ExtendedTabControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Title, Mode=OneWay}" />
@ -146,14 +147,14 @@
</Button>
</StackPanel>
</DataTemplate>
</TabControl.ItemTemplate>
</custom_controls:ExtendedTabControl.ItemTemplate>
<!-- Register additional Tab ViewModels here -->
<TabControl.Resources>
<custom_controls:ExtendedTabControl.Resources>
<DataTemplate DataType="{x:Type vm:SendReceiveViewModel}">
<v:SendReceiveView/>
</DataTemplate>
</TabControl.Resources>
</TabControl>
</custom_controls:ExtendedTabControl.Resources>
</custom_controls:ExtendedTabControl>
</DockPanel>
</UserControl>

Loading…
Cancel
Save