|
1 | 1 | <Application x:Class="CefSharp.Wpf.Example.App" |
2 | 2 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
3 | 3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" |
4 | 5 | xmlns:controls="clr-namespace:CefSharp.Wpf.Example.Controls" |
5 | 6 | xmlns:view="clr-namespace:CefSharp.Wpf.Example.Views" |
6 | 7 | xmlns:viewModel="clr-namespace:CefSharp.Wpf.Example.ViewModels" |
7 | 8 | StartupUri="MainWindow.xaml"> |
8 | 9 | <Application.Resources> |
9 | | - <!-- Used for testing https://github.com/cefsharp/CefSharp/issues/2488 --> |
10 | | - <!--<Style TargetType="ToolTip"> |
11 | | - <Setter Property="ContentTemplate"> |
12 | | - <Setter.Value> |
13 | | - <DataTemplate> |
14 | | - <StackPanel> |
15 | | - <TextBlock Text="{Binding}" MaxWidth="400" TextWrapping='Wrap' /> |
16 | | - </StackPanel> |
17 | | - </DataTemplate> |
18 | | - </Setter.Value> |
19 | | - </Setter> |
20 | | - </Style>--> |
| 10 | + <ResourceDictionary> |
| 11 | + <ResourceDictionary.MergedDictionaries> |
| 12 | + <materialDesign:BundledTheme BaseTheme="Light" PrimaryColor="DeepPurple" SecondaryColor="Lime" /> |
| 13 | + <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" /> |
| 14 | + </ResourceDictionary.MergedDictionaries> |
21 | 15 |
|
22 | | - <Style TargetType="{x:Type controls:NonReloadingTabControl}"> |
23 | | - <Setter Property="Template"> |
24 | | - <Setter.Value> |
25 | | - <ControlTemplate TargetType="{x:Type controls:NonReloadingTabControl}"> |
26 | | - <Grid Background="{TemplateBinding Background}" |
| 16 | + <!-- Used for testing https://github.com/cefsharp/CefSharp/issues/2488 --> |
| 17 | + <!--<Style TargetType="ToolTip"> |
| 18 | + <Setter Property="ContentTemplate"> |
| 19 | + <Setter.Value> |
| 20 | + <DataTemplate> |
| 21 | + <StackPanel> |
| 22 | + <TextBlock Text="{Binding}" MaxWidth="400" TextWrapping='Wrap' /> |
| 23 | + </StackPanel> |
| 24 | + </DataTemplate> |
| 25 | + </Setter.Value> |
| 26 | + </Setter> |
| 27 | + </Style>--> |
| 28 | + |
| 29 | + <Style TargetType="{x:Type controls:NonReloadingTabControl}"> |
| 30 | + <Setter Property="Template"> |
| 31 | + <Setter.Value> |
| 32 | + <ControlTemplate TargetType="{x:Type controls:NonReloadingTabControl}"> |
| 33 | + <Grid Background="{TemplateBinding Background}" |
27 | 34 | ClipToBounds="True" |
28 | 35 | KeyboardNavigation.TabNavigation="Local" |
29 | 36 | SnapsToDevicePixels="True"> |
30 | | - <Grid.ColumnDefinitions> |
31 | | - <ColumnDefinition x:Name="ColumnDefinition0" /> |
32 | | - <ColumnDefinition x:Name="ColumnDefinition1" Width="0" /> |
33 | | - </Grid.ColumnDefinitions> |
34 | | - <Grid.RowDefinitions> |
35 | | - <RowDefinition x:Name="RowDefinition0" Height="Auto" /> |
36 | | - <RowDefinition x:Name="RowDefinition1" Height="*" /> |
37 | | - </Grid.RowDefinitions> |
38 | | - <StackPanel Orientation="Horizontal"> |
39 | | - <TabPanel x:Name="HeaderPanel" |
| 37 | + <Grid.ColumnDefinitions> |
| 38 | + <ColumnDefinition x:Name="ColumnDefinition0" /> |
| 39 | + <ColumnDefinition x:Name="ColumnDefinition1" Width="0" /> |
| 40 | + </Grid.ColumnDefinitions> |
| 41 | + <Grid.RowDefinitions> |
| 42 | + <RowDefinition x:Name="RowDefinition0" Height="Auto" /> |
| 43 | + <RowDefinition x:Name="RowDefinition1" Height="*" /> |
| 44 | + </Grid.RowDefinitions> |
| 45 | + <StackPanel Orientation="Horizontal"> |
| 46 | + <TabPanel x:Name="HeaderPanel" |
40 | 47 | Margin="0,0,0,-1" |
41 | 48 | VerticalAlignment="Bottom" |
42 | 49 | Panel.ZIndex="1" |
43 | 50 | IsItemsHost="True" |
44 | 51 | KeyboardNavigation.TabIndex="1" /> |
45 | | - <Button Content="+" |
46 | | - FontSize="12" |
47 | | - FontWeight="Bold" |
48 | | - Margin="10, 0, 0, 0" |
| 52 | + <Button Margin="10, 0, 0, 0" |
| 53 | + ToolTip="Open new Tab" |
| 54 | + Style="{StaticResource MaterialDesignToolButton}" |
| 55 | + Content="{materialDesign:PackIcon Kind=TabAdd, Size=16}" |
49 | 56 | Width="25" |
50 | 57 | Command="ApplicationCommands.New" /> |
51 | | - </StackPanel> |
52 | | - <Border x:Name="ContentPanel" |
| 58 | + </StackPanel> |
| 59 | + <Border x:Name="ContentPanel" |
53 | 60 | Grid.Row="1" |
54 | 61 | Grid.Column="0" |
55 | 62 | Background="Transparent" |
|
58 | 65 | KeyboardNavigation.DirectionalNavigation="Contained" |
59 | 66 | KeyboardNavigation.TabIndex="2" |
60 | 67 | KeyboardNavigation.TabNavigation="Local"> |
61 | | - <Grid x:Name="PART_ItemsHolder" |
| 68 | + <Grid x:Name="PART_ItemsHolder" |
62 | 69 | Margin="{TemplateBinding Padding}" |
63 | 70 | SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> |
64 | | - </Border> |
65 | | - </Grid> |
66 | | - </ControlTemplate> |
67 | | - </Setter.Value> |
68 | | - </Setter> |
69 | | - </Style> |
| 71 | + </Border> |
| 72 | + </Grid> |
| 73 | + </ControlTemplate> |
| 74 | + </Setter.Value> |
| 75 | + </Setter> |
| 76 | + </Style> |
70 | 77 |
|
71 | | - <Style TargetType="TabItem"> |
72 | | - <Setter Property="Template"> |
73 | | - <Setter.Value> |
74 | | - <ControlTemplate TargetType="TabItem"> |
75 | | - <Border Name="Border" BorderThickness="1,1,1,0" BorderBrush="Gainsboro" Margin="2,0"> |
76 | | - <ContentPresenter x:Name="ContentSite" |
| 78 | + <Style TargetType="TabItem"> |
| 79 | + <Setter Property="Template"> |
| 80 | + <Setter.Value> |
| 81 | + <ControlTemplate TargetType="TabItem"> |
| 82 | + <Border Name="Border" BorderThickness="1,1,1,0" BorderBrush="Gainsboro" Margin="2,0"> |
| 83 | + <ContentPresenter x:Name="ContentSite" |
77 | 84 | VerticalAlignment="Center" |
78 | 85 | HorizontalAlignment="Center" |
79 | 86 | ContentSource="Header" |
80 | 87 | Margin="10,2"/> |
81 | | - </Border> |
82 | | - <ControlTemplate.Triggers> |
83 | | - <Trigger Property="IsSelected" Value="True"> |
84 | | - <Setter TargetName="Border" Property="Background" Value="LightSkyBlue" /> |
85 | | - </Trigger> |
86 | | - <Trigger Property="IsSelected" Value="False"> |
87 | | - <Setter TargetName="Border" Property="Background" Value="GhostWhite" /> |
88 | | - </Trigger> |
89 | | - </ControlTemplate.Triggers> |
90 | | - </ControlTemplate> |
91 | | - </Setter.Value> |
92 | | - </Setter> |
93 | | - </Style> |
94 | | - |
95 | | - <DataTemplate DataType="{x:Type viewModel:BrowserTabViewModel}"> |
96 | | - <view:BrowserTabView /> |
97 | | - </DataTemplate> |
| 88 | + </Border> |
| 89 | + <ControlTemplate.Triggers> |
| 90 | + <Trigger Property="IsSelected" Value="True"> |
| 91 | + <Setter TargetName="Border" Property="Background" Value="LightSkyBlue" /> |
| 92 | + </Trigger> |
| 93 | + <Trigger Property="IsSelected" Value="False"> |
| 94 | + <Setter TargetName="Border" Property="Background" Value="GhostWhite" /> |
| 95 | + </Trigger> |
| 96 | + </ControlTemplate.Triggers> |
| 97 | + </ControlTemplate> |
| 98 | + </Setter.Value> |
| 99 | + </Setter> |
| 100 | + </Style> |
| 101 | + |
| 102 | + <DataTemplate DataType="{x:Type viewModel:BrowserTabViewModel}"> |
| 103 | + <view:BrowserTabView /> |
| 104 | + </DataTemplate> |
| 105 | + </ResourceDictionary> |
98 | 106 | </Application.Resources> |
99 | 107 | </Application> |
0 commit comments