下班 还有一些小问题 1.0版本就可以发布了
This commit is contained in:
69
Control/Windows/BacklogInfoWindow.xaml
Normal file
69
Control/Windows/BacklogInfoWindow.xaml
Normal file
@@ -0,0 +1,69 @@
|
||||
<Window x:Class="GeekDesk.Control.Windows.BacklogInfoWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:local="clr-namespace:GeekDesk"
|
||||
mc:Ignorable="d"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Height="670"
|
||||
Width="450"
|
||||
WindowStyle="None"
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent" ShowInTaskbar="False"
|
||||
>
|
||||
<Window.Resources>
|
||||
|
||||
</Window.Resources>
|
||||
<Border CornerRadius="3" BorderThickness="2" BorderBrush="Black" Margin="0,0,0,313.323" MouseDown="DragMove">
|
||||
<Border.Background>
|
||||
<SolidColorBrush Color="AliceBlue"/>
|
||||
</Border.Background>
|
||||
<Border.Resources>
|
||||
<Style x:Key="LeftTB" TargetType="TextBlock" BasedOn="{StaticResource TextBlockBaseStyle}">
|
||||
<Setter Property="Width" Value="65"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
</Style>
|
||||
</Border.Resources>
|
||||
<Grid Margin="0,0,0,8">
|
||||
<hc:SimplePanel Margin="20" HorizontalAlignment="Center">
|
||||
<hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="待办任务*:" Style="{StaticResource LeftTB}"/>
|
||||
<TextBox x:Name="Title" Width="290" FontSize="14" />
|
||||
</hc:UniformSpacingPanel>
|
||||
|
||||
<hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4" Margin="0,48.997,0,-48.997">
|
||||
<TextBlock Text="待办详情:" Style="{StaticResource LeftTB}"/>
|
||||
<TextBox x:Name="Msg" TextWrapping="Wrap"
|
||||
AcceptsReturn="True"
|
||||
VerticalScrollBarVisibility="Visible"
|
||||
Height="100" MaxHeight="150" MinHeight="100" Width="290" MinWidth="290"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
|
||||
<hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4" Margin="0,167.622,0,-167.622">
|
||||
<TextBlock Text="待办时间*:" Style="{StaticResource LeftTB}"/>
|
||||
<hc:DateTimePicker x:Name="ExeTime" ErrorStr="test" Width="200"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
|
||||
<hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4" Margin="0,228,0,-228">
|
||||
<TextBlock Text="完成时间:" Style="{StaticResource LeftTB}"/>
|
||||
<TextBlock x:Name="DoneTime" Width="200"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
|
||||
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="0,273.333,0,-93.333" Grid.ColumnSpan="4">
|
||||
<Button Content="保存" Background="#5BC0DE"
|
||||
Foreground="White" Margin="320,6,-208,-10"
|
||||
Click="Save_Button_Click"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
</hc:SimplePanel>
|
||||
<Button Panel.ZIndex="2" 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"/>
|
||||
<StackPanel hc:Growl.GrowlParent="True" VerticalAlignment="Top" Margin="0,10,10,0"/>
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
</Window>
|
||||
145
Control/Windows/BacklogInfoWindow.xaml.cs
Normal file
145
Control/Windows/BacklogInfoWindow.xaml.cs
Normal file
@@ -0,0 +1,145 @@
|
||||
using GeekDesk.Util;
|
||||
using GeekDesk.ViewModel;
|
||||
using HandyControl.Controls;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
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.Shapes;
|
||||
|
||||
namespace GeekDesk.Control.Windows
|
||||
{
|
||||
/// <summary>
|
||||
/// BacklogInfoWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class BacklogInfoWindow
|
||||
{
|
||||
|
||||
private static int windowType = -1;
|
||||
private static readonly int NEW_BACKLOG = 1;
|
||||
private static readonly int DETAIL_BACKLOG = 2;
|
||||
|
||||
private AppData appData = MainWindow.appData;
|
||||
|
||||
private BacklogInfo info;
|
||||
|
||||
private BacklogInfoWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
ExeTime.SelectedDateTime = DateTime.Now.AddMinutes(10);
|
||||
this.Topmost = true;
|
||||
}
|
||||
private BacklogInfoWindow(BacklogInfo info)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Topmost = true;
|
||||
Title.Text = info.Title;
|
||||
Msg.Text = info.Msg;
|
||||
ExeTime.Text = info.ExeTime;
|
||||
DoneTime.Text = info.DoneTime;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 点击关闭按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Close_Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 移动窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void DragMove(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.LeftButton == MouseButtonState.Pressed)
|
||||
{
|
||||
DragMove();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存待办
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Save_Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
|
||||
if (Title.Text.Trim() == "" || ExeTime.Text.Trim() == "")
|
||||
{
|
||||
Growl.Warning("任务标题 和 待办时间不能为空!");
|
||||
return;
|
||||
} else
|
||||
{
|
||||
try
|
||||
{
|
||||
Convert.ToDateTime(ExeTime.Text);
|
||||
} catch (Exception)
|
||||
{
|
||||
Growl.Warning("请输入正确的时间!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (windowType == NEW_BACKLOG)
|
||||
{
|
||||
info = new BacklogInfo
|
||||
{
|
||||
Title = Title.Text,
|
||||
Msg = Msg.Text,
|
||||
ExeTime = ExeTime.Text
|
||||
};
|
||||
appData.ExeBacklogList.Add(info);
|
||||
} else
|
||||
{
|
||||
int index =appData.ExeBacklogList.IndexOf(info);
|
||||
appData.ExeBacklogList.Remove(info);
|
||||
info.Title = Title.Text;
|
||||
info.Msg = Msg.Text;
|
||||
info.ExeTime = ExeTime.Text;
|
||||
info.DoneTime = DoneTime.Text;
|
||||
appData.ExeBacklogList.Insert(index, info);
|
||||
}
|
||||
CommonCode.SaveAppData(MainWindow.appData);
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private static System.Windows.Window window = null;
|
||||
public static void ShowNone()
|
||||
{
|
||||
if (window == null || !window.Activate())
|
||||
{
|
||||
window = new BacklogInfoWindow();
|
||||
|
||||
}
|
||||
windowType = NEW_BACKLOG;
|
||||
window.Show();
|
||||
}
|
||||
|
||||
private static System.Windows.Window window2 = null;
|
||||
public static void ShowDetail(BacklogInfo info)
|
||||
{
|
||||
if (window2 == null || !window2.Activate())
|
||||
{
|
||||
window2 = new BacklogInfoWindow(info);
|
||||
}
|
||||
windowType = DETAIL_BACKLOG;
|
||||
window2.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
99
Control/Windows/BacklogWindow.xaml
Normal file
99
Control/Windows/BacklogWindow.xaml
Normal file
@@ -0,0 +1,99 @@
|
||||
<Window x:Class="GeekDesk.Control.Windows.BacklogWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:local="clr-namespace:GeekDesk"
|
||||
mc:Ignorable="d"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Height="450"
|
||||
Width="850"
|
||||
WindowStyle="None"
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent" ShowInTaskbar="False"
|
||||
>
|
||||
<Window.Resources>
|
||||
<Style x:Key="MenuStyle" TargetType="hc:SideMenuItem" BasedOn="{StaticResource SideMenuItemBaseStyle}">
|
||||
<Style.Setters>
|
||||
<Setter Property="Background" Value="AliceBlue"/>
|
||||
</Style.Setters>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="#FFE2E2E2"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Background" Value="#FFDAD7D7"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
<Border CornerRadius="8" BorderThickness="0">
|
||||
<Border.Background>
|
||||
<SolidColorBrush Color="AliceBlue" Opacity="0.9"/>
|
||||
</Border.Background>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="140"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<hc:Card Grid.Row="0" Grid.Column="0">
|
||||
<hc:SideMenu BorderThickness="1"
|
||||
AutoSelect="True"
|
||||
>
|
||||
<hc:SideMenu.Background>
|
||||
<SolidColorBrush Color="AliceBlue"/>
|
||||
</hc:SideMenu.Background>
|
||||
|
||||
<hc:SideMenu.ItemContainerStyle>
|
||||
<Style TargetType="hc:SideMenuItem" BasedOn="{StaticResource MenuStyle}"/>
|
||||
</hc:SideMenu.ItemContainerStyle>
|
||||
|
||||
<hc:SideMenuItem Header="待办列表"
|
||||
IsSelected="True"
|
||||
Selected="MemuClick"
|
||||
Tag="ExeList"
|
||||
>
|
||||
<hc:SideMenuItem.Icon>
|
||||
<Button Background="Transparent"
|
||||
BorderThickness="0"
|
||||
hc:IconElement.Geometry="{StaticResource About}"
|
||||
hc:IconElement.Height="18"
|
||||
hc:IconElement.Width="18"
|
||||
HorizontalAlignment="Right"
|
||||
/>
|
||||
</hc:SideMenuItem.Icon>
|
||||
</hc:SideMenuItem>
|
||||
<hc:SideMenuItem Header="历史待办"
|
||||
Tag="History"
|
||||
Selected="MemuClick">
|
||||
<hc:SideMenuItem.Icon>
|
||||
<Button Background="Transparent"
|
||||
BorderThickness="0"
|
||||
hc:IconElement.Geometry="{StaticResource Pannel}"
|
||||
hc:IconElement.Height="18"
|
||||
hc:IconElement.Width="18"
|
||||
HorizontalAlignment="Right"
|
||||
/>
|
||||
</hc:SideMenuItem.Icon>
|
||||
</hc:SideMenuItem>
|
||||
</hc:SideMenu>
|
||||
</hc:Card>
|
||||
<hc:Card Grid.Row="0" Grid.Column="1" x:Name="RightCard" Height="450" MouseDown="DragMove" />
|
||||
|
||||
|
||||
<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"/>
|
||||
<Button Content="新建待办"
|
||||
Panel.ZIndex="1"
|
||||
Background="#5BC0DE"
|
||||
Foreground="White"
|
||||
Grid.Column="1"
|
||||
Margin="590,29,10,384"
|
||||
Click="CreateBacklog_BtnClick"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Window>
|
||||
97
Control/Windows/BacklogWindow.xaml.cs
Normal file
97
Control/Windows/BacklogWindow.xaml.cs
Normal file
@@ -0,0 +1,97 @@
|
||||
using GeekDesk.Control.UserControls.Backlog;
|
||||
using GeekDesk.ViewModel;
|
||||
using HandyControl.Controls;
|
||||
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.Shapes;
|
||||
|
||||
namespace GeekDesk.Control.Windows
|
||||
{
|
||||
/// <summary>
|
||||
/// BacklogWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class BacklogWindow
|
||||
{
|
||||
private static BacklogControl backlog = new BacklogControl();
|
||||
private AppData appData = MainWindow.appData;
|
||||
private BacklogWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
RightCard.Content = backlog;
|
||||
backlog.BacklogList.ItemsSource = appData.ExeBacklogList;
|
||||
this.Topmost = true;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 移动窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void DragMove(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.LeftButton == MouseButtonState.Pressed)
|
||||
{
|
||||
DragMove();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 点击关闭按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Close_Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void MemuClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SideMenuItem smi = sender as SideMenuItem;
|
||||
switch (smi.Tag.ToString())
|
||||
{
|
||||
case "History":
|
||||
backlog.BacklogList.ItemsSource = appData.HiBacklogList;
|
||||
break;
|
||||
default:
|
||||
backlog.BacklogList.ItemsSource = appData.ExeBacklogList;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新建待办
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void CreateBacklog_BtnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
BacklogInfoWindow.ShowNone();
|
||||
}
|
||||
|
||||
|
||||
private static System.Windows.Window window = null;
|
||||
public static void Show()
|
||||
{
|
||||
if (window == null || !window.Activate())
|
||||
{
|
||||
window = new BacklogWindow();
|
||||
}
|
||||
window.Show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
111
Control/Windows/ConfigWindow.xaml
Normal file
111
Control/Windows/ConfigWindow.xaml
Normal file
@@ -0,0 +1,111 @@
|
||||
<hc:Window x:Class="GeekDesk.Control.Windows.ConfigWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:local="clr-namespace:GeekDesk"
|
||||
mc:Ignorable="d"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Height="450"
|
||||
Width="600"
|
||||
WindowStyle="None"
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent" ShowInTaskbar="False"
|
||||
>
|
||||
|
||||
<Window.Resources>
|
||||
<Style x:Key="MenuStyle" TargetType="hc:SideMenuItem" BasedOn="{StaticResource SideMenuItemBaseStyle}">
|
||||
<Style.Setters>
|
||||
<Setter Property="Background" Value="AliceBlue"/>
|
||||
</Style.Setters>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="#FFE2E2E2"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Background" Value="#FFDAD7D7"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
<Border CornerRadius="8" BorderThickness="0">
|
||||
<Border.Background>
|
||||
<SolidColorBrush Color="AliceBlue" Opacity="0.9"/>
|
||||
</Border.Background>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="140"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<hc:Card Grid.Row="0" Grid.Column="0">
|
||||
<hc:SideMenu BorderThickness="1"
|
||||
AutoSelect="True"
|
||||
>
|
||||
<hc:SideMenu.Background>
|
||||
<SolidColorBrush Color="AliceBlue"/>
|
||||
</hc:SideMenu.Background>
|
||||
|
||||
<hc:SideMenu.ItemContainerStyle>
|
||||
<Style TargetType="hc:SideMenuItem" BasedOn="{StaticResource MenuStyle}"/>
|
||||
</hc:SideMenu.ItemContainerStyle>
|
||||
|
||||
<hc:SideMenuItem Header="关于"
|
||||
IsSelected="True"
|
||||
Selected="MemuClick"
|
||||
Tag="About"
|
||||
>
|
||||
<hc:SideMenuItem.Icon>
|
||||
<Button Background="Transparent"
|
||||
BorderThickness="0"
|
||||
hc:IconElement.Geometry="{StaticResource About}"
|
||||
hc:IconElement.Height="18"
|
||||
hc:IconElement.Width="18"
|
||||
HorizontalAlignment="Right"
|
||||
/>
|
||||
</hc:SideMenuItem.Icon>
|
||||
</hc:SideMenuItem>
|
||||
<hc:SideMenuItem Header="显示设置"
|
||||
Tag="Theme"
|
||||
Selected="MemuClick">
|
||||
<hc:SideMenuItem.Icon>
|
||||
<!--<Button Background="Transparent"
|
||||
BorderThickness="0"
|
||||
hc:IconElement.Geometry="{StaticResource Pannel}"
|
||||
hc:IconElement.Height="18"
|
||||
hc:IconElement.Width="18"
|
||||
HorizontalAlignment="Right"
|
||||
/>-->
|
||||
<TextBlock Text="" Style="{StaticResource MyIcon}"/>
|
||||
</hc:SideMenuItem.Icon>
|
||||
</hc:SideMenuItem>
|
||||
|
||||
<hc:SideMenuItem Header="动作"
|
||||
Tag="Motion"
|
||||
Selected="MemuClick">
|
||||
<hc:SideMenuItem.Icon>
|
||||
<Button Background="Transparent"
|
||||
BorderThickness="0"
|
||||
hc:IconElement.Geometry="{StaticResource Motion}"
|
||||
hc:IconElement.Height="18"
|
||||
hc:IconElement.Width="18"
|
||||
HorizontalAlignment="Right"
|
||||
/>
|
||||
</hc:SideMenuItem.Icon>
|
||||
</hc:SideMenuItem>
|
||||
</hc:SideMenu>
|
||||
</hc:Card>
|
||||
<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>
|
||||
84
Control/Windows/ConfigWindow.xaml.cs
Normal file
84
Control/Windows/ConfigWindow.xaml.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
using GeekDesk.Control.UserControls;
|
||||
using GeekDesk.Control.UserControls.Config;
|
||||
using GeekDesk.ViewModel;
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Data;
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace GeekDesk.Control.Windows
|
||||
{
|
||||
/// <summary>
|
||||
/// ConfigDialog.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ConfigWindow
|
||||
{
|
||||
private static AboutControl about = new AboutControl();
|
||||
private static ThemeControl theme = new ThemeControl();
|
||||
private static MotionControl motion = new MotionControl();
|
||||
public MainWindow mainWindow;
|
||||
|
||||
private ConfigWindow(AppConfig appConfig, MainWindow mainWindow)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = appConfig;
|
||||
RightCard.Content = about;
|
||||
this.Topmost = true;
|
||||
this.mainWindow = mainWindow;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 移动窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void DragMove(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.LeftButton == MouseButtonState.Pressed)
|
||||
{
|
||||
DragMove();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 点击关闭按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Close_Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void MemuClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SideMenuItem smi = sender as SideMenuItem;
|
||||
switch (smi.Tag.ToString())
|
||||
{
|
||||
case "Motion":
|
||||
RightCard.Content = motion;
|
||||
break;
|
||||
case "Theme":
|
||||
RightCard.Content = theme;
|
||||
break;
|
||||
default:
|
||||
RightCard.Content = about;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static System.Windows.Window window = null;
|
||||
public static void Show(AppConfig appConfig, MainWindow mainWindow)
|
||||
{
|
||||
if (window == null || !window.Activate())
|
||||
{
|
||||
window = new ConfigWindow(appConfig, mainWindow);
|
||||
}
|
||||
window.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user