This repository has been archived on 2026-03-14. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Eco/VideoBrowser/Controls/CefSharpBrowser/Views/WebBrowserTabControlView.xaml
2023-07-24 12:00:34 +02:00

77 lines
4.2 KiB
XML

<UserControl
x:Class="VideoBrowser.Controls.CefSharpBrowser.Views.WebBrowserTabControlView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dockablz="http://dragablz.net/winfx/xaml/dockablz"
xmlns:dragablz="http://dragablz.net/winfx/xaml/dragablz"
xmlns:extension="clr-namespace:VideoBrowser.Extensions"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewmodels="clr-namespace:VideoBrowser.Controls.CefSharpBrowser.ViewModels"
d:DataContext="{d:DesignInstance viewmodels:WebBrowserTabControlViewModel}"
d:DesignHeight="450"
d:DesignWidth="800"
Loaded="{extension:EventBinding Command={Binding LoadedCommand}}"
mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
<DataTemplate DataType="{x:Type dragablz:HeaderedItemViewModel}">
<ContentControl
Margin="4"
Content="{Binding Content}"
FontSize="14" />
</DataTemplate>
<dragablz:InterTabController
x:Key="InterTabController"
x:Shared="False"
InterTabClient="{Binding InterTabClient}"
Partition="2AE89D18-F236-4D20-9605-6C03319038E6" />
<Style x:Key="TabablzControlStyle" TargetType="{x:Type dragablz:TabablzControl}">
<Setter Property="ItemsSource" Value="{Binding TabItems}" />
<Setter Property="ClosingItemCallback" Value="{Binding ClosingTabItemHandler}" />
<Setter Property="ShowDefaultAddButton" Value="True" />
<Setter Property="ShowDefaultCloseButton" Value="True" />
<Setter Property="AdjacentHeaderItemOffset" Value="-10" />
<Setter Property="ItemContainerStyle" Value="{StaticResource TrapezoidDragableTabItemStyle}" />
<Setter Property="HeaderMemberPath" Value="Header" />
<Setter Property="InterTabController" Value="{StaticResource InterTabController}" />
<Setter Property="Margin" Value="0,8,0,0" />
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(dockablz:Layout.IsTopLeftItem)}" Value="True">
<Setter Property="HeaderPrefixContent" Value="{StaticResource WindowIcon}" />
</DataTrigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<dockablz:Layout
Name="RootLayout"
ClosingFloatingItemCallback="{Binding ClosingFloatingItemHandler}"
FloatingItemHeaderMemberPath="Header"
FloatingItemsContainerMargin="0 2 0 0"
FloatingItemsSource="{Binding ToolItems}"
IsFloatDropZoneEnabled="True"
Partition="2AE89D18-F236-4D20-9605-6C03319038E6">
<!-- branch template lets dragablz create a new tab control after a window is split via docking -->
<dockablz:Layout.BranchTemplate>
<DataTemplate>
<dragablz:TabablzControl Style="{StaticResource TabablzControlStyle}">
<dragablz:TabablzControl.InterTabController>
<dragablz:InterTabController InterTabClient="{Binding InterTabClient}" Partition="2AE89D18-F236-4D20-9605-6C03319038E6" />
</dragablz:TabablzControl.InterTabController>
</dragablz:TabablzControl>
</DataTemplate>
</dockablz:Layout.BranchTemplate>
<dragablz:TabablzControl
x:Name="InitialTabablzControl"
AddLocationHint="After"
FixedHeaderCount="1"
NewItemFactory="{Binding CreateBrowserFunc}"
SelectedIndex="{Binding SelectedTabIndex}"
Style="{StaticResource TabablzControlStyle}">
<dragablz:TabablzControl.InterTabController>
<dragablz:InterTabController InterTabClient="{Binding InterTabClient}" Partition="2AE89D18-F236-4D20-9605-6C03319038E6" />
</dragablz:TabablzControl.InterTabController>
</dragablz:TabablzControl>
</dockablz:Layout>
</UserControl>