From a7a2ee9f08ac4e09943d37859c7469d5b88a3780 Mon Sep 17 00:00:00 2001 From: liufei Date: Mon, 23 May 2022 17:56:39 +0800 Subject: [PATCH] =?UTF-8?q?fix=20#41=20=E4=BC=98=E5=8C=96=E5=BE=85?= =?UTF-8?q?=E5=8A=9E=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.xaml.cs | 15 +++ Control/UserControls/ToDo/TodoControl.xaml | 98 +++++++++++++++++-- Control/UserControls/ToDo/TodoControl.xaml.cs | 12 ++- Control/Windows/ToDoWindow.xaml | 12 ++- Control/Windows/ToDoWindow.xaml.cs | 50 ++++++++++ Converts/Count2VisibleConvert.cs | 43 ++++++++ Converts/CountGreZero2BoolConvert.cs | 28 ++++++ GeekDesk.csproj | 2 + 8 files changed, 248 insertions(+), 12 deletions(-) create mode 100644 Converts/Count2VisibleConvert.cs create mode 100644 Converts/CountGreZero2BoolConvert.cs diff --git a/App.xaml.cs b/App.xaml.cs index 7dc3a17..72790e9 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -2,6 +2,8 @@ using GeekDesk.Util; using System; using System.Windows; +using System.Windows.Input; +using System.Windows.Threading; namespace GeekDesk { @@ -38,6 +40,7 @@ namespace GeekDesk void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) { e.Handled = true;//使用这一行代码告诉运行时,该异常被处理了,不再作为UnhandledException抛出了。 + Mouse.OverrideCursor = null; LogUtil.WriteErrorLog(e, "未捕获异常!"); if (Constants.DEV) { @@ -50,6 +53,18 @@ namespace GeekDesk LogUtil.WriteErrorLog(e, "严重异常!"); MessageBox.Show("GeekDesk遇到未知问题崩溃!"); } + public static void DoEvents() + { + var frame = new DispatcherFrame(); + Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, + new DispatcherOperationCallback( + delegate (object f) + { + ((DispatcherFrame)f).Continue = false; + return null; + }), frame); + Dispatcher.PushFrame(frame); + } } diff --git a/Control/UserControls/ToDo/TodoControl.xaml b/Control/UserControls/ToDo/TodoControl.xaml index d400a76..657799d 100644 --- a/Control/UserControls/ToDo/TodoControl.xaml +++ b/Control/UserControls/ToDo/TodoControl.xaml @@ -6,25 +6,58 @@ xmlns:local="clr-namespace:GeekDesk.Control.UserControls.PannelCard" xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:viewmodel="clr-namespace:GeekDesk.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:ToDoInfo}" mc:Ignorable="d" + xmlns:cst="clr-namespace:GeekDesk.Converts" Background="Transparent" > + + + + + + + HeadersVisibility="All" + AutoGenerateColumns="False" + ItemsSource="{Binding}" + IsReadOnly="True" + Initialized="DataGridMenu_Initialized" + > - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +