130 lines
6.2 KiB
XML
130 lines
6.2 KiB
XML
<Grid
|
|
x:Class="VideoBrowser.Views.UrlEditorView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:cefsharpbrowser="clr-namespace:VideoBrowser.Controls.CefSharpBrowser"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:extension="clr-namespace:VideoBrowser.Extensions"
|
|
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:viewmodels="clr-namespace:VideoBrowser.ViewModels"
|
|
d:DataContext="{d:DesignInstance viewmodels:UrlEditorViewModel}"
|
|
d:DesignHeight="450"
|
|
d:DesignWidth="800"
|
|
extension:FocusExtension.IsFocused="{Binding IsFocused, Mode=TwoWay}"
|
|
extension:FocusExtension.TrackFocus="True"
|
|
mc:Ignorable="d">
|
|
<Grid.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="../Resources/IconsResource.xaml" />
|
|
</ResourceDictionary.MergedDictionaries>
|
|
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
|
|
<Style
|
|
x:Key="ButtonPathStyle"
|
|
BasedOn="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
|
|
TargetType="Button">
|
|
<Setter Property="BorderThickness" Value="0" />
|
|
<Setter Property="Margin" Value="2" />
|
|
</Style>
|
|
</ResourceDictionary>
|
|
</Grid.Resources>
|
|
<Border Background="White" Visibility="{Binding IsVisible, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<Border.Effect>
|
|
<DropShadowEffect
|
|
BlurRadius="10"
|
|
Opacity="0.3"
|
|
ShadowDepth="0" />
|
|
</Border.Effect>
|
|
</Border>
|
|
<Grid Margin="2">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<!-- Url TextBox -->
|
|
<!--<TextBox
|
|
Grid.Row="0"
|
|
Height="21"
|
|
Margin="2,2,2,4"
|
|
VerticalAlignment="Center"
|
|
extension:FocusExtension.IsFocused="{Binding IsTextBoxFocused, Mode=TwoWay, Delay=100}"
|
|
extension:FocusExtension.TrackFocus="True"
|
|
extension:TextBoxExtension.IsClickToSelectAll="True"
|
|
Text="{Binding Url, UpdateSourceTrigger=PropertyChanged}">
|
|
<TextBox.InputBindings>
|
|
<KeyBinding Key="Return" Command="{Binding NavigateUrlCommand}" />
|
|
</TextBox.InputBindings>
|
|
</TextBox>-->
|
|
<cefsharpbrowser:UrlTextBox
|
|
Grid.Row="0"
|
|
Margin="2,2,2,4"
|
|
extension:FocusExtension.IsFocused="{Binding IsTextBoxFocused, Mode=TwoWay, Delay=100}"
|
|
extension:FocusExtension.TrackFocus="True"
|
|
extension:TextBoxExtension.IsClickToSelectAll="True"
|
|
NavigateUrl="{Binding NavigateUrl, UpdateSourceTrigger=PropertyChanged}"
|
|
NavigateUrlCommand="{Binding NavigateUrlCommand}"
|
|
Url="{Binding Url, UpdateSourceTrigger=PropertyChanged}" />
|
|
<Grid Grid.Row="1" Visibility="{Binding IsVisible, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid Grid.Column="0" VerticalAlignment="Center">
|
|
<Image
|
|
Width="200"
|
|
Source="{Binding ImageUrl}"
|
|
Stretch="Uniform" />
|
|
<Label
|
|
Margin="4"
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Bottom"
|
|
Background="Black"
|
|
Content="{Binding Duration}"
|
|
Foreground="White" />
|
|
</Grid>
|
|
<StackPanel Grid.Column="1" Margin="12,0,12,0">
|
|
<TextBlock
|
|
Margin="0,0,0,2"
|
|
FontSize="14"
|
|
FontWeight="SemiBold"
|
|
Text="{Binding FileName}" />
|
|
<TextBlock Text="{Binding FileSize}" />
|
|
<ComboBox
|
|
Width="200"
|
|
Margin="0,4,0,0"
|
|
HorizontalAlignment="Left"
|
|
IsSynchronizedWithCurrentItem="True"
|
|
ItemsSource="{Binding Formats}"
|
|
SelectedIndex="{Binding SelectedFormatIndex, UpdateSourceTrigger=PropertyChanged, Delay=300}"
|
|
SelectedItem="{Binding SelectedFormat, UpdateSourceTrigger=PropertyChanged, Mode=OneWayToSource}" />
|
|
<StackPanel Margin="0,4,0,0" Orientation="Horizontal">
|
|
<TextBlock
|
|
MaxWidth="500"
|
|
VerticalAlignment="Center"
|
|
Text="{Binding Settings.OutputFolder}" />
|
|
<Button
|
|
Margin="8,0,0,0"
|
|
Command="{Binding GetFolderCommand}"
|
|
CommandParameter="{Binding RelativeSource={RelativeSource Self}}"
|
|
Style="{StaticResource ButtonPathStyle}"
|
|
ToolTip="Change the output folder">
|
|
<Path Style="{StaticResource VideoFolder}" />
|
|
</Button>
|
|
</StackPanel>
|
|
<Button
|
|
Margin="0,4,0,8"
|
|
HorizontalAlignment="Left"
|
|
Command="{Binding DownloadCommand}"
|
|
Content="Download"
|
|
Style="{DynamicResource MahApps.Styles.Button.Square.Accent}"
|
|
ToolTip="Download the current video" />
|
|
</StackPanel>
|
|
</Grid>
|
|
<Grid Background="#AAFFFFFF" Visibility="{Binding IsBusy, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<mah:ProgressRing IsActive="{Binding IsBusy}" />
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid> |