mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 19:25:01 +00:00
90c31b4490
* WPF Example - Improve layout/design using MaterialDesignInXamlToolkit - Some very basic UI improvements using MaterialDesignInXamlToolkit
108 lines
6.1 KiB
XML
108 lines
6.1 KiB
XML
<Application x:Class="CefSharp.Wpf.Example.App"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|
xmlns:controls="clr-namespace:CefSharp.Wpf.Example.Controls"
|
|
xmlns:view="clr-namespace:CefSharp.Wpf.Example.Views"
|
|
xmlns:viewModel="clr-namespace:CefSharp.Wpf.Example.ViewModels"
|
|
StartupUri="MainWindow.xaml">
|
|
<Application.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<materialDesign:BundledTheme BaseTheme="Light" PrimaryColor="DeepPurple" SecondaryColor="Lime" />
|
|
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
<!-- Used for testing https://github.com/cefsharp/CefSharp/issues/2488 -->
|
|
<!--<Style TargetType="ToolTip">
|
|
<Setter Property="ContentTemplate">
|
|
<Setter.Value>
|
|
<DataTemplate>
|
|
<StackPanel>
|
|
<TextBlock Text="{Binding}" MaxWidth="400" TextWrapping='Wrap' />
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>-->
|
|
|
|
<Style TargetType="{x:Type controls:NonReloadingTabControl}">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type controls:NonReloadingTabControl}">
|
|
<Grid Background="{TemplateBinding Background}"
|
|
ClipToBounds="True"
|
|
KeyboardNavigation.TabNavigation="Local"
|
|
SnapsToDevicePixels="True">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition x:Name="ColumnDefinition0" />
|
|
<ColumnDefinition x:Name="ColumnDefinition1" Width="0" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition x:Name="RowDefinition0" Height="Auto" />
|
|
<RowDefinition x:Name="RowDefinition1" Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TabPanel x:Name="HeaderPanel"
|
|
Margin="0,0,0,-1"
|
|
VerticalAlignment="Bottom"
|
|
Panel.ZIndex="1"
|
|
IsItemsHost="True"
|
|
KeyboardNavigation.TabIndex="1" />
|
|
<Button Margin="10, 0, 0, 0"
|
|
ToolTip="Open new Tab"
|
|
Style="{StaticResource MaterialDesignToolButton}"
|
|
Content="{materialDesign:PackIcon Kind=TabAdd, Size=16}"
|
|
Width="25"
|
|
Command="ApplicationCommands.New" />
|
|
</StackPanel>
|
|
<Border x:Name="ContentPanel"
|
|
Grid.Row="1"
|
|
Grid.Column="0"
|
|
Background="Transparent"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
KeyboardNavigation.DirectionalNavigation="Contained"
|
|
KeyboardNavigation.TabIndex="2"
|
|
KeyboardNavigation.TabNavigation="Local">
|
|
<Grid x:Name="PART_ItemsHolder"
|
|
Margin="{TemplateBinding Padding}"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
|
</Border>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style TargetType="TabItem">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="TabItem">
|
|
<Border Name="Border" BorderThickness="1,1,1,0" BorderBrush="Gainsboro" Margin="2,0">
|
|
<ContentPresenter x:Name="ContentSite"
|
|
VerticalAlignment="Center"
|
|
HorizontalAlignment="Center"
|
|
ContentSource="Header"
|
|
Margin="10,2"/>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsSelected" Value="True">
|
|
<Setter TargetName="Border" Property="Background" Value="LightSkyBlue" />
|
|
</Trigger>
|
|
<Trigger Property="IsSelected" Value="False">
|
|
<Setter TargetName="Border" Property="Background" Value="GhostWhite" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<DataTemplate DataType="{x:Type viewModel:BrowserTabViewModel}">
|
|
<view:BrowserTabView />
|
|
</DataTemplate>
|
|
</ResourceDictionary>
|
|
</Application.Resources>
|
|
</Application>
|