|
@@ -3,7 +3,7 @@
|
|
|
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:local="clr-namespace:GeekDesk.Control.UserControls.PannelCard"
|
|
|
+ xmlns:temp="clr-namespace:GeekDesk.ViewModel.Temp"
|
|
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
|
|
xmlns:cvt="clr-namespace:GeekDesk.Converts"
|
|
|
xmlns:DraggAnimatedPanel="clr-namespace:DraggAnimatedPanel"
|
|
@@ -12,6 +12,14 @@
|
|
|
>
|
|
|
<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}"/>
|
|
@@ -31,100 +39,181 @@
|
|
|
</Style>
|
|
|
|
|
|
<cvt:OpcityConvert x:Key="OpcityConvert"/>
|
|
|
+ <cvt:SearchResWidth x:Key="SearchResWidth"/>
|
|
|
+ <temp:SearchIconList x:Key="SearchIconList"/>
|
|
|
</UserControl.Resources>
|
|
|
<!--右侧栏-->
|
|
|
- <hc:Card AllowDrop="True"
|
|
|
- Drop="Wrap_Drop"
|
|
|
- BorderThickness="1"
|
|
|
- Effect="{DynamicResource EffectShadow2}"
|
|
|
- Margin="5,0,5,5" Grid.ColumnSpan="2">
|
|
|
- <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"/>
|
|
|
- </ContextMenu>
|
|
|
- </hc:Card.ContextMenu>
|
|
|
- <WrapPanel Orientation="Horizontal" VirtualizingPanel.VirtualizationMode="Recycling"
|
|
|
+ <Grid>
|
|
|
+ <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">
|
|
|
+ <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"/>
|
|
|
+ </ContextMenu>
|
|
|
+ </hc:Card.ContextMenu>
|
|
|
+ <Grid>
|
|
|
+ <StackPanel Panel.ZIndex="1" Margin="0,-10,-300,0" hc:Growl.GrowlParent="True" hc:Growl.Token="MainWindowGrowl"/>
|
|
|
+ <WrapPanel Orientation="Horizontal" VirtualizingPanel.VirtualizationMode="Recycling"
|
|
|
VirtualizingPanel.IsVirtualizing="True"
|
|
|
VirtualizingPanel.IsContainerVirtualizable="True"
|
|
|
>
|
|
|
- <ListBox x:Name="IconListBox" ItemsSource="{Binding AppConfig.SelectedMenuIcons, Mode=TwoWay}"
|
|
|
+ <ListBox x:Name="IconListBox" ItemsSource="{Binding AppConfig.SelectedMenuIcons, Mode=TwoWay}"
|
|
|
BorderThickness="0"
|
|
|
Padding="0,10,0,0"
|
|
|
>
|
|
|
- <ListBox.Background>
|
|
|
- <SolidColorBrush Opacity="0"/>
|
|
|
- </ListBox.Background>
|
|
|
- <ListBox.ItemsPanel>
|
|
|
- <ItemsPanelTemplate>
|
|
|
- <DraggAnimatedPanel:DraggAnimatedPanel Background="#00FFFFFF"
|
|
|
+ <ListBox.Background>
|
|
|
+ <SolidColorBrush Opacity="0"/>
|
|
|
+ </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}}}"/>
|
|
|
- </ItemsPanelTemplate>
|
|
|
- </ListBox.ItemsPanel>
|
|
|
+ </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"
|
|
|
+ hc:Poptip.Content="{Binding Content}"
|
|
|
+ hc:Poptip.Placement="BottomLeft"
|
|
|
+ Background="#00FFFFFF"
|
|
|
+ MouseEnter="StackPanel_MouseEnter"
|
|
|
+ MouseLeave="StackPanel_MouseLeave"
|
|
|
+ >
|
|
|
+ <Image Style="{StaticResource ImageStyle}" RenderOptions.BitmapScalingMode="HighQuality"/>
|
|
|
+ <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}"
|
|
|
+ Text="{Binding Name}"/>
|
|
|
+ </hc:SimpleStackPanel>
|
|
|
+ </DataTemplate>
|
|
|
+ </ListBox.ItemTemplate>
|
|
|
+ </ListBox>
|
|
|
+
|
|
|
+ </WrapPanel>
|
|
|
+
|
|
|
+ </Grid>
|
|
|
+ </hc:Card>
|
|
|
+
|
|
|
+ <hc:Card
|
|
|
+ x:Name="VerticalCard"
|
|
|
+ Visibility="Hidden"
|
|
|
+ BorderThickness="1"
|
|
|
+ Effect="{DynamicResource EffectShadow2}"
|
|
|
+ Margin="5,0,5,5" Grid.ColumnSpan="2">
|
|
|
+ <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>
|
|
|
+ <Grid>
|
|
|
+ <StackPanel Panel.ZIndex="1" Margin="0,-10,-300,0" hc:Growl.GrowlParent="True" hc:Growl.Token="MainWindowGrowl"/>
|
|
|
+ <WrapPanel Orientation="Horizontal" VirtualizingPanel.VirtualizationMode="Recycling"
|
|
|
+ VirtualizingPanel.IsVirtualizing="True"
|
|
|
+ VirtualizingPanel.IsContainerVirtualizable="True"
|
|
|
+ >
|
|
|
+ <ListBox ItemsSource="{Binding Source={StaticResource SearchIconList},Path=IconList}"
|
|
|
+ BorderThickness="0"
|
|
|
+ Padding="0,10,0,0"
|
|
|
+ >
|
|
|
+ <ListBox.Background>
|
|
|
+ <SolidColorBrush Opacity="0"/>
|
|
|
+ </ListBox.Background>
|
|
|
+
|
|
|
+ <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}"/>
|
|
|
+ </ContextMenu>
|
|
|
+ </ListBox.Resources>
|
|
|
|
|
|
- <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.ItemContainerStyle>
|
|
|
- <Style TargetType="ListBoxItem" BasedOn="{StaticResource MyListBoxItemStyle}">
|
|
|
- <Setter Property="ContextMenu" Value="{StaticResource IconDialog}"/>
|
|
|
- <!--<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelWidth, Mode=OneWay}"/>
|
|
|
- <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelHeight, Mode=OneWay}"/>-->
|
|
|
- </Style>
|
|
|
- </ListBox.ItemContainerStyle>
|
|
|
- <!--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}"-->
|
|
|
+ <ListBox.ItemTemplate>
|
|
|
+ <DataTemplate>
|
|
|
+ <WrapPanel Tag="{Binding}"
|
|
|
+ Height="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageHeight, Mode=OneWay}"
|
|
|
+ Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.MenuCardWidth, Mode=OneWay, Converter={StaticResource SearchResWidth}}"
|
|
|
+ HorizontalAlignment="Left"
|
|
|
+ hc:Poptip.HitMode="None"
|
|
|
+ hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}"
|
|
|
+ hc:Poptip.Content="{Binding Content}"
|
|
|
+ hc:Poptip.Placement="BottomLeft"
|
|
|
+ Background="#00FFFFFF"
|
|
|
+ MouseLeftButtonDown="Icon_MouseLeftButtonDown"
|
|
|
+ MouseLeftButtonUp="Icon_MouseLeftButtonUp"
|
|
|
+ Margin="25,20,0,0"
|
|
|
+ >
|
|
|
+ <Image Style="{StaticResource ImageStyle}" RenderOptions.BitmapScalingMode="HighQuality"/>
|
|
|
+ <TextBlock
|
|
|
+ Margin="10,5,0,0"
|
|
|
+ MaxHeight="40"
|
|
|
+ FontSize="13"
|
|
|
+ TextWrapping="Wrap"
|
|
|
+ TextTrimming="WordEllipsis"
|
|
|
+ TextAlignment="Left"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ Foreground="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.TextColor}"
|
|
|
+ Text="{Binding Name}"/>
|
|
|
+ </WrapPanel>
|
|
|
+ </DataTemplate>
|
|
|
+ </ListBox.ItemTemplate>
|
|
|
+ </ListBox>
|
|
|
|
|
|
- <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"
|
|
|
- hc:Poptip.HitMode="None"
|
|
|
- hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}"
|
|
|
- hc:Poptip.Content="{Binding Content}"
|
|
|
- hc:Poptip.Placement="BottomLeft"
|
|
|
- Background="#00FFFFFF"
|
|
|
- MouseLeftButtonDown="Icon_MouseLeftButtonDown"
|
|
|
- MouseLeftButtonUp="Icon_MouseLeftButtonUp"
|
|
|
- MouseEnter="StackPanel_MouseEnter"
|
|
|
- MouseLeave="StackPanel_MouseLeave"
|
|
|
- >
|
|
|
- <Image Style="{StaticResource ImageStyle}" RenderOptions.BitmapScalingMode="HighQuality"/>
|
|
|
- <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}"
|
|
|
- Text="{Binding Name}"/>
|
|
|
- </hc:SimpleStackPanel>
|
|
|
- </DataTemplate>
|
|
|
- </ListBox.ItemTemplate>
|
|
|
- </ListBox>
|
|
|
+ </WrapPanel>
|
|
|
|
|
|
- </WrapPanel>
|
|
|
- </hc:Card>
|
|
|
+ </Grid>
|
|
|
+ </hc:Card>
|
|
|
+ </Grid>
|
|
|
</UserControl>
|