You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
downkyi/DownKyi/Views/ViewIndex.xaml

305 lines
13 KiB

<UserControl
x:Class="DownKyi.Views.ViewIndex"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<i:InvokeCommandAction Command="{Binding LoadedCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<Grid FocusManager.FocusedElement="{Binding ElementName=nameInputUrl}">
<Grid.RowDefinitions>
<RowDefinition Height="60" />
<RowDefinition Height="200" />
<RowDefinition Height="100" />
<RowDefinition Height="230" />
<RowDefinition Height="*" />
<RowDefinition Height="50" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="20" />
</Grid.ColumnDefinitions>
<Grid
Grid.Column="1"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Cursor="Hand"
Visibility="{Binding LoginPanelVisibility}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonUp">
<i:InvokeCommandAction Command="{Binding LoginCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Image
Grid.Column="0"
Width="36"
Height="36"
Source="{Binding Header}"
ToolTip="{Binding UserName}">
<Image.Clip>
<!-- 设置图像如何显示 -->
<EllipseGeometry
Center="18,18"
RadiusX="18"
RadiusY="18" />
</Image.Clip>
</Image>
<!-- 添加一个圆框在头像上,做边框 -->
<Ellipse
Grid.Column="0"
Width="38"
Height="38"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stroke="{DynamicResource BrushImageBorder}"
StrokeThickness="2" />
<TextBlock
Grid.Column="1"
Margin="5,0,0,0"
VerticalAlignment="Center"
FontSize="14"
Foreground="{DynamicResource BrushPrimary}"
Text="{DynamicResource Login}">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger Binding="{Binding UserName}" Value="{x:Null}">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
<DataTrigger Binding="{Binding UserName}" Value="">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</Grid>
</Grid>
<ContentControl
Grid.Row="1"
Margin="0,30,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Bottom">
<Path
Width="{Binding TextLogo.Width}"
Height="{Binding TextLogo.Height}"
Data="{Binding TextLogo.Data}"
Fill="{Binding TextLogo.Fill}"
Stretch="UniformToFill" />
</ContentControl>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150*" />
<ColumnDefinition Width="600*" />
<ColumnDefinition Width="150*" />
</Grid.ColumnDefinitions>
<Border
Grid.Column="1"
Height="40"
BorderBrush="{DynamicResource BrushPrimary}"
BorderThickness="2"
CornerRadius="20">
<TextBox
x:Name="nameInputUrl"
Height="35"
Margin="20,0,40,0"
VerticalContentAlignment="Center"
BorderThickness="0"
FontSize="16"
Text="{Binding Path=InputText, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding InputCommand}" />
</TextBox.InputBindings>
<TextBox.Resources>
<VisualBrush
x:Key="HintText"
AlignmentX="Left"
Opacity="0.5"
Stretch="None"
TileMode="None">
<VisualBrush.Visual>
<!-- 请输入视频播放地址或搜索关键词…… -->
<TextBlock Text="{DynamicResource IndexHintText}" />
</VisualBrush.Visual>
</VisualBrush>
</TextBox.Resources>
<TextBox.Style>
<Style TargetType="TextBox">
<Style.Triggers>
<Trigger Property="Text" Value="{x:Null}">
<Setter Property="Background" Value="{StaticResource HintText}" />
</Trigger>
<Trigger Property="Text" Value="">
<Setter Property="Background" Value="{StaticResource HintText}" />
</Trigger>
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox>
</Border>
<Button
Grid.Column="1"
Width="20"
Height="20"
Margin="0,0,15,0"
HorizontalAlignment="Right"
Command="{Binding InputCommand}"
Style="{StaticResource ImageBtnStyle}">
<Path
Width="{Binding GeneralSearch.Width}"
Height="{Binding GeneralSearch.Height}"
Data="{Binding GeneralSearch.Data}"
Fill="{Binding GeneralSearch.Fill}"
Stretch="UniformToFill" />
</Button>
</Grid>
<Grid Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150*" />
<ColumnDefinition Width="650*" />
<ColumnDefinition Width="150*" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<StackPanel
Grid.Row="0"
Grid.Column="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Cursor="Hand"
Orientation="Vertical">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonUp">
<i:InvokeCommandAction Command="{Binding SettingsCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<Border
Width="64"
Height="64"
Margin="0,0,0,5"
Background="{DynamicResource BrushImageBackground}"
CornerRadius="32">
<ContentControl HorizontalAlignment="Center" VerticalAlignment="Center">
<Path
Width="{Binding Settings.Width}"
Height="{Binding Settings.Height}"
Data="{Binding Settings.Data}"
Fill="{Binding Settings.Fill}"
Stretch="UniformToFill" />
</ContentControl>
</Border>
<TextBlock
HorizontalAlignment="Center"
FontSize="14"
Foreground="{DynamicResource BrushPrimary}"
Text="{DynamicResource Settings}" />
</StackPanel>
<StackPanel
Grid.Row="0"
Grid.Column="1"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Cursor="Hand"
Orientation="Vertical">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonUp">
<i:InvokeCommandAction Command="{Binding DownloadManagerCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<Border
Width="64"
Height="64"
Margin="0,0,0,5"
Background="{DynamicResource BrushImageBackground}"
CornerRadius="32">
<ContentControl HorizontalAlignment="Center" VerticalAlignment="Center">
<Path
Width="{Binding DownloadManager.Width}"
Height="{Binding DownloadManager.Height}"
Data="{Binding DownloadManager.Data}"
Fill="{Binding DownloadManager.Fill}"
Stretch="UniformToFill" />
</ContentControl>
</Border>
<TextBlock
HorizontalAlignment="Center"
FontSize="14"
Foreground="{DynamicResource BrushPrimary}"
Text="{DynamicResource DownloadManager}" />
</StackPanel>
<StackPanel
Grid.Row="0"
Grid.Column="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Cursor="Hand"
Orientation="Vertical">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonUp">
<i:InvokeCommandAction Command="{Binding ToolboxCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<Border
Width="64"
Height="64"
Margin="0,0,0,5"
Background="{DynamicResource BrushImageBackground}"
CornerRadius="32">
<ContentControl HorizontalAlignment="Center" VerticalAlignment="Center">
<Path
Width="{Binding Toolbox.Width}"
Height="{Binding Toolbox.Height}"
Data="{Binding Toolbox.Data}"
Fill="{Binding Toolbox.Fill}"
Stretch="UniformToFill" />
</ContentControl>
</Border>
<TextBlock
HorizontalAlignment="Center"
FontSize="14"
Foreground="{DynamicResource BrushPrimary}"
Text="{DynamicResource Toolbox}" />
</StackPanel>
</Grid>
</Grid>
</Grid>
</UserControl>