diff --git a/UI/App.xaml.cs b/UI/App.xaml.cs index dc92359097451c344f030d3cbe349e03db6be08e..dafb8be11aed96a8c3c21e6d8ad4cf8af85dd1e3 100644 --- a/UI/App.xaml.cs +++ b/UI/App.xaml.cs @@ -66,7 +66,7 @@ namespace UI base.OnExit(e); - appData.SaveAppChanges(); + //appData.SaveAppChanges(); Logger.Save(true); @@ -74,7 +74,7 @@ namespace UI } private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) { - appData.SaveAppChanges(); + //appData.SaveAppChanges(); // 记录崩溃错误 Logger.Error("[程序崩溃异常] " + e.Exception.Message); diff --git a/UI/Base/Color/Colors.cs b/UI/Base/Color/Colors.cs index 9086dfb7a61e3e24d630942dcdbac0d20fe3747e..49632f287ca222acd7fb7d3cbcfe625521aca1ac 100644 --- a/UI/Base/Color/Colors.cs +++ b/UI/Base/Color/Colors.cs @@ -35,7 +35,7 @@ namespace UI.Base.Color }; - public static string[] MainColors = { "#15C38E", "#A761FF", "#FFE6E6", "#00FFAB", "#B8F1B0", "#DAEAF1", "#1464DF", "#FF5C01", "#9EB23C", "#FF9999", "#998CEB", "#77E4D4", "#FD5E5E", "#B4FF9F", "#07FF01", "#FFE162", "#C70B80", "#590696", "#97DBAE" }; + public static string[] MainColors = { "#00FFAB", "#A761FF", "#ff587f", "#ff1801", "#f7fd05", "#DAEAF1", "#2B20D9", "#FF5C01", "#9EB23C", "#FF9999", "#998CEB", "#77E4D4", "#FD5E5E", "#B4FF9F", "#07FF01", "#FFE162", "#C70B80", "#590696", "#97DBAE" }; public static IColor Get(ColorTypes color) { diff --git a/UI/Controls/Base/Img.cs b/UI/Controls/Base/Img.cs index 3df6b0471597fc72591aeea22bcf54597a54cd4c..260d69340243774850d334defaba670bfc3905ce 100644 --- a/UI/Controls/Base/Img.cs +++ b/UI/Controls/Base/Img.cs @@ -1,6 +1,8 @@ using Core.Librarys.Image; using System; using System.Collections.Generic; +using System.Diagnostics; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -18,6 +20,17 @@ namespace UI.Controls.Base { public class Img : Control { + public CornerRadius Radius + { + get { return (CornerRadius)GetValue(RadiusProperty); } + set { SetValue(RadiusProperty, value); } + } + public static readonly DependencyProperty RadiusProperty = + DependencyProperty.Register("Radius", + typeof(CornerRadius), + typeof(Img)); + + /// /// 图片链接 /// @@ -36,30 +49,93 @@ namespace UI.Controls.Base var control = (d as Img); if (e.Property == URLProperty && e.OldValue != e.NewValue) { - control.Render(); + control.Handle(); } } - - private ImageBrush _image; + //private bool isRendered = false; + //private Image _image; + //Page page; + //private ImageBrush _image; public Img() { DefaultStyleKey = typeof(Img); + + //Loaded += Img_Loaded; } public override void OnApplyTemplate() { base.OnApplyTemplate(); - _image = GetTemplateChild("image") as ImageBrush; - Render(); + //_image = GetTemplateChild("image") as ImageBrush; + //_image = GetTemplateChild("image") as Image; + + //new Border().CornerRadius } - private void Render() + private void Handle() { - if (_image == null) + if (!File.Exists(URL)) { - return; + URL = "pack://application:,,,/Tai;component/Resources/Icons/defaultIcon.png"; } - _image.ImageSource = Imager.Load(URL); } + + + + //private void Page_LayoutUpdated(object sender, EventArgs e) + //{ + // if (!isRendered) + // { + // Rect bounds = this.TransformToAncestor(page).TransformBounds(new Rect(0.0, 0.0, this.ActualWidth, this.ActualHeight)); + // Rect rect = new Rect(0.0, 0.0, page.ActualWidth, page.ActualHeight); + + // if (rect.Contains(bounds)) + // { + // Debug.WriteLine("渲染!"); + + // isRendered = true; + + // Render(); + // } + // } + //} + + //private void Img_Loaded(object sender, RoutedEventArgs e) + //{ + // var parent = VisualTreeHelper.GetParent(this); + // while (!(parent is Page)) + // { + // parent = VisualTreeHelper.GetParent(parent); + // } + // page = (parent as Page); + + // page.LayoutUpdated += Page_LayoutUpdated; + //} + + //private async void Render() + //{ + // if (_image == null) + // { + // return; + // } + + // //_image.Source = Imager.Load(URL); + + + + // //_image.ImageSource = Imager.Load(URL); + // //BitmapImage bitimg = null; + + // string img = URL != null ? URL.ToString() : ""; + + // var res = Task.Run(() => + // { + + // Debug.WriteLine("load:" + img); + // return Imager.Load(img); + // }); + + // _image.Source = await res; + //} } } diff --git a/UI/Controls/Base/View.cs b/UI/Controls/Base/View.cs index dd79c8e0e07125ffffe5ea995cb40aaeadb187bc..b3727f34d885e774e74f76b497927aba89ab5179 100644 --- a/UI/Controls/Base/View.cs +++ b/UI/Controls/Base/View.cs @@ -38,8 +38,14 @@ namespace UI.Controls.Base public View() { DefaultStyleKey = typeof(View); + + Loaded += View_Loaded; } + private void View_Loaded(object sender, RoutedEventArgs e) + { + Handle(); + } private void Handle() { @@ -65,6 +71,28 @@ namespace UI.Controls.Base string val = Condition.Substring(Condition.IndexOf("=") + 1); isShow = val == Value.ToString(); } + else if (Condition.IndexOf("not null") != -1) + { + + isShow = Value != null; + } + else if (Condition.IndexOf("null") != -1) + { + + isShow = Value == null; + } + else if (Condition.IndexOf("empty") != -1) + { + if (Value == null) + { + isShow = true; + } + else + { + var data = Value as IEnumerable; + isShow = data.Count() == 0; + } + } else { isShow = Condition == Value.ToString(); diff --git a/UI/Controls/Tabbar/Tabbar.cs b/UI/Controls/Tabbar/Tabbar.cs index aeda8a260a503b974779f9864b5327f6825ca2ce..ccdb46a8b02e4bb905059794f061fd47c7fb74f0 100644 --- a/UI/Controls/Tabbar/Tabbar.cs +++ b/UI/Controls/Tabbar/Tabbar.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; +using System.Diagnostics; using System.Linq; using System.Text; using System.Windows; @@ -61,7 +62,7 @@ namespace UI.Controls.Tabbar private StackPanel ItemsPanel; private List ItemsDictionary; - + private Grid ItemsContainer; // 选中标记块 private Border ActiveBlock; // 动画 @@ -105,18 +106,19 @@ namespace UI.Controls.Tabbar public override void OnApplyTemplate() { base.OnApplyTemplate(); - ItemsPanel = GetTemplateChild("ItemsPanel") as StackPanel; + //ItemsPanel = GetTemplateChild("ItemsPanel") as StackPanel; ActiveBlock = GetTemplateChild("ActiveBlock") as Border; - + ItemsContainer = GetTemplateChild("ItemsContainer") as Grid; Render(); } - private void AddItem(string item) + private void AddItem(string item, int col) { - if (ItemsPanel != null) + if (ItemsContainer != null) { var control = new TextBlock(); + control.TextAlignment= TextAlignment.Center; control.Text = item; control.Margin = new Thickness(0, 0, 10, 0); control.FontSize = 18; @@ -135,11 +137,13 @@ namespace UI.Controls.Tabbar { control.Loaded += (e, c) => { + ActiveBlock.Width = control.ActualWidth; ScrollToActive(); Reset(); }; } - ItemsPanel.Children.Add(control); + Grid.SetColumn(control, col); + ItemsContainer.Children.Add(control); ItemsDictionary.Add(control); } } @@ -150,11 +154,25 @@ namespace UI.Controls.Tabbar { if (Data != null) { - ItemsPanel.Children.Clear(); - foreach (var item in Data) + ItemsContainer.Children.Clear(); + ItemsContainer.ColumnDefinitions.Clear(); + for (int i = 0; i < Data.Count; i++) { - AddItem(item); + var item = Data[i]; + + ItemsContainer.ColumnDefinitions.Add(new ColumnDefinition() + { + Width = new GridLength(1, GridUnitType.Star) + }); + + AddItem(item, i); + } + //foreach (var item in Data) + //{ + + // AddItem(item); + //} } } @@ -188,10 +206,23 @@ namespace UI.Controls.Tabbar storyboard.Children.Clear(); + + var activeBlockTG = ActiveBlock.RenderTransform as TransformGroup; + var blockOldX = (activeBlockTG.Children[0] as TranslateTransform).X; DoubleAnimation scrollAnimation = new DoubleAnimation(); //scrollAnimation.From = activeBlockTTF.Y; - double scrollX = relativePoint.X - 10; + //double scrollX = relativePoint.X + item.ActualWidth / 2 - ActiveBlock.ActualWidth / 2; + double scrollX = relativePoint.X; + scrollX = scrollX < 0 ? 0 : scrollX; + + //scrollX= scrollX + item.ActualWidth / 2 - ActiveBlock.ActualWidth / 2; + if (scrollX != 0) + { + //scrollX = scrollX > blockOldX ? scrollX - 10 : scrollX; + } + + Debug.WriteLine(blockOldX + " -> " + scrollX); scrollAnimation.To = scrollX; scrollAnimation.EasingFunction = new SineEase() { EasingMode = EasingMode.EaseIn }; @@ -264,36 +295,40 @@ namespace UI.Controls.Tabbar { Storyboard storyboard = new Storyboard(); - foreach (var item in ItemsPanel.Children) + foreach (var item in ItemsContainer.Children) { - if (item != ItemsPanel.Children[SelectedIndex]) + if (item != ItemsContainer.Children[SelectedIndex]) { - DoubleAnimation fontSizeAnimation = new DoubleAnimation(); - //scrollAnimation.From = activeBlockTTF.Y; - fontSizeAnimation.To = 14; + var text = item as TextBlock; + text.FontSize = 14; + text.Foreground = UI.Base.Color.Colors.GetFromString("#ccc"); + + //DoubleAnimation fontSizeAnimation = new DoubleAnimation(); + ////scrollAnimation.From = activeBlockTTF.Y; + //fontSizeAnimation.To = 14; - fontSizeAnimation.EasingFunction = new SineEase() { EasingMode = EasingMode.EaseIn }; - Storyboard.SetTarget(fontSizeAnimation, (UIElement)item); - Storyboard.SetTargetProperty(fontSizeAnimation, new PropertyPath("FontSize")); + //fontSizeAnimation.EasingFunction = new SineEase() { EasingMode = EasingMode.EaseIn }; + //Storyboard.SetTarget(fontSizeAnimation, (UIElement)item); + //Storyboard.SetTargetProperty(fontSizeAnimation, new PropertyPath("FontSize")); - fontSizeAnimation.Duration = new Duration(TimeSpan.FromSeconds(0.1)); + //fontSizeAnimation.Duration = new Duration(TimeSpan.FromSeconds(0.1)); - ColorAnimation oldFontColorAnimation = new ColorAnimation(); - //scrollAnimation.From = activeBlockTTF.Y; - oldFontColorAnimation.To = (Color)ColorConverter.ConvertFromString("#CCCCCC"); + //ColorAnimation oldFontColorAnimation = new ColorAnimation(); + ////scrollAnimation.From = activeBlockTTF.Y; + //oldFontColorAnimation.To = (Color)ColorConverter.ConvertFromString("#CCCCCC"); - oldFontColorAnimation.EasingFunction = new SineEase() { EasingMode = EasingMode.EaseIn }; - Storyboard.SetTarget(oldFontColorAnimation, (UIElement)item); - Storyboard.SetTargetProperty(oldFontColorAnimation, new PropertyPath("(TextBlock.Foreground).(SolidColorBrush.Color)")); + //oldFontColorAnimation.EasingFunction = new SineEase() { EasingMode = EasingMode.EaseIn }; + //Storyboard.SetTarget(oldFontColorAnimation, (UIElement)item); + //Storyboard.SetTargetProperty(oldFontColorAnimation, new PropertyPath("(TextBlock.Foreground).(SolidColorBrush.Color)")); - oldFontColorAnimation.Duration = new Duration(TimeSpan.FromSeconds(0.3)); + //oldFontColorAnimation.Duration = new Duration(TimeSpan.FromSeconds(0.3)); - storyboard.Children.Add(fontSizeAnimation); - storyboard.Children.Add(oldFontColorAnimation); + //storyboard.Children.Add(fontSizeAnimation); + //storyboard.Children.Add(oldFontColorAnimation); } } - storyboard.Begin(); + //storyboard.Begin(); } } } diff --git a/UI/Models/CategoryAppListPageModel.cs b/UI/Models/CategoryAppListPageModel.cs index c9ae6c2652d8f492fdd11b02fe18612ec4749ec8..bc132d6514f0677d9848e627243df6938e848c5b 100644 --- a/UI/Models/CategoryAppListPageModel.cs +++ b/UI/Models/CategoryAppListPageModel.cs @@ -23,7 +23,7 @@ namespace UI.Models //private List ChooseAppList_; //public List ChooseAppList { get { return ChooseAppList_; } set { ChooseAppList_ = value; OnPropertyChanged(); } } - private Visibility ChooseVisibility_ = Visibility.Collapsed; + private Visibility ChooseVisibility_ = Visibility.Hidden; public Visibility ChooseVisibility { get { return ChooseVisibility_; } set { ChooseVisibility_ = value; OnPropertyChanged(); } } private AppModel SelectedItem_; diff --git a/UI/Themes/Base/EmptyData.xaml b/UI/Themes/Base/EmptyData.xaml index e9a31bf1684176e40329ae7337e208a18e5e7807..0b7949eaad74413e9f4b8c17a10b20b76f984293 100644 --- a/UI/Themes/Base/EmptyData.xaml +++ b/UI/Themes/Base/EmptyData.xaml @@ -6,7 +6,8 @@ Value="true" /> - + diff --git a/UI/Themes/Base/Img.xaml b/UI/Themes/Base/Img.xaml index 0069262b23b44a1be8e521974c600c5a65e87aed..004d8c7862365c9c5b91e9576004fdb7316ffecd 100644 --- a/UI/Themes/Base/Img.xaml +++ b/UI/Themes/Base/Img.xaml @@ -8,6 +8,7 @@ + @@ -17,9 +18,9 @@ - + - + diff --git a/UI/Themes/DatePickerBar/DatePickerBar.xaml b/UI/Themes/DatePickerBar/DatePickerBar.xaml index 59cc55d501d5afee7e91e1ce7ebafd58fa6cd221..8dda88548b6a8b11931de12e3aee5f4a0dd1c521 100644 --- a/UI/Themes/DatePickerBar/DatePickerBar.xaml +++ b/UI/Themes/DatePickerBar/DatePickerBar.xaml @@ -14,17 +14,31 @@ + + + + + - + diff --git a/UI/Themes/Navigation/NavigationItem.xaml b/UI/Themes/Navigation/NavigationItem.xaml index 0c2f7954a4acec38a0429f0e2a9050f51eb23383..2e9637d103849b7d02fbeffc4cad3aab358c6f1c 100644 --- a/UI/Themes/Navigation/NavigationItem.xaml +++ b/UI/Themes/Navigation/NavigationItem.xaml @@ -50,10 +50,13 @@ - + - + + + + @@ -95,7 +98,11 @@ + Storyboard.TargetProperty="(base:Icon.RenderTransform).Children[0].(TranslateTransform.Y)" Storyboard.TargetName="Icon" To="0" /> + + @@ -105,7 +112,11 @@ + Storyboard.TargetProperty="(base:Icon.RenderTransform).Children[0].(TranslateTransform.Y)" Storyboard.TargetName="Icon" To="-5" /> + + diff --git a/UI/Themes/Select/ImageSelect.xaml b/UI/Themes/Select/ImageSelect.xaml index 05802015b295b18496b2af29fb207fa4d27da19d..d50ef34a0f398f6762b3d8d2e97beb92601d5104 100644 --- a/UI/Themes/Select/ImageSelect.xaml +++ b/UI/Themes/Select/ImageSelect.xaml @@ -30,7 +30,7 @@ - + diff --git a/UI/Themes/Select/Select.xaml b/UI/Themes/Select/Select.xaml index 36a33b4d89d24d7741e7a117eb6f8b815e17f73f..74926690cd9ed78ce2e37d66af28aa4f947b9951 100644 --- a/UI/Themes/Select/Select.xaml +++ b/UI/Themes/Select/Select.xaml @@ -25,7 +25,7 @@ - + diff --git a/UI/Themes/Tabbar/Tabbar.xaml b/UI/Themes/Tabbar/Tabbar.xaml index f847de51507878ab4fcb451fab8823cb7b4d55f4..d1416012cad882277f46c26a91e8c7d5676dc7d8 100644 --- a/UI/Themes/Tabbar/Tabbar.xaml +++ b/UI/Themes/Tabbar/Tabbar.xaml @@ -13,16 +13,27 @@ - + + - - + + + + + diff --git a/UI/UI.csproj b/UI/UI.csproj index 362d232390191810c9df3b234fca78f1c8a91419..64c0d3355ea8cf0f134c34475a1356c02c17c78f 100644 --- a/UI/UI.csproj +++ b/UI/UI.csproj @@ -119,18 +119,27 @@ + + + + + + + + + @@ -140,14 +149,26 @@ + + + + + + + + + + + + @@ -155,11 +176,23 @@ + + + + + CategoryAppListPage.xaml + + + CategoryPage.xaml + + + ChartPage.xaml + DataPage.xaml @@ -193,6 +226,22 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + MSBuild:Compile Designer @@ -205,6 +254,10 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + MSBuild:Compile Designer @@ -249,6 +302,22 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + MSBuild:Compile Designer @@ -289,6 +358,18 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + MSBuild:Compile Designer diff --git a/UI/ViewModels/CategoryAppListPageVM.cs b/UI/ViewModels/CategoryAppListPageVM.cs index 747820f6f3159a96dba96cf8dc43349675efc5e1..feb9817692639a1414cae41bc87843a267b64ee6 100644 --- a/UI/ViewModels/CategoryAppListPageVM.cs +++ b/UI/ViewModels/CategoryAppListPageVM.cs @@ -29,6 +29,7 @@ namespace UI.ViewModels ShowChooseCommand = new Command(new Action(OnShowChoose)); ChoosedCommand = new Command(new Action(OnChoosed)); GotoDetailCommand = new Command(new Action(OnGotoDetail)); + LoadData(); } @@ -82,28 +83,59 @@ namespace UI.ViewModels private void OnShowChoose(object obj) { ChooseVisibility = System.Windows.Visibility.Visible; + + + LoadApps(); + } private void LoadData() { - Category = mainVM.Data as UI.Models.Category.CategoryModel; - Data = appData.GetAppsByCategoryID(Category.Data.ID); + Task.Run(() => + { + Category = mainVM.Data as UI.Models.Category.CategoryModel; + Data = appData.GetAppsByCategoryID(Category.Data.ID); + + //var appList = new List(); + //foreach (var item in appData.GetAllApps()) + //{ + // var app = new ChooseAppModel(); + // app.App = item; + // app.IsChoosed = item.CategoryID == Category.Data.ID; + // app.Value.Name = item.Name; + // app.Value.Img = item.IconFile; - var appList = new List(); - foreach (var item in appData.GetAllApps()) + // appList.Add(app); + //} + + //AppList = appList; + }); + } + + private void LoadApps() + { + Task.Run(() => { - var app = new ChooseAppModel(); - app.App = item; - app.IsChoosed = item.CategoryID == Category.Data.ID; - app.Value.Name = item.Name; - app.Value.Img = item.IconFile; + //Category = mainVM.Data as UI.Models.Category.CategoryModel; + if (Category == null) + { + return; + } + var appList = new List(); + foreach (var item in appData.GetAllApps()) + { + var app = new ChooseAppModel(); + app.App = item; + app.IsChoosed = item.CategoryID == Category.Data.ID; + app.Value.Name = item.Name; + app.Value.Img = item.IconFile; - appList.Add(app); - } + appList.Add(app); + } - AppList = appList; - //ChooseAppList = Data; + AppList = appList; + }); } } } diff --git a/UI/ViewModels/CategoryPageVM.cs b/UI/ViewModels/CategoryPageVM.cs index 1fbcf54c78ce73675464e1f44ba1037136eb681b..a9fc41492849f57712c5b4971748102d0379f030 100644 --- a/UI/ViewModels/CategoryPageVM.cs +++ b/UI/ViewModels/CategoryPageVM.cs @@ -73,6 +73,10 @@ namespace UI.ViewModels // 从界面移除 Data.Remove(SelectedItem); + if (Data.Count == 0) + { + Data = new System.Collections.ObjectModel.ObservableCollection(); + } mainVM.Toast("分类已删除", Controls.Window.ToastType.Success); } @@ -117,13 +121,22 @@ namespace UI.ViewModels IconFile = EditIconFile, }); - - Data.Add(new CategoryModel() + var item = new CategoryModel() { Data = res, Count = 0 - }); - + }; + if (Data.Count == 0) + { + //Data=new System.Collections.ObjectModel.ObservableCollection() + var list = new System.Collections.ObjectModel.ObservableCollection(); + list.Add(item); + Data = list; + } + else + { + Data.Add(item); + } } else diff --git a/UI/ViewModels/ChartPageVM.cs b/UI/ViewModels/ChartPageVM.cs index 75ff1384d22ae0b78ed5551867ff10b83a130730..3d26a79100fcf02a84c8af094b367755932e7865 100644 --- a/UI/ViewModels/ChartPageVM.cs +++ b/UI/ViewModels/ChartPageVM.cs @@ -174,15 +174,17 @@ namespace UI.ViewModels foreach (var item in list) { var category = categorys.GetCategory(item.CategoryID); - - chartData.Add(new ChartsDataModel() + if (category != null) { + chartData.Add(new ChartsDataModel() + { - Name = category.Name, - Icon = category.IconFile, - Values = item.Values, - ColumnNames = weekNames - }); + Name = category.Name, + Icon = category.IconFile, + Values = item.Values, + ColumnNames = weekNames + }); + } } Data = chartData; @@ -209,14 +211,16 @@ namespace UI.ViewModels foreach (var item in list) { var category = categorys.GetCategory(item.CategoryID); - - chartData.Add(new ChartsDataModel() + if (category != null) { + chartData.Add(new ChartsDataModel() + { - Name = category.Name, - Icon = category.IconFile, - Values = item.Values, - }); + Name = category.Name, + Icon = category.IconFile, + Values = item.Values, + }); + } } Data = chartData; @@ -246,15 +250,17 @@ namespace UI.ViewModels foreach (var item in list) { var category = categorys.GetCategory(item.CategoryID); - - chartData.Add(new ChartsDataModel() + if (category != null) { + chartData.Add(new ChartsDataModel() + { - Name = category.Name, - Icon = category.IconFile, - Values = item.Values, - ColumnNames = names - }); + Name = category.Name, + Icon = category.IconFile, + Values = item.Values, + ColumnNames = names + }); + } } Data = chartData; @@ -307,7 +313,7 @@ namespace UI.ViewModels var bindModel = new ChartsDataModel(); bindModel.Data = item; - bindModel.Name = item.AppModel?.Name; + bindModel.Name = item.AppModel?.Description; bindModel.Value = item.Time; bindModel.Tag = Timer.Fromat(item.Time); bindModel.PopupText = item.AppModel?.File; diff --git a/UI/ViewModels/DataPageVM.cs b/UI/ViewModels/DataPageVM.cs index eb3b5246a26e560798fa35e42274f6cc1a090753..36a5223a56d579d8ff61b9b591b3d8e9d8cdc7bf 100644 --- a/UI/ViewModels/DataPageVM.cs +++ b/UI/ViewModels/DataPageVM.cs @@ -181,7 +181,7 @@ namespace UI.ViewModels var bindModel = new ChartsDataModel(); bindModel.Data = item; - bindModel.Name = item.AppModel?.Name; + bindModel.Name = item.AppModel?.Description; bindModel.Value = item.Time; bindModel.Tag = Timer.Fromat(item.Time); bindModel.PopupText = item.AppModel?.File; diff --git a/UI/ViewModels/DetailPageVM.cs b/UI/ViewModels/DetailPageVM.cs index 4211e810cd9bcd24bf2b4d3cabe3451fe94d3905..6820b73c45174012e02d03d59344ae32e58ed3f2 100644 --- a/UI/ViewModels/DetailPageVM.cs +++ b/UI/ViewModels/DetailPageVM.cs @@ -79,7 +79,7 @@ namespace UI.ViewModels } else { - main.Toast("进程文件似乎不存在", Controls.Window.ToastType.Error, Controls.Base.IconTypes.Blocked); + main.Toast("应用文件似乎不存在", Controls.Window.ToastType.Error, Controls.Base.IconTypes.Blocked); } break; case "open exe": @@ -89,7 +89,7 @@ namespace UI.ViewModels } else { - main.Toast("进程文件似乎不存在", Controls.Window.ToastType.Error, Controls.Base.IconTypes.Blocked); + main.Toast("应用似乎不存在", Controls.Window.ToastType.Error, Controls.Base.IconTypes.Blocked); } break; } @@ -241,7 +241,7 @@ namespace UI.ViewModels if (monthData.Count > 0) { var longDayData = monthData.OrderByDescending(m => m.Time).FirstOrDefault(); - LongDay = longDayData.Date.ToString("最长一天是在 dd 日,使用了 " + Timer.Fromat(longDayData.Time)); + LongDay = longDayData.Date.ToString("最长一天是在 dd 号,使用了 " + Timer.Fromat(longDayData.Time)); } @@ -293,7 +293,7 @@ namespace UI.ViewModels { var bindModel = new ChartsDataModel(); bindModel.Data = item; - bindModel.Name = item.AppModel.Name; + bindModel.Name = item.AppModel.Description; bindModel.Value = item.Time; bindModel.Tag = Timer.Fromat(item.Time); bindModel.PopupText = item.AppModel.File; diff --git a/UI/ViewModels/IndexPageVM.cs b/UI/ViewModels/IndexPageVM.cs index e92891b046294e3d3359dfc05b96b426a5e3c99f..684b42bd1684f4869f61f88afdd1900b542332e2 100644 --- a/UI/ViewModels/IndexPageVM.cs +++ b/UI/ViewModels/IndexPageVM.cs @@ -93,37 +93,57 @@ namespace UI.ViewModels #region 读取数据 #region 本周数据 - private async void LoadThisWeekData() + private void LoadThisWeekData() { + //IsLoading = true; + + //var task = Task.Run(() => + // { + // var list = data.GetThisWeeklogList(); + // var res = MapToChartsData(list); + // IsLoading = false; + // return res; + + // }); + + //WeekData = await task; IsLoading = true; - var task = Task.Run(() => - { - var list = data.GetThisWeeklogList(); - var res = MapToChartsData(list); - IsLoading = false; - return res; + Task.Run(() => + { + var list = data.GetThisWeeklogList(); + var res = MapToChartsData(list); + IsLoading = false; + WeekData = res; + }); - }); - WeekData = await task; } #endregion #region 上周数据 - private async void LoadLastWeekData() + private void LoadLastWeekData() { + //IsLoading = true; + //var task = Task.Run(() => + // { + // var list = data.GetLastWeeklogList(); + // var res = MapToChartsData(list); + // IsLoading = false; + // return res; + // }); + //WeekData = await task; IsLoading = true; - var task = Task.Run(() => - { - var list = data.GetLastWeeklogList(); - var res = MapToChartsData(list); - IsLoading = false; - return res; - }); - WeekData = await task; + Task.Run(() => + { + var list = data.GetLastWeeklogList(); + var res = MapToChartsData(list); + IsLoading = false; + WeekData = res; + }); + } #endregion @@ -136,7 +156,7 @@ namespace UI.ViewModels { var bindModel = new ChartsDataModel(); bindModel.Data = item; - bindModel.Name = item.AppModel?.Name; + bindModel.Name = item.AppModel?.Description; bindModel.Value = item.Time; bindModel.Tag = Timer.Fromat(item.Time); bindModel.PopupText = item.AppModel?.File; diff --git a/UI/Views/CategoryAppListPage.xaml b/UI/Views/CategoryAppListPage.xaml index 9cec77e11187c1c444409b619c3709b8ade82096..598ef66a7e18a1cb5b9865a18a14fc011ea1bf0f 100644 --- a/UI/Views/CategoryAppListPage.xaml +++ b/UI/Views/CategoryAppListPage.xaml @@ -53,8 +53,9 @@ - - + + + @@ -84,6 +85,9 @@ + + + @@ -110,12 +114,18 @@ - - - - + + + + + + + + + + - + @@ -147,7 +157,7 @@ - + diff --git a/UI/Views/CategoryPage.xaml b/UI/Views/CategoryPage.xaml index b44a308bd75b4814d62723cae5422f86c404392a..e978f98cbba5553032b1508a9484d341e82bee1a 100644 --- a/UI/Views/CategoryPage.xaml +++ b/UI/Views/CategoryPage.xaml @@ -53,6 +53,9 @@ + + + @@ -92,12 +95,17 @@ - - - - - - + + + + + + + + + + + @@ -130,7 +138,7 @@ - + diff --git a/UI/Views/ChartPage.xaml b/UI/Views/ChartPage.xaml index 2b210c75a5ebd24dda6382271a80a93efe67a87d..2534d7deffd553a92aca410af1b547b3af9bf601 100644 --- a/UI/Views/ChartPage.xaml +++ b/UI/Views/ChartPage.xaml @@ -11,8 +11,8 @@ - - + + diff --git a/UI/Views/DataPage.xaml b/UI/Views/DataPage.xaml index b9d5e089052d3f2cbc26fbfa72a0fa4faa114fbf..8c6fdabf2a442cf10f7f06d593e45e9b41cd7d9c 100644 --- a/UI/Views/DataPage.xaml +++ b/UI/Views/DataPage.xaml @@ -19,14 +19,14 @@ - + diff --git a/UI/Views/DetailPage.xaml b/UI/Views/DetailPage.xaml index 3ea7167bc26a131e7026d971ad7c2d958678b086..4e476abfe39f0edb9984a1882da866d12bc28bba 100644 --- a/UI/Views/DetailPage.xaml +++ b/UI/Views/DetailPage.xaml @@ -21,10 +21,10 @@ Padding="0,20"> - - - - + + + + @@ -34,9 +34,9 @@ - + - + - + - + - - + + - + + + + + - 忽略此进程 - 取消忽略此进程 + 忽略此应用 + 取消忽略 @@ -113,7 +117,7 @@ - 清空统计 + 清空统计 diff --git a/UI/Views/IndexPage.xaml b/UI/Views/IndexPage.xaml index 8d8995e77905672b8216cd523cb8ab72afd4cbad..1a72b708abbb6f8cecfa614cbf8d33e7c74513b3 100644 --- a/UI/Views/IndexPage.xaml +++ b/UI/Views/IndexPage.xaml @@ -24,8 +24,8 @@ --> - - + + diff --git a/UI/Views/SettingPage.xaml b/UI/Views/SettingPage.xaml index 3a430980b2ede9002c550c0da90dde1414a2bd98..3611b2d181cb5772f64f8d5a1f36c35be05325bb 100644 --- a/UI/Views/SettingPage.xaml +++ b/UI/Views/SettingPage.xaml @@ -15,12 +15,12 @@ - + @@ -51,7 +51,7 @@ - +