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/Eco/Controls/CefSharpBrowser/Views/VideoBrowserView.xaml
Kevin Krüger 05105bffc9 Umbenennung
2023-07-24 13:49:04 +02:00

132 lines
6.3 KiB
XML

<UserControl
x:Class="VideoBrowser.Controls.CefSharpBrowser.Views.VideoBrowserView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cefSharpViews="clr-namespace:VideoBrowser.Controls.CefSharpBrowser.Views"
xmlns:cefsharpbrowser="clr-namespace:VideoBrowser.Controls.CefSharpBrowser"
xmlns:converters="clr-namespace:VideoBrowser.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewmodels="clr-namespace:VideoBrowser.Controls.CefSharpBrowser.ViewModels"
xmlns:views="clr-namespace:VideoBrowser.Views"
d:DataContext="{d:DesignInstance viewmodels:VideoBrowserViewModel}"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../../Resources/IconsResource.xaml" />
</ResourceDictionary.MergedDictionaries>
<converters:BoolToVisibilityConverter
x:Key="InverseBoolToVisibilityConverter"
FalseValue="Visible"
TrueValue="Collapsed" />
<converters:BoolToBoolConverter
x:Key="InverseBoolToBoolConverter"
FalseValue="True"
TrueValue="False" />
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<!-- Browser Main Toolbar -->
<Grid
Grid.Row="0"
Margin="0,0,0,4"
Panel.ZIndex="999"
Visibility="{Binding CefWindowData.IsFullScreen, Mode=OneWay, Converter={StaticResource InverseBoolToVisibilityConverter}}">
<Grid.Resources>
<Style BasedOn="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" TargetType="Button">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Width" Value="24" />
<Setter Property="Height" Value="24" />
<Setter Property="Margin" Value="2" />
<Setter Property="Padding" Value="0" />
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- Left side buttons -->
<StackPanel
Grid.Column="0"
Height="32"
Orientation="Horizontal">
<Button Command="{Binding BackwardCommand}" ToolTip="Go back to previous visited site">
<Path Style="{StaticResource Back}" />
</Button>
<Button Command="{Binding ForwardCommand}" ToolTip="Go forward to previous visited site">
<Path Style="{StaticResource Forward}" />
</Button>
<Button Command="{Binding ReloadCommand}" ToolTip="Refresh this site">
<Path Style="{StaticResource Reload}" />
</Button>
<Button Command="{Binding HomeCommand}" ToolTip="Go home site for newest information">
<Path Style="{StaticResource Home}" />
</Button>
</StackPanel>
<!-- URL TextBox -->
<Grid x:Name="UrlEditorGrid" Grid.Column="1">
<Canvas>
<views:UrlEditorView
x:Name="UrlEditorView"
Width="{Binding RelativeSource={RelativeSource AncestorType=Grid}, Path=ActualWidth, Mode=OneWay}"
Background="White"
DataContext="{Binding UrlEditor}" />
</Canvas>
</Grid>
<!-- Right side buttons -->
<StackPanel
Grid.Column="2"
Height="32"
Orientation="Horizontal">
<Button
Command="{Binding DownloadCommand}"
IsEnabled="{Binding UrlEditor.IsDownloadable}"
ToolTip="Download the current video">
<Path Style="{StaticResource Download}" />
</Button>
</StackPanel>
<!-- Add in buttons -->
<ItemsControl
Grid.Column="3"
Height="32"
ItemsSource="{Binding AddInButtons}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button
Command="{Binding Command}"
CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=cefSharpViews:WebBrowserTabControlView}, Path=DataContext}"
IsEnabled="{Binding IsEnabled}"
ToolTip="{Binding ToolTip}">
<Path Data="{Binding Icon}" Style="{StaticResource IconPathButtonBaseStyle}" />
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
<cefsharpbrowser:CefSharpBrowser
x:Name="CefSharpBrowserControl"
Title="{Binding Header}"
Grid.Row="1"
BackwardCommand="{Binding BackwardCommand, Mode=OneWayToSource}"
ForwardCommand="{Binding ForwardCommand, Mode=OneWayToSource}"
IsAirspaceVisible="{Binding CefWindowData.IsAirspaceVisible}"
IsFullScreenCommand="{Binding CefWindowData.IsFullScreenCommand, Mode=OneWay}"
ReloadCommand="{Binding ReloadCommand, Mode=OneWayToSource}"
Url="{Binding NavigateUrl}"
WebBrowser="{Binding WebBrowser, Mode=OneWayToSource}" />
</Grid>
</UserControl>