420 lines
33 KiB
XML
420 lines
33 KiB
XML
<h:ApplicationBase x:Class="HeBianGu.App.Disk.App"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:h="https://github.com/HeBianGu"
|
|
xmlns:local="clr-namespace:HeBianGu.App.Disk"
|
|
xmlns:provider="clr-namespace:Hopetry.Provider"
|
|
xmlns:models="clr-namespace:Hopetry.Models">
|
|
<h:ApplicationBase.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries />
|
|
<provider:ViewModelLocator x:Key="S.ViewModelLocator.Locator" />
|
|
<DataTemplate DataType="{x:Type models:DownFolderSelect}">
|
|
<Grid Margin="100">
|
|
<Border Background="{DynamicResource {x:Static h:BrushKeys.BackgroundDefault}}"
|
|
CornerRadius="{DynamicResource {x:Static h:CornerRadiusKeys.CornerRadius}}" />
|
|
|
|
<DockPanel Margin="10" TextBlock.FontSize="18"
|
|
TextBlock.Foreground="{DynamicResource {x:Static h:BrushKeys.ForegroundDefault}}">
|
|
<TextBlock Margin="10"
|
|
HorizontalAlignment="Left"
|
|
DockPanel.Dock="Top"
|
|
FontSize="{StaticResource {x:Static h:FontSizeKeys.Header2}}"
|
|
FontWeight="Bold"
|
|
Text="设置下载路径" />
|
|
<h:Row>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBox h:Cattach.Title="下载目录"
|
|
Style="{StaticResource {x:Static h:TextBoxKeys.LabelNone}}"
|
|
Text="{Binding Path=DownFolder, Mode=TwoWay}"
|
|
VerticalAlignment="Center" Width="250" />
|
|
<Button h:Cattach.Icon=""
|
|
Command="{Binding Source={StaticResource S.ViewModelLocator.Locator},
|
|
Path= LoyoutViewModel.SelectDirCommand }"
|
|
VerticalAlignment="Center" />
|
|
</StackPanel>
|
|
</h:Row>
|
|
<!--<h:Row>
|
|
<CheckBox Content="设为默认路径" IsChecked="{Binding IsSelect}"/>
|
|
</h:Row>-->
|
|
<Grid
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Center"
|
|
DockPanel.Dock="Bottom">
|
|
|
|
<Button Width="Auto"
|
|
Command="{x:Static h:ObjectContentDialog.Close}"
|
|
Content="kkkk" />
|
|
<Button Width="Auto"
|
|
HorizontalAlignment="Right"
|
|
Command="{x:Static h:ObjectContentDialog.Sumit}"
|
|
Content="确认" />
|
|
</Grid>
|
|
</DockPanel>
|
|
|
|
<Button Width="30"
|
|
Height="30"
|
|
Margin="10"
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Top"
|
|
h:Cattach.AllowsAnimation="True"
|
|
h:Cattach.Icon=""
|
|
h:Cattach.IconSize="14"
|
|
h:Cattach.MouseOverForeground="{DynamicResource {x:Static h:BrushKeys.Red}}"
|
|
Command="{x:Static h:ObjectContentDialog.Close}"
|
|
Style="{DynamicResource {x:Static h:ButtonKeys.Transparent}}"
|
|
WindowChrome.IsHitTestVisibleInChrome="True" />
|
|
</Grid>
|
|
</DataTemplate>
|
|
<Style
|
|
x:Key="{ComponentResourceKey ResourceId=S.ProgressBar.Custom, TypeInTargetAssembly={x:Type h:ProgressBarKeys}}"
|
|
BasedOn="{StaticResource {x:Static h:ProgressBarKeys.Dynamic}}" TargetType="ProgressBar">
|
|
<Setter Property="Width" Value="auto" />
|
|
<Setter Property="Height" Value="auto" />
|
|
<Setter Property="BorderThickness" Value="0" />
|
|
<Setter Property="h:Cattach.Title" Value="当前进度" />
|
|
<Setter Property="Clip">
|
|
<Setter.Value>
|
|
<RectangleGeometry RadiusX="15" RadiusY="15">
|
|
<RectangleGeometry.Rect>
|
|
<Rect Width="300" Height="30" />
|
|
</RectangleGeometry.Rect>
|
|
</RectangleGeometry>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="ProgressBar">
|
|
<Grid Background="{TemplateBinding Background}">
|
|
|
|
<ProgressBar Background="Transparent"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
Foreground="{TemplateBinding Foreground}"
|
|
Maximum="{TemplateBinding Maximum}"
|
|
Minimum="{TemplateBinding Minimum}"
|
|
Opacity="{TemplateBinding Value,
|
|
Converter={x:Static h:XConverter.OpacityProgressBarConverter}}"
|
|
Style="{DynamicResource {x:Static h:ProgressBarKeys.Default}}"
|
|
Value="{TemplateBinding Value}" />
|
|
|
|
<ProgressBar Background="Transparent"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
Foreground="{DynamicResource {x:Static h:BrushKeys.ForegroundWhite}}"
|
|
IsIndeterminate="True"
|
|
Maximum="100"
|
|
Minimum="0"
|
|
Opacity="0.5"
|
|
Style="{DynamicResource {x:Static h:ProgressBarKeys.Default}}" />
|
|
|
|
<TextBlock HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
FontSize="{TemplateBinding FontSize}"
|
|
FontWeight="Bold"
|
|
Foreground="{DynamicResource {x:Static h:BrushKeys.ForegroundWhite}}">
|
|
<Run Text="{TemplateBinding h:Cattach.Title}" />
|
|
<Run
|
|
Text="{Binding RelativeSource={RelativeSource AncestorType=ProgressBar}, Path=Value, Converter={x:Static h:XConverter.DoubleRoundConverter}}" />
|
|
<Run Text="%" />
|
|
<TextBlock.Effect>
|
|
<DropShadowEffect BlurRadius="3" ShadowDepth="0"
|
|
Color="{DynamicResource AccentColor}" />
|
|
</TextBlock.Effect>
|
|
</TextBlock>
|
|
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style
|
|
x:Key="{ComponentResourceKey ResourceId=S.Window.Link.Custom, TypeInTargetAssembly={x:Type h:LinkWindowBase}}"
|
|
BasedOn="{StaticResource {x:Static h:MessageWindowBase.DynamicKey}}"
|
|
TargetType="{x:Type h:LinkWindowBase}">
|
|
<Setter Property="BorderThickness" Value="2" />
|
|
<Setter Property="CaptionHeight" Value="76" />
|
|
<Setter Property="CaptionForeground" Value="{DynamicResource {x:Static h:BrushKeys.ForegroundDefault}}" />
|
|
<Setter Property="CaptionBackground" Value="{DynamicResource {x:Static h:BrushKeys.Dark0_2}}" />
|
|
<Setter Property="h:TransitionService.VisibleActions">
|
|
<Setter.Value>
|
|
<h:TransitionCollection>
|
|
<h:ImageOpacityMaskTransition HideDuration="1000"
|
|
ImageSource="pack://application:,,,/Assets/logo.png"
|
|
VisibleDuration="600" />
|
|
</h:TransitionCollection>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type h:LinkWindowBase}">
|
|
<Grid Name="g_all">
|
|
<Border x:Name="Bg"
|
|
Margin="{TemplateBinding Padding}"
|
|
Background="{TemplateBinding Background}"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
CornerRadius="{TemplateBinding h:Cattach.CornerRadius}"
|
|
Effect="{DynamicResource {x:Static h:EffectShadowKeys.Window}}"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
|
<h:GuideHost Margin="{TemplateBinding Padding}"
|
|
IsGuide="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(h:Cattach.IsGuide)}">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" MinHeight="20" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<Border Grid.Row="0"
|
|
Height="{TemplateBinding CaptionHeight}"
|
|
Margin="0"
|
|
Background="{TemplateBinding CaptionBackground}"
|
|
CornerRadius="{DynamicResource {x:Static h:CornerRadiusKeys.Top}}">
|
|
<DockPanel Margin="0">
|
|
<Grid x:Name="PART_Header"
|
|
Width="293"
|
|
Height="20"
|
|
Margin="20,1"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Background="{DynamicResource {x:Static h:BrushKeys.Accent}}"
|
|
DockPanel.Dock="Left">
|
|
<Grid.OpacityMask>
|
|
<ImageBrush
|
|
ImageSource="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Logo}" />
|
|
</Grid.OpacityMask>
|
|
</Grid>
|
|
<Control Background="{TemplateBinding CaptionBackground}"
|
|
DockPanel.Dock="Left"
|
|
Foreground="{TemplateBinding CaptionForeground}"
|
|
Template="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(h:Cattach.CaptionLeftTemplate)}"
|
|
WindowChrome.IsHitTestVisibleInChrome="True" />
|
|
|
|
<ListBox x:Name="list"
|
|
Margin="0"
|
|
VerticalAlignment="Center"
|
|
Background="Transparent"
|
|
BorderThickness="0"
|
|
DockPanel.Dock="Left"
|
|
Foreground="{TemplateBinding CaptionForeground}"
|
|
ItemsSource="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Links}"
|
|
SelectedIndex="0"
|
|
SelectedItem="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=CurrentLink}">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate DataType="{x:Type h:ILinkAction}">
|
|
<Grid>
|
|
<StackPanel HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal"
|
|
WindowChrome.IsHitTestVisibleInChrome="True">
|
|
<TextBlock x:Name="tb_logo"
|
|
Margin="0,0,0,10"
|
|
Style="{DynamicResource {x:Static h:TextBlockKeys.Icon}}"
|
|
Text="{Binding Logo}" />
|
|
<TextBlock VerticalAlignment="Center"
|
|
Foreground="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem}, Path=Foreground}"
|
|
Text="{Binding DisplayName}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
<DataTemplate.Triggers>
|
|
<DataTrigger Binding="{Binding Logo}" Value="{x:Null}">
|
|
<Setter TargetName="tb_logo" Property="Visibility"
|
|
Value="Collapsed" />
|
|
</DataTrigger>
|
|
</DataTemplate.Triggers>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
<ListBox.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel HorizontalAlignment="Left"
|
|
Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ListBox.ItemsPanel>
|
|
<ListBox.ItemContainerStyle>
|
|
<Style TargetType="ListBoxItem">
|
|
<Setter Property="FontSize"
|
|
Value="{DynamicResource {x:Static h:FontSizeKeys.Header}}" />
|
|
<Setter Property="Foreground"
|
|
Value="{Binding RelativeSource={RelativeSource AncestorType=h:LinkWindowBase}, Path=CaptionForeground}" />
|
|
<Setter Property="Padding" Value="20,0,0,0" />
|
|
<Setter Property="Height" Value="45" />
|
|
<Setter Property="h:Cattach.GuideData" Value="跳转到指定功能页面" />
|
|
<Setter Property="h:Cattach.GuideTitle"
|
|
Value="{Binding DisplayName}" />
|
|
<Setter Property="h:Cattach.UseGuide" Value="True" />
|
|
<Setter Property="h:Cattach.GuideUseClick" Value="True" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ListBoxItem}">
|
|
<Grid Height="{TemplateBinding Height}"
|
|
Margin="{TemplateBinding Padding}"
|
|
VerticalAlignment="Center">
|
|
<Border x:Name="underline"
|
|
BorderBrush="{TemplateBinding Foreground}"
|
|
BorderThickness="0,0,0,1.5" />
|
|
<ContentPresenter Margin="15,0"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="{TemplateBinding VerticalAlignment}" />
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsSelected"
|
|
Value="false">
|
|
<Setter TargetName="underline"
|
|
Property="BorderThickness"
|
|
Value="0,0,0,0" />
|
|
</Trigger>
|
|
|
|
<Trigger Property="IsMouseOver"
|
|
Value="true">
|
|
<Setter TargetName="underline"
|
|
Property="BorderThickness"
|
|
Value="0,0,0,0" />
|
|
<Setter Property="Opacity" Value="0.8" />
|
|
<Setter Property="Cursor" Value="Hand" />
|
|
</Trigger>
|
|
|
|
<Trigger Property="IsSelected" Value="true">
|
|
<Setter TargetName="underline"
|
|
Property="BorderThickness"
|
|
Value="0,0,0,1.5" />
|
|
<Setter Property="Foreground"
|
|
Value="{DynamicResource {x:Static h:BrushKeys.Accent}}" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</ListBox.ItemContainerStyle>
|
|
</ListBox>
|
|
|
|
<StackPanel Margin="0,0,10,0"
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Center"
|
|
DockPanel.Dock="Right"
|
|
Orientation="Horizontal"
|
|
WindowChrome.IsHitTestVisibleInChrome="True">
|
|
<ItemsControl
|
|
Foreground="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=CaptionForeground}"
|
|
Style="{DynamicResource {x:Static h:MvpKeys.WindowCaption}}" />
|
|
|
|
<Separator Height="20"
|
|
Background="{Binding RelativeSource={RelativeSource AncestorType=h:MessageWindowBase}, Path=CaptionForeground}"
|
|
Style="{DynamicResource {x:Static h:SeparatorKeys.Vertical}}" />
|
|
|
|
<Button
|
|
Style="{DynamicResource {x:Static h:ButtonKeys.MinimizeWindow}}" />
|
|
<Button x:Name="btnMax"
|
|
Style="{DynamicResource {x:Static h:ButtonKeys.MaximizeWindow}}" />
|
|
<Button
|
|
Style="{DynamicResource {x:Static h:ButtonKeys.CloseWindow}}" />
|
|
</StackPanel>
|
|
|
|
<Control Background="{TemplateBinding CaptionBackground}"
|
|
DockPanel.Dock="Right"
|
|
Foreground="{TemplateBinding CaptionForeground}"
|
|
Template="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(h:Cattach.CaptionRightTemplate)}"
|
|
WindowChrome.IsHitTestVisibleInChrome="True" />
|
|
|
|
<Control Background="{TemplateBinding CaptionBackground}"
|
|
Foreground="{TemplateBinding CaptionForeground}"
|
|
Template="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(h:Cattach.CaptionCenterTemplate)}"
|
|
WindowChrome.IsHitTestVisibleInChrome="True" />
|
|
</DockPanel>
|
|
</Border>
|
|
|
|
<Border x:Name="BgInner"
|
|
Grid.Row="1"
|
|
Margin="0"
|
|
Background="{TemplateBinding Background}"
|
|
CornerRadius="{DynamicResource {x:Static h:CornerRadiusKeys.Bottom}}"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
|
|
<AdornerDecorator WindowChrome.IsHitTestVisibleInChrome="True">
|
|
<Grid>
|
|
<h:NotifyIcon x:Name="PART_NotifyIcon"
|
|
Command="{Binding Path=MinimizeWindowCommand, RelativeSource={RelativeSource TemplatedParent}}"
|
|
Icon="{Binding Path=NotifyIconSource, RelativeSource={RelativeSource TemplatedParent}}"
|
|
IconVisibility="Visible"
|
|
Text="{TemplateBinding Title}">
|
|
<FrameworkElement.ContextMenu>
|
|
<ContextMenu>
|
|
<MenuItem
|
|
Command="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=NotifyWindowCommand}"
|
|
CommandTarget="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}}"
|
|
Header="显示面板" />
|
|
|
|
<MenuItem
|
|
Command="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=NotifyWindowCommand}"
|
|
CommandTarget="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}}"
|
|
Header="隐藏" />
|
|
|
|
<MenuItem
|
|
Command="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=CloseWindowCommand}"
|
|
CommandTarget="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}}"
|
|
Header="退出" />
|
|
</ContextMenu>
|
|
</FrameworkElement.ContextMenu>
|
|
</h:NotifyIcon>
|
|
<Grid>
|
|
<h:DialogHost Margin="0"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
Effect="{TemplateBinding AdornerDecoratorEffect}"
|
|
Identifier="windowDialog">
|
|
<Grid>
|
|
<DockPanel>
|
|
<Control DockPanel.Dock="Left"
|
|
Template="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(h:Cattach.LeftTemplate)}" />
|
|
<Control DockPanel.Dock="Right"
|
|
Template="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(h:Cattach.RightTemplate)}" />
|
|
<Control DockPanel.Dock="Bottom"
|
|
Template="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(h:Cattach.BottomTemplate)}" />
|
|
<Control DockPanel.Dock="Top"
|
|
Template="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(h:Cattach.TopTemplate)}" />
|
|
<Grid>
|
|
<h:LinkActionFrame
|
|
LinkAction="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=CurrentLink}"
|
|
UseRandomWipe="False" />
|
|
<Control
|
|
Template="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(h:Cattach.CenterTemplate)}" />
|
|
</Grid>
|
|
</DockPanel>
|
|
|
|
<h:ContainPanel x:Name="PART_LAYERGROUP"
|
|
Background="{DynamicResource {x:Static h:BrushKeys.DialogCover}}"
|
|
ClipToBounds="True"
|
|
Visibility="Collapsed">
|
|
<h:ContainPanel.AnimationAction>
|
|
<h:ScaleTransition />
|
|
</h:ContainPanel.AnimationAction>
|
|
</h:ContainPanel>
|
|
</Grid>
|
|
</h:DialogHost>
|
|
|
|
<h:MessageContainer x:Name="PART_Message" Grid.Row="1" />
|
|
<h:Snackbar x:Name="PART_SnackBar"
|
|
MessageQueue="{h:MessageQueue}" />
|
|
</Grid>
|
|
</Grid>
|
|
</AdornerDecorator>
|
|
</Border>
|
|
</Grid>
|
|
</h:GuideHost>
|
|
</Grid>
|
|
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="WindowState" Value="Maximized">
|
|
<Setter TargetName="btnMax" Property="h:Cattach.Icon" Value="" />
|
|
<Setter TargetName="g_all" Property="Margin" Value="0" />
|
|
</Trigger>
|
|
<Trigger Property="WindowState" Value="Normal">
|
|
<Setter TargetName="btnMax" Property="h:Cattach.Icon" Value="" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</ResourceDictionary>
|
|
|
|
</h:ApplicationBase.Resources>
|
|
</h:ApplicationBase> |