周五喽
This commit is contained in:
@@ -12,7 +12,8 @@
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent"
|
||||
>
|
||||
<Border CornerRadius="8" BorderThickness="0">
|
||||
|
||||
<Border CornerRadius="8" BorderThickness="0">
|
||||
<Border.Background>
|
||||
<SolidColorBrush Color="AliceBlue" Opacity="0.9"/>
|
||||
</Border.Background>
|
||||
@@ -56,13 +57,13 @@
|
||||
</hc:SideMenuItem>
|
||||
</hc:SideMenu>
|
||||
</hc:Card>
|
||||
<hc:Card x:Name="RightCard" Grid.Row="0" Grid.Column="1" MouseDown="DragMove">
|
||||
</hc:Card>
|
||||
<Button Width="22" Height="22" Click="Close_Button_Click" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,10,0" Grid.Column="1"/>
|
||||
</Grid>
|
||||
<hc:ScrollViewer Grid.Row="0" Grid.Column="1">
|
||||
<hc:Card x:Name="RightCard" Height="600" MouseDown="DragMove">
|
||||
</hc:Card>
|
||||
</hc:ScrollViewer>
|
||||
|
||||
<Button Width="22" Height="22" Click="Close_Button_Click" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,10,0" Grid.Column="1"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
|
||||
|
||||
|
||||
</hc:Window>
|
||||
138
Control/UserControls/LeftCardControl.xaml
Normal file
138
Control/UserControls/LeftCardControl.xaml
Normal file
@@ -0,0 +1,138 @@
|
||||
<UserControl x:Class="GeekDesk.Control.UserControls.LeftCardControl"
|
||||
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:local="clr-namespace:GeekDesk.Control.UserControls"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:cvt="clr-namespace:GeekDesk.Converts"
|
||||
xmlns:DraggAnimatedPanel="clr-namespace:DraggAnimatedPanel"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<UserControl.Resources>
|
||||
|
||||
<!--左侧栏样式动画-->
|
||||
<Style x:Key="menuStyle" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItemBaseStyle}">
|
||||
<Setter Property="FontSize" Value="15"/>
|
||||
<Setter Property="Margin" Value="0,0,0,1"/>
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
<Style.Triggers>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsMouseOver" Value="False"/>
|
||||
<Condition Property="IsSelected" Value="False"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<MultiTrigger.EnterActions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation To="15" Duration="0:0:0.5" Storyboard.TargetProperty="FontSize"/>
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</MultiTrigger.EnterActions>
|
||||
<MultiTrigger.ExitActions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard Timeline.DesiredFrameRate="60">
|
||||
<DoubleAnimation To="18" Duration="0:0:0.001" Storyboard.TargetProperty="FontSize"/>
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</MultiTrigger.ExitActions>
|
||||
</MultiTrigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="#FFE4DBDB"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="true">
|
||||
<Setter Property="Background" Value="#FFECECEC"/>
|
||||
<Setter Property="Foreground" Value="Black"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<cvt:MenuWidthConvert x:Key="MenuWidthConvert"/>
|
||||
<cvt:OpcityConvert x:Key="OpcityConvert"/>
|
||||
</UserControl.Resources>
|
||||
<!--左侧栏-->
|
||||
<hc:Card
|
||||
BorderThickness="1"
|
||||
Effect="{DynamicResource EffectShadow2}"
|
||||
Margin="5,0,0,5"
|
||||
>
|
||||
<hc:Card.Background>
|
||||
<SolidColorBrush Color="#FFFFFFFF" 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="新建菜单" Click="CreateMenu"/>
|
||||
</ContextMenu>
|
||||
</hc:Card.ContextMenu>
|
||||
<WrapPanel Orientation="Horizontal">
|
||||
<ListBox x:Name="menus"
|
||||
ItemsSource="{Binding MenuList}"
|
||||
Tag="{Binding AppConfig.MenuCardWidth}"
|
||||
BorderThickness="0" Foreground="{x:Null}"
|
||||
SelectedIndex="{Binding AppConfig.SelectedMenuIndex}"
|
||||
VirtualizingPanel.VirtualizationMode="Recycling"
|
||||
>
|
||||
<ListBox.Resources>
|
||||
<ContextMenu x:Key="menuDialog" Width="200">
|
||||
<MenuItem Header="新建菜单" Click="CreateMenu"/>
|
||||
<MenuItem Header="重命名" Click="RenameMenu" Tag="{Binding}"/>
|
||||
<MenuItem Header="删除" Click="DeleteMenu" Tag="{Binding}"/>
|
||||
</ContextMenu>
|
||||
</ListBox.Resources>
|
||||
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem" BasedOn="{StaticResource menuStyle}">
|
||||
<Setter Property="ContextMenu" Value="{StaticResource menuDialog}"/>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.Background>
|
||||
<SolidColorBrush Color="AliceBlue" Opacity="0"/>
|
||||
</ListBox.Background>
|
||||
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<DraggAnimatedPanel:DraggAnimatedPanel ItemsHeight="30" ItemsWidth="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1},Path=Tag, Mode=TwoWay, Converter={StaticResource MenuWidthConvert}}" HorizontalAlignment="Center" VerticalAlignment="Top" SwapCommand="{Binding SwapCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel MouseLeftButtonDown="MenuClick" Tag="{Binding}">
|
||||
<TextBox Text="{Binding Path=MenuName, Mode=TwoWay}"
|
||||
HorizontalAlignment="Left"
|
||||
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1},Path=Tag, Mode=TwoWay, Converter={StaticResource MenuWidthConvert}}"
|
||||
FontSize="15"
|
||||
TextAlignment="Left"
|
||||
LostFocus="LostFocusOrEnterDown"
|
||||
KeyDown="LostFocusOrEnterDown"
|
||||
Tag="{Binding}"
|
||||
IsVisibleChanged="MenuEditWhenVisibilityChanged"
|
||||
Visibility="{Binding MenuEdit}"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Background="Transparent"
|
||||
BorderThickness="0"
|
||||
hc:IconElement.Geometry="M438.857143 548.571429a36.571429 36.571429 0 0 1 36.571428 36.571428v256a36.571429 36.571429 0 0 1-36.571428 36.571429H182.857143a36.571429 36.571429 0 0 1-36.571429-36.571429v-256a36.571429 36.571429 0 0 1 36.571429-36.571428h256z m402.285714 0a36.571429 36.571429 0 0 1 36.571429 36.571428v256a36.571429 36.571429 0 0 1-36.571429 36.571429h-256a36.571429 36.571429 0 0 1-36.571428-36.571429v-256a36.571429 36.571429 0 0 1 36.571428-36.571428h256z m-438.857143 73.142857H219.428571v182.857143h182.857143v-182.857143z m402.285715 0h-182.857143v182.857143h182.857143v-182.857143zM438.857143 146.285714a36.571429 36.571429 0 0 1 36.571428 36.571429v256a36.571429 36.571429 0 0 1-36.571428 36.571428H182.857143a36.571429 36.571429 0 0 1-36.571429-36.571428V182.857143a36.571429 36.571429 0 0 1 36.571429-36.571429h256z m402.285714 0a36.571429 36.571429 0 0 1 36.571429 36.571429v256a36.571429 36.571429 0 0 1-36.571429 36.571428h-256a36.571429 36.571429 0 0 1-36.571428-36.571428V182.857143a36.571429 36.571429 0 0 1 36.571428-36.571429h256zM402.285714 219.428571H219.428571v182.857143h182.857143V219.428571z m402.285715 0h-182.857143v182.857143h182.857143V219.428571z"
|
||||
hc:IconElement.Height="18"
|
||||
hc:IconElement.Width="18"
|
||||
/>
|
||||
<TextBlock Text="{Binding MenuName}"
|
||||
VerticalAlignment="Center"
|
||||
IsVisibleChanged="MenuWhenVisibilityChanged"
|
||||
Visibility="{Binding NotMenuEdit}"
|
||||
/>
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</WrapPanel>
|
||||
</hc:Card>
|
||||
</UserControl>
|
||||
176
Control/UserControls/LeftCardControl.xaml.cs
Normal file
176
Control/UserControls/LeftCardControl.xaml.cs
Normal file
@@ -0,0 +1,176 @@
|
||||
using DraggAnimatedPanelExample;
|
||||
using GeekDesk.Util;
|
||||
using GeekDesk.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace GeekDesk.Control.UserControls
|
||||
{
|
||||
/// <summary>
|
||||
/// LeftCardControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class LeftCardControl : UserControl
|
||||
{
|
||||
private int menuSelectIndexTemp = -1;
|
||||
private AppData appData = MainWindow.appData;
|
||||
|
||||
public LeftCardControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
appData.AppConfig.SelectedMenuIcons = appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList;
|
||||
}
|
||||
|
||||
DelegateCommand<int[]> _swap;
|
||||
|
||||
public DelegateCommand<int[]> SwapCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_swap == null)
|
||||
_swap = new DelegateCommand<int[]>(
|
||||
(indexes) =>
|
||||
{
|
||||
int fromS = indexes[0];
|
||||
int to = indexes[1];
|
||||
ObservableCollection<MenuInfo> menuList = MainWindow.appData.MenuList;
|
||||
var elementSource = menuList[to];
|
||||
var dragged = menuList[fromS];
|
||||
menuList.Remove(dragged);
|
||||
menuList.Insert(to, dragged);
|
||||
menus.SelectedIndex = to;
|
||||
MainWindow.appData.MenuList = menuList;
|
||||
}
|
||||
);
|
||||
return _swap;
|
||||
}
|
||||
}
|
||||
|
||||
////菜单点击事件
|
||||
private void MenuClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
//设置对应菜单的图标列表
|
||||
MenuInfo mi = (MenuInfo)(((StackPanel)sender).Tag);
|
||||
appData.AppConfig.SelectedMenuIcons = mi.IconList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当修改菜单元素可见时 设置原菜单为不可见 并且不可选中
|
||||
/// 修改菜单元素不可见时 原菜单可见 并 选中
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void MenuWhenVisibilityChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
TextBlock tb = sender as TextBlock;
|
||||
if (tb.Visibility == Visibility.Collapsed)
|
||||
{
|
||||
if (menus.SelectedIndex != -1)
|
||||
{
|
||||
menuSelectIndexTemp = menus.SelectedIndex;
|
||||
menus.SelectedIndex = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
menus.SelectedIndex = menuSelectIndexTemp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新建菜单
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void CreateMenu(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MenuInfo info = new MenuInfo() { MenuEdit = Visibility.Collapsed, MenuId = System.Guid.NewGuid().ToString(), MenuName = "NewMenu" };
|
||||
appData.MenuList.Add(info);
|
||||
menus.Items.Refresh();
|
||||
menus.SelectedIndex = appData.MenuList.Count - 1;
|
||||
appData.AppConfig.SelectedMenuIndex = menus.SelectedIndex;
|
||||
appData.AppConfig.SelectedMenuIcons = info.IconList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重命名菜单 将textbox 设置为可见
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void RenameMenu(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
|
||||
menuInfo.MenuEdit = (int)Visibility.Visible;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除菜单
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void DeleteMenu(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
|
||||
appData.MenuList.Remove(menuInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑菜单失焦或者敲下Enter键时保存修改后的菜单
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void LostFocusOrEnterDown(object sender, EventArgs e)
|
||||
{
|
||||
TextBox menuBox = null;
|
||||
if (e.GetType() == typeof(KeyEventArgs))
|
||||
{
|
||||
KeyEventArgs eKey = e as KeyEventArgs;
|
||||
if (eKey.Key == Key.Enter)
|
||||
{
|
||||
menuBox = ((TextBox)sender);
|
||||
}
|
||||
}
|
||||
else if (e.GetType() == typeof(RoutedEventArgs))
|
||||
{
|
||||
menuBox = ((TextBox)sender);
|
||||
}
|
||||
|
||||
if (menuBox != null)
|
||||
{
|
||||
MenuInfo menuInfo = menuBox.Tag as MenuInfo;
|
||||
string text = menuBox.Text;
|
||||
menuInfo.MenuName = text;
|
||||
menuInfo.MenuEdit = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当修改菜单元素可见时 设置全选并获得焦点
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void MenuEditWhenVisibilityChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
TextBox box = sender as TextBox;
|
||||
if (box.Visibility == Visibility.Visible)
|
||||
{
|
||||
Keyboard.Focus(box);
|
||||
box.SelectAll();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
117
Control/UserControls/RightCardControl.xaml
Normal file
117
Control/UserControls/RightCardControl.xaml
Normal file
@@ -0,0 +1,117 @@
|
||||
<UserControl x:Class="GeekDesk.Control.UserControls.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:local="clr-namespace:GeekDesk.Control.UserControls"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:cvt="clr-namespace:GeekDesk.Converts"
|
||||
xmlns:DraggAnimatedPanel="clr-namespace:DraggAnimatedPanel"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<UserControl.Resources>
|
||||
<!--右侧栏样式动画-->
|
||||
<Style x:Key="imageStyle" TargetType="Image">
|
||||
<Setter Property="Width" Value="{Binding ImageWidth}"/>
|
||||
<Setter Property="Height" Value="{Binding ImageHeight}"/>
|
||||
<Setter Property="Source" Value="{Binding BitmapImage}"/>
|
||||
<Style.Triggers>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsMouseOver" Value="True"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<MultiTrigger.EnterActions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation To="80" Duration="0:0:0.001" Storyboard.TargetProperty="Width"/>
|
||||
<DoubleAnimation To="80" Duration="0:0:0.001" Storyboard.TargetProperty="Height"/>
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</MultiTrigger.EnterActions>
|
||||
<MultiTrigger.ExitActions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation To="60" Duration="0:0:0.5" Storyboard.TargetProperty="Width"/>
|
||||
<DoubleAnimation To="60" Duration="0:0:0.5" Storyboard.TargetProperty="Height"/>
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</MultiTrigger.ExitActions>
|
||||
</MultiTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<cvt:MenuWidthConvert x:Key="MenuWidthConvert"/>
|
||||
<cvt:OpcityConvert x:Key="OpcityConvert"/>
|
||||
</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="#FFFFFFFF" Opacity="{Binding AppConfig.CardOpacity, Mode=TwoWay, Converter={StaticResource OpcityConvert}}"/>
|
||||
</hc:Card.Background>
|
||||
<hc:Card.BorderBrush>
|
||||
<SolidColorBrush Color="#FFFFFFFF" Opacity="0"/>
|
||||
</hc:Card.BorderBrush>
|
||||
<WrapPanel Orientation="Horizontal">
|
||||
<ListBox x:Name="icons" ItemsSource="{Binding AppConfig.SelectedMenuIcons, Mode=TwoWay}"
|
||||
BorderThickness="0"
|
||||
SelectionChanged="IconSelectionChanged "
|
||||
VirtualizingPanel.VirtualizationMode="Recycling"
|
||||
>
|
||||
<ListBox.Background>
|
||||
<SolidColorBrush Opacity="0"/>
|
||||
</ListBox.Background>
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<DraggAnimatedPanel:DraggAnimatedPanel ItemsHeight="115" ItemsWidth="100" HorizontalAlignment="Center" SwapCommand="{Binding SwapCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
|
||||
</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="资源管理器菜单" Click="MenuItem_Click" Tag="{Binding}"/>
|
||||
<MenuItem Header="属性" Click="PropertyConfig" Tag="{Binding}"/>
|
||||
<MenuItem Header="从列表移除" Click="RemoveIcon" Tag="{Binding}"/>
|
||||
</ContextMenu>
|
||||
</ListBox.Resources>
|
||||
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="ContextMenu" Value="{StaticResource iconDialog}"/>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Tag="{Binding}"
|
||||
MouseLeftButtonUp="IconClick"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="5,5,5,5"
|
||||
hc:Poptip.HitMode="None"
|
||||
hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}"
|
||||
hc:Poptip.Content="{Binding Content}"
|
||||
hc:Poptip.Placement="BottomLeft"
|
||||
>
|
||||
<Image Style="{StaticResource imageStyle}" />
|
||||
<TextBlock MaxWidth="80"
|
||||
MaxHeight="40"
|
||||
TextWrapping="Wrap"
|
||||
TextTrimming="WordEllipsis"
|
||||
TextAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Name}"/>
|
||||
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</WrapPanel>
|
||||
</hc:Card>
|
||||
</UserControl>
|
||||
214
Control/UserControls/RightCardControl.xaml.cs
Normal file
214
Control/UserControls/RightCardControl.xaml.cs
Normal file
@@ -0,0 +1,214 @@
|
||||
using DraggAnimatedPanelExample;
|
||||
using GeekDesk.Constant;
|
||||
using GeekDesk.Util;
|
||||
using GeekDesk.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace GeekDesk.Control.UserControls
|
||||
{
|
||||
/// <summary>
|
||||
/// RightCardControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class RightCardControl : UserControl
|
||||
{
|
||||
private AppData appData = MainWindow.appData;
|
||||
public RightCardControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
|
||||
#region 图标拖动
|
||||
DelegateCommand<int[]> _swap;
|
||||
public DelegateCommand<int[]> SwapCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_swap == null)
|
||||
_swap = new DelegateCommand<int[]>(
|
||||
(indexes) =>
|
||||
{
|
||||
int fromS = indexes[0];
|
||||
int to = indexes[1];
|
||||
ObservableCollection<IconInfo> iconList = appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList;
|
||||
var elementSource = iconList[to];
|
||||
var dragged = iconList[fromS];
|
||||
|
||||
iconList.Remove(dragged);
|
||||
iconList.Insert(to, dragged);
|
||||
}
|
||||
);
|
||||
return _swap;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion 图标拖动
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 图标点击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void IconClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
IconInfo icon = (IconInfo)((StackPanel)sender).Tag;
|
||||
if (icon.AdminStartUp)
|
||||
{
|
||||
StartIconApp(icon, IconStartType.ADMIN_STARTUP);
|
||||
}
|
||||
else
|
||||
{
|
||||
StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 管理员方式启动
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void IconAdminStart(object sender, RoutedEventArgs e)
|
||||
{
|
||||
IconInfo icon = (IconInfo)((MenuItem)sender).Tag;
|
||||
StartIconApp(icon, IconStartType.ADMIN_STARTUP);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 打开文件所在位置
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void ShowInExplore(object sender, RoutedEventArgs e)
|
||||
{
|
||||
IconInfo icon = (IconInfo)((MenuItem)sender).Tag;
|
||||
StartIconApp(icon, IconStartType.SHOW_IN_EXPLORE);
|
||||
}
|
||||
|
||||
private void StartIconApp(IconInfo icon, IconStartType type)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
if (!File.Exists(icon.Path) && !Directory.Exists(icon.Path))
|
||||
{
|
||||
HandyControl.Controls.Growl.WarningGlobal("程序启动失败(文件路径不存在或已删除)!");
|
||||
return;
|
||||
}
|
||||
|
||||
Process p = new Process();
|
||||
p.StartInfo.FileName = icon.Path;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case IconStartType.ADMIN_STARTUP:
|
||||
p.StartInfo.Arguments = "1";//启动参数
|
||||
p.StartInfo.Verb = "runas";
|
||||
p.StartInfo.CreateNoWindow = false; //设置显示窗口
|
||||
p.StartInfo.UseShellExecute = false;//不使用操作系统外壳程序启动进程
|
||||
p.StartInfo.ErrorDialog = false;
|
||||
if (appData.AppConfig.AppHideType == AppHideType.START_EXE)
|
||||
{
|
||||
this.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
break;// c#好像不能case穿透
|
||||
case IconStartType.DEFAULT_STARTUP:
|
||||
if (appData.AppConfig.AppHideType == AppHideType.START_EXE)
|
||||
{
|
||||
this.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
break;
|
||||
case IconStartType.SHOW_IN_EXPLORE:
|
||||
p.StartInfo.FileName = "Explorer.exe";
|
||||
p.StartInfo.Arguments = "/e,/select," + icon.Path;
|
||||
break;
|
||||
}
|
||||
p.Start();
|
||||
icon.Count++;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
HandyControl.Controls.Growl.WarningGlobal("程序启动失败(不支持的启动方式)!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// data选中事件 设置不可选中
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void IconSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (icons.SelectedIndex != -1) icons.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
|
||||
private void Wrap_Drop(object sender, DragEventArgs e)
|
||||
{
|
||||
Array dropObject = (System.Array)e.Data.GetData(DataFormats.FileDrop);
|
||||
if (dropObject == null) return;
|
||||
foreach (object obj in dropObject)
|
||||
{
|
||||
string path = (string)obj;
|
||||
|
||||
//string base64 = ImageUtil.FileImageToBase64(path, ImageFormat.Jpeg);
|
||||
|
||||
IconInfo iconInfo = new IconInfo
|
||||
{
|
||||
Path = path,
|
||||
BitmapImage = ImageUtil.GetBitmapIconByPath(path)
|
||||
};
|
||||
iconInfo.DefaultImage = iconInfo.ImageByteArr;
|
||||
iconInfo.Name = System.IO.Path.GetFileNameWithoutExtension(path);
|
||||
MainWindow.appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList.Add(iconInfo);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从列表删除图标
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void RemoveIcon(object sender, RoutedEventArgs e)
|
||||
{
|
||||
appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList.Remove((IconInfo)((MenuItem)sender).Tag);
|
||||
}
|
||||
|
||||
private void MenuItem_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
IconInfo icon = (IconInfo)((MenuItem)sender).Tag;
|
||||
System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("Explorer.exe");
|
||||
psi.Arguments = "/e,/select," + icon.Path;
|
||||
System.Diagnostics.Process.Start(psi);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 弹出Icon属性修改面板
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void PropertyConfig(object sender, RoutedEventArgs e)
|
||||
{
|
||||
HandyControl.Controls.Dialog.Show(new IconInfoDialog((IconInfo)((MenuItem)sender).Tag));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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:util="clr-namespace:GeekDesk.Util"
|
||||
xmlns:cvt="clr-namespace:GeekDesk.Converts"
|
||||
xmlns:local="clr-namespace:GeekDesk.Control.UserControls"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
mc:Ignorable="d"
|
||||
@@ -11,61 +11,124 @@
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
|
||||
<UserControl.Resources>
|
||||
<util:HideTypeConvert x:Key="HideTypeConvert"/>
|
||||
<cvt:HideTypeConvert x:Key="HideTypeConvert"/>
|
||||
</UserControl.Resources>
|
||||
<hc:SimplePanel Margin="10">
|
||||
<hc:SimplePanel.Background>
|
||||
<SolidColorBrush Opacity="0.9"/>
|
||||
</hc:SimplePanel.Background>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="0,0,0,10" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="主面板设置" VerticalAlignment="Center"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:Divider LineStrokeDashArray="3,3" Margin="30,22,450,119" LineStroke="Black" Grid.ColumnSpan="4"/>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="30,26.394,0,-16.394" Grid.ColumnSpan="4">
|
||||
<CheckBox x:Name="IconIsAdmin" Content="启动时显示主面板" IsChecked="{Binding StartedShowPanel}">
|
||||
<CheckBox.Background>
|
||||
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
||||
<GradientStop Color="#FF9EA3A6"/>
|
||||
</LinearGradientBrush>
|
||||
</CheckBox.Background>
|
||||
</CheckBox>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:SimplePanel Margin="10">
|
||||
<hc:SimplePanel.Background>
|
||||
<SolidColorBrush Opacity="0.9"/>
|
||||
</hc:SimplePanel.Background>
|
||||
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="30,50,0,-102.337" Grid.ColumnSpan="4">
|
||||
<CheckBox Content="显示时追随鼠标位置" IsChecked="{Binding FollowMouse}" Unchecked="CheckBox_Unchecked">
|
||||
<CheckBox.Background>
|
||||
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
||||
<GradientStop Color="#FF9EA3A6"/>
|
||||
</LinearGradientBrush>
|
||||
</CheckBox.Background>
|
||||
</CheckBox>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="30,89.49,-30,-79.49" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="面板关闭方式" VerticalAlignment="Center"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:Divider LineStrokeDashArray="3,3" Margin="30,109,450,26.208" LineStroke="Black" Grid.ColumnSpan="4"/>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="40,115,-10,-102.337" Grid.ColumnSpan="4">
|
||||
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="0,0,0,10" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="主面板设置" VerticalAlignment="Center"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:Divider LineStrokeDashArray="3,3" Margin="30,22,450,119" LineStroke="Black" Grid.ColumnSpan="4"/>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="30,26.394,0,-16.394" Grid.ColumnSpan="4">
|
||||
<CheckBox x:Name="IconIsAdmin" Content="启动时显示主面板" IsChecked="{Binding StartedShowPanel}">
|
||||
<CheckBox.Background>
|
||||
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
||||
<GradientStop Color="#FF9EA3A6"/>
|
||||
</LinearGradientBrush>
|
||||
</CheckBox.Background>
|
||||
</CheckBox>
|
||||
</hc:UniformSpacingPanel>
|
||||
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="30,50,0,-102.337" Grid.ColumnSpan="4">
|
||||
<CheckBox Content="显示时追随鼠标位置" IsChecked="{Binding FollowMouse}" Unchecked="CheckBox_Unchecked">
|
||||
<CheckBox.Background>
|
||||
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
||||
<GradientStop Color="#FF9EA3A6"/>
|
||||
</LinearGradientBrush>
|
||||
</CheckBox.Background>
|
||||
</CheckBox>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="30,89.49,-30,-79.49" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="面板关闭方式" VerticalAlignment="Center"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:Divider LineStrokeDashArray="3,3" Margin="30,109,450,26.208" LineStroke="Black" Grid.ColumnSpan="4"/>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="40,115,-10,-102.337" Grid.ColumnSpan="4">
|
||||
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
|
||||
Style="{StaticResource RadioButtonIcon}" Content="失去焦点后"
|
||||
IsChecked="{Binding AppHideType, Mode=TwoWay, Converter={StaticResource HideTypeConvert}, ConverterParameter=1}"/>
|
||||
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
|
||||
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
|
||||
Style="{StaticResource RadioButtonIcon}" Content="运行项目后"
|
||||
IsChecked="{Binding AppHideType, Mode=TwoWay, Converter={StaticResource HideTypeConvert}, ConverterParameter=2}"/>
|
||||
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
|
||||
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
|
||||
Style="{StaticResource RadioButtonIcon}" Content="手动关闭"
|
||||
IsChecked="{Binding AppHideType, Mode=TwoWay, Converter={StaticResource HideTypeConvert}, ConverterParameter=3}"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="30,160.5,-30,-150.5" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="背景图片" VerticalAlignment="Center"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="40,199.5,-40,-189.5" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="图片路径:" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding BacImgName}" Width="200" VerticalAlignment="Center"/>
|
||||
<Button Content="修改" Click="BGButton_Click"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:Divider LineStrokeDashArray="3,3" Margin="30,22,450,119" LineStroke="Black" Grid.ColumnSpan="4"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="30,160.5,-30,-150.5" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="背景图片" VerticalAlignment="Center"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="40,183,-40,-173" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="图片路径:" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding BacImgName}" Width="200"
|
||||
VerticalAlignment="Center"
|
||||
hc:Poptip.HitMode="None"
|
||||
hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}"
|
||||
hc:Poptip.Content="{Binding BacImgName}"
|
||||
hc:Poptip.Placement="TopLeft"
|
||||
/>
|
||||
<Button Content="修改" Click="BGButton_Click"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:Divider LineStrokeDashArray="3,3" Margin="30,22,450,119" LineStroke="Black" Grid.ColumnSpan="4"/>
|
||||
|
||||
<!--<hc:Divider LineStrokeDashArray="3,3" Margin="10,242.735,-10,-91.735" LineStroke="Black" Grid.ColumnSpan="4"/>-->
|
||||
<hc:Divider LineStrokeDashArray="3,3" Margin="10,217.235,-10,-66.235" LineStroke="Black" Grid.ColumnSpan="4"/>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="30,240,-30,-230" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="托盘不透明度" VerticalAlignment="Center"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="40,267,-40,-257" Grid.ColumnSpan="4">
|
||||
<hc:PreviewSlider Value="{Binding CardOpacity}"
|
||||
Maximum="100"
|
||||
Margin="0,0,-313.5,7.5"
|
||||
>
|
||||
<hc:PreviewSlider.PreviewContent>
|
||||
<Label Style="{StaticResource LabelPrimary}" Content="{Binding Path=(hc:PreviewSlider.PreviewPosition),RelativeSource={RelativeSource Self}}" ContentStringFormat="#0"/>
|
||||
</hc:PreviewSlider.PreviewContent>
|
||||
</hc:PreviewSlider>
|
||||
</hc:UniformSpacingPanel>
|
||||
|
||||
</hc:SimplePanel>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="30,298.813,-30,-288.813" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="背景图片不透明度" VerticalAlignment="Center"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="40,330,-40,-320" Grid.ColumnSpan="4">
|
||||
<hc:PreviewSlider Value="{Binding BgOpacity}"
|
||||
Maximum="100"
|
||||
Margin="0,0,-313.5,7.5"
|
||||
>
|
||||
<hc:PreviewSlider.PreviewContent>
|
||||
<Label Style="{StaticResource LabelPrimary}" Content="{Binding Path=(hc:PreviewSlider.PreviewPosition),RelativeSource={RelativeSource Self}}" ContentStringFormat="#0"/>
|
||||
</hc:PreviewSlider.PreviewContent>
|
||||
</hc:PreviewSlider>
|
||||
</hc:UniformSpacingPanel>
|
||||
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="30,370.813,-30,-360.813" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="主面板不透明度" VerticalAlignment="Center"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="40,399,-40,-389" Grid.ColumnSpan="4">
|
||||
<hc:PreviewSlider Value="{Binding PannelOpacity}"
|
||||
Minimum="50"
|
||||
Maximum="100"
|
||||
Margin="0,0,-313.5,7.5"
|
||||
>
|
||||
<hc:PreviewSlider.PreviewContent>
|
||||
<Label Style="{StaticResource LabelPrimary}" Content="{Binding Path=(hc:PreviewSlider.PreviewPosition),RelativeSource={RelativeSource Self}}" ContentStringFormat="#0"/>
|
||||
</hc:PreviewSlider.PreviewContent>
|
||||
</hc:PreviewSlider>
|
||||
</hc:UniformSpacingPanel>
|
||||
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="30,429.313,-30,-419.313" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="主面板圆角大小" VerticalAlignment="Center"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="40,463.5,-40,-453.5" Grid.ColumnSpan="4">
|
||||
<hc:PreviewSlider Value="{Binding PannelCornerRadius}"
|
||||
Maximum="25"
|
||||
Margin="0,0,-313.5,7.5"
|
||||
>
|
||||
<hc:PreviewSlider.PreviewContent>
|
||||
<Label Style="{StaticResource LabelPrimary}" Content="{Binding Path=(hc:PreviewSlider.PreviewPosition),RelativeSource={RelativeSource Self}}" ContentStringFormat="#0"/>
|
||||
</hc:PreviewSlider.PreviewContent>
|
||||
</hc:PreviewSlider>
|
||||
</hc:UniformSpacingPanel>
|
||||
</hc:SimplePanel>
|
||||
|
||||
</UserControl>
|
||||
|
||||
@@ -28,11 +28,6 @@ namespace GeekDesk.Control.UserControls
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void SimplePanel_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
CommonCode.SaveAppData(MainWindow.appData);
|
||||
}
|
||||
|
||||
private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
@@ -57,6 +52,7 @@ namespace GeekDesk.Control.UserControls
|
||||
if (ofd.ShowDialog() == true)
|
||||
{
|
||||
appConfig.BitmapImage = ImageUtil.GetBitmapImageByFile(ofd.FileName);
|
||||
appConfig.BacImgName = ofd.FileName;
|
||||
}
|
||||
} catch (Exception)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user