316 lines
20 KiB
XML
316 lines
20 KiB
XML
<UserControl x:Class="GeekDesk.Control.UserControls.PannelCard.RightCardControl"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:temp="clr-namespace:GeekDesk.ViewModel.Temp"
|
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
|
xmlns:cvt="clr-namespace:GeekDesk.Converts"
|
|
xmlns:cst="clr-namespace:GeekDesk.Constant"
|
|
xmlns:DraggAnimatedPanel="clr-namespace:DraggAnimatedPanel"
|
|
xmlns:component="clr-namespace:GeekDesk.CustomComponent.VirtualizingWrapPanel"
|
|
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
|
|
xmlns:ot="clr-namespace:GeekDesk.Control.Other"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="450" d:DesignWidth="800"
|
|
AllowDrop="True"
|
|
>
|
|
<UserControl.Resources>
|
|
<!--右侧栏样式动画-->
|
|
<!--<Style x:Key="PanelStyle" TargetType="hc:SimpleStackPanel">
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="true">
|
|
<Setter Property="Cursor" Value="Hand"/>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>-->
|
|
<Style x:Key="ImageStyle" TargetType="Image">
|
|
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageWidth, Mode=OneWay}"/>
|
|
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageHeight, Mode=OneWay}"/>
|
|
<Setter Property="Source" Value="{Binding BitmapImage}"/>
|
|
</Style>
|
|
<Style x:Key="ImageStyleNoWrite" TargetType="Image">
|
|
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageWidth, Mode=OneWay}"/>
|
|
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageHeight, Mode=OneWay}"/>
|
|
<Setter Property="Source" Value="{Binding BitmapImage_NoWrite}"/>
|
|
</Style>
|
|
<Style x:Key="MyListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
|
|
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ListBoxItem}">
|
|
<Border>
|
|
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="SearchListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
|
|
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ListBoxItem}">
|
|
<Border>
|
|
<Border.Style>
|
|
<Style TargetType="Border">
|
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
</Style>
|
|
</Border.Style>
|
|
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="MyPoptipStyle" TargetType="Border">
|
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
<Setter Property="BorderThickness" Value="1"/>
|
|
<Setter Property="Background" Value="White"/>
|
|
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
|
<Setter Property="CornerRadius" Value="{StaticResource DefaultCornerRadius}"/>
|
|
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
|
|
<!--<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="hc:Poptip">
|
|
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
|
|
<ContentPresenter Margin="{TemplateBinding Padding}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>-->
|
|
</Style>
|
|
|
|
<Storyboard x:Key="Custom1Transition1" x:Shared="False">
|
|
<DoubleAnimation From="50" To="0" Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
|
|
<DoubleAnimation.EasingFunction>
|
|
<ElasticEase Oscillations="1"/>
|
|
</DoubleAnimation.EasingFunction>
|
|
</DoubleAnimation>
|
|
</Storyboard>
|
|
<Storyboard x:Key="Custom2Transition2" x:Shared="False">
|
|
<DoubleAnimation From="10" To="0" Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
|
|
<DoubleAnimation.EasingFunction>
|
|
<ElasticEase Oscillations="1"/>
|
|
</DoubleAnimation.EasingFunction>
|
|
</DoubleAnimation>
|
|
</Storyboard>
|
|
|
|
<Storyboard x:Key="Custom3Transition3" x:Shared="False">
|
|
<DoubleAnimation From=".8" To="1" Duration="0:0:0.4">
|
|
<DoubleAnimation.EasingFunction>
|
|
<ElasticEase Oscillations="1"/>
|
|
</DoubleAnimation.EasingFunction>
|
|
</DoubleAnimation>
|
|
</Storyboard>
|
|
|
|
<cvt:OpcityConvert x:Key="OpcityConvert"/>
|
|
<cvt:GetWidthByWWConvert x:Key="GetWidthByWWConvert"/>
|
|
<temp:SearchIconList x:Key="SearchIconList"/>
|
|
<cvt:Boolean2VisibilityConverter x:Key="MyBoolean2VisibilityConverter"/>
|
|
</UserControl.Resources>
|
|
<!--右侧栏-->
|
|
<Grid>
|
|
<Popup Name="MyPoptip" FlowDirection="LeftToRight"
|
|
PopupAnimation="None" Placement="Mouse"
|
|
IsOpen="False"
|
|
AllowsTransparency="True"
|
|
>
|
|
<Grid Background="Transparent">
|
|
<Border Style="{StaticResource MyPoptipStyle}">
|
|
<TextBlock Name="MyPoptipContent" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Left" Text="Test" FontSize="13"/>
|
|
</Border>
|
|
</Grid>
|
|
</Popup>
|
|
|
|
<hc:Card AllowDrop="True"
|
|
x:Name="WrapCard"
|
|
Visibility="Visible"
|
|
Drop="Wrap_Drop"
|
|
BorderThickness="1"
|
|
Effect="{DynamicResource EffectShadow2}"
|
|
Margin="5,0,5,5" Grid.ColumnSpan="2"
|
|
PreviewMouseRightButtonDown="WrapCard_PreviewMouseRightButtonDown"
|
|
hc:Dialog.Token="RightWrapCardDialog"
|
|
MouseWheel="IconListBox_MouseWheel"
|
|
>
|
|
<hc:Card.Background>
|
|
<SolidColorBrush Color="AliceBlue" hc:GeometryEffect.GeometryEffect="20" Opacity="{Binding AppConfig.CardOpacity, Mode=TwoWay, Converter={StaticResource OpcityConvert}}"/>
|
|
</hc:Card.Background>
|
|
<hc:Card.BorderBrush>
|
|
<SolidColorBrush Color="#FFFFFFFF" Opacity="0"/>
|
|
</hc:Card.BorderBrush>
|
|
<hc:Card.ContextMenu>
|
|
<ContextMenu Width="200">
|
|
<MenuItem Header="添加URL项目" Click="AddUrlIcon"/>
|
|
<MenuItem Header="添加系统项目" Click="AddSystemIcon"/>
|
|
<MenuItem x:Name="CardLockCM" Header="锁定主面板" Click="LockAppPanel"/>
|
|
<MenuItem x:Name="showTitle" Header="隐藏/显示标题" Click="ShowTitle_Click"/>
|
|
</ContextMenu>
|
|
</hc:Card.ContextMenu>
|
|
<hc:DialogContainer>
|
|
<Grid>
|
|
<ot:PasswordDialog xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndGrowHorizontally}, Event=Visibility, Duration=50, Delay=0}"
|
|
x:Name="PDDialog"
|
|
Visibility="Collapsed"
|
|
Panel.ZIndex="99"
|
|
IsVisibleChanged="PDDialog_IsVisibleChanged"
|
|
Margin="0,-100,0,0"/>
|
|
<StackPanel Panel.ZIndex="1" Margin="0,-10,-0,0"/>
|
|
|
|
<WrapPanel Orientation="Horizontal"
|
|
Margin="10"
|
|
>
|
|
<UniformGrid x:Name="WrapUFG" xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndGrowHorizontally}, Event=Visibility}">
|
|
<!--<hc:TransitioningContentControl TransitionStoryboard="{StaticResource Custom3Transition3}">-->
|
|
<ListBox x:Name="IconListBox"
|
|
ItemsSource="{Binding AppConfig.SelectedMenuIcons, Mode=OneWay}"
|
|
BorderThickness="0"
|
|
Padding="0,10,0,0"
|
|
ScrollViewer.CanContentScroll ="True"
|
|
VirtualizingPanel.VirtualizationMode="Recycling"
|
|
VirtualizingPanel.IsVirtualizing="True"
|
|
VirtualizingPanel.IsContainerVirtualizable="True"
|
|
VirtualizingPanel.ScrollUnit="Pixel"
|
|
>
|
|
<ListBox.Template>
|
|
<ControlTemplate TargetType="ListBox">
|
|
<hc:ScrollViewer x:Name="WrapScroll"
|
|
HorizontalScrollBarVisibility="Hidden"
|
|
VerticalScrollBarVisibility="Auto"
|
|
IsInertiaEnabled="True"
|
|
CanContentScroll="True"
|
|
PreviewMouseWheel="IconListBox_MouseWheel"
|
|
>
|
|
<Border BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="{TemplateBinding BorderBrush}"
|
|
|
|
>
|
|
<ItemsPresenter/>
|
|
</Border>
|
|
</hc:ScrollViewer>
|
|
</ControlTemplate>
|
|
</ListBox.Template>
|
|
<ListBox.Background>
|
|
<SolidColorBrush Color="#00FFFFFF" />
|
|
</ListBox.Background>
|
|
<ListBox.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<!--<DraggAnimatedPanel:DraggAnimatedPanel Background="#00FFFFFF"
|
|
ItemsWidth="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelWidth, Mode=OneWay}"
|
|
ItemsHeight="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelHeight, Mode=OneWay}"
|
|
HorizontalAlignment="Center"
|
|
SwapCommand="{Binding SwapCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>-->
|
|
|
|
<component:VirtualizingWrapPanel VirtualizationMode="Recycling"
|
|
IsVirtualizing="True"
|
|
IsContainerVirtualizable="True"
|
|
VirtualizingPanel.ScrollUnit="Pixel"
|
|
Width="{Binding AppConfig.WindowWidth, Mode=OneWay,
|
|
Converter={StaticResource GetWidthByWWConvert},
|
|
ConverterParameter={x:Static cst:WidthTypeEnum.RIGHT_CARD_70}}"
|
|
/>
|
|
</ItemsPanelTemplate>
|
|
</ListBox.ItemsPanel>
|
|
|
|
<ListBox.Resources>
|
|
<ContextMenu x:Key="IconDialog" Width="200">
|
|
<MenuItem Header="管理员方式运行" Click="IconAdminStart" Tag="{Binding}"/>
|
|
<MenuItem Header="打开文件所在位置" Click="ShowInExplore" Tag="{Binding}"/>
|
|
<MenuItem Header="添加URL项目" Click="AddUrlIcon"/>
|
|
<MenuItem Header="添加系统项目" Click="AddSystemIcon"/>
|
|
<MenuItem Header="资源管理器菜单" Click="SystemContextMenu" Tag="{Binding}"/>
|
|
<MenuItem Header="属性" Click="PropertyConfig" Tag="{Binding}"/>
|
|
<MenuItem Header="从列表移除" Click="RemoveIcon" Tag="{Binding}"/>
|
|
</ContextMenu>
|
|
</ListBox.Resources>
|
|
|
|
<ListBox.ItemContainerStyle>
|
|
<Style TargetType="ListBoxItem" BasedOn="{StaticResource MyListBoxItemStyle}">
|
|
<Setter Property="ContextMenu" Value="{StaticResource IconDialog}"/>
|
|
</Style>
|
|
</ListBox.ItemContainerStyle>
|
|
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
|
|
<hc:SimpleStackPanel Tag="{Binding}"
|
|
Height="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelHeight, Mode=OneWay}"
|
|
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelWidth, Mode=OneWay}"
|
|
HorizontalAlignment="Center"
|
|
Background="#00FFFFFF"
|
|
MouseEnter="MenuIcon_MouseEnter"
|
|
MouseLeave="MenuIcon_MouseLeave"
|
|
MouseMove="MenuIcon_MouseMove"
|
|
MouseLeftButtonDown="Icon_MouseLeftButtonDown"
|
|
MouseLeftButtonUp="Icon_MouseLeftButtonUp"
|
|
>
|
|
<CheckBox Margin="0,0,0,-20" HorizontalAlignment="Right"/>
|
|
<!--<StackPanel Background="#00FFFFFF"
|
|
MouseEnter="CursorPanel_MouseEnter"
|
|
MouseLeave="CursorPanel_MouseLeave"
|
|
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageWidth, Mode=OneWay}">-->
|
|
<Image Style="{StaticResource ImageStyle}"
|
|
RenderOptions.BitmapScalingMode="HighQuality"/>
|
|
<!--Width="{Binding AppConfig.WindowWidth, Mode=OneWay,
|
|
Converter={StaticResource GetWidthByWWConvert},
|
|
ConverterParameter={x:Static cst:WidthTypeEnum.RIGHT_CARD_70}}"-->
|
|
<TextBlock MaxWidth="80"
|
|
Margin="0,5,0,0"
|
|
MaxHeight="40"
|
|
FontSize="13"
|
|
TextWrapping="Wrap"
|
|
TextTrimming="WordEllipsis"
|
|
TextAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Foreground="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.TextColor}"
|
|
Visibility="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ShowIconTitle, Converter={StaticResource MyBoolean2VisibilityConverter}, ConverterParameter={x:Static Visibility.Collapsed}, Mode=TwoWay}"
|
|
Text="{Binding Name}"/>
|
|
<!--</StackPanel>-->
|
|
|
|
</hc:SimpleStackPanel>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
<!--</hc:TransitioningContentControl>-->
|
|
</UniformGrid>
|
|
</WrapPanel>
|
|
|
|
</Grid>
|
|
</hc:DialogContainer>
|
|
</hc:Card>
|
|
|
|
|
|
<hc:Card x:Name="VerticalCard"
|
|
Visibility="Collapsed"
|
|
BorderThickness="1"
|
|
Effect="{DynamicResource EffectShadow2}"
|
|
Margin="5,0,5,5" Grid.ColumnSpan="2"
|
|
MouseLeftButtonDown="VerticalCard_MouseLeftButtonDown"
|
|
>
|
|
<hc:Card.Background>
|
|
<SolidColorBrush Color="AliceBlue"
|
|
hc:GeometryEffect.GeometryEffect="20"
|
|
Opacity="{Binding AppConfig.CardOpacity, Mode=TwoWay, Converter={StaticResource OpcityConvert}}"/>
|
|
</hc:Card.Background>
|
|
<hc:Card.BorderBrush>
|
|
<SolidColorBrush Color="#FFFFFFFF" Opacity="0"/>
|
|
</hc:Card.BorderBrush>
|
|
</hc:Card>
|
|
<hc:LoadingCircle x:Name="Loading_RightCard"
|
|
Width="45" Height="45"
|
|
DotBorderBrush="White"
|
|
DotBorderThickness="2"
|
|
Foreground="DarkGray"
|
|
Opacity="0.8"
|
|
DotDiameter="10"
|
|
Margin="-50,-150,0,0"
|
|
Visibility="Collapsed"
|
|
/>
|
|
</Grid>
|
|
</UserControl>
|