/// <summary> /// 生成命令对象 /// </summary> /// <returns></returns> protected NotificationList <CommandItemBase> CreateCommands(bool edit, bool create, bool ext) { NotificationList <CommandItemBase> commands = new NotificationList <CommandItemBase>(); if (edit) { commands.Add(new CommandItem { IsButton = true, NoConfirm = true, Action = CopyColumns, Caption = "复制列", Image = Application.Current.Resources["tree_item"] as ImageSource }); commands.Add(new CommandItem { IsButton = true, Action = PasteColumns, NoConfirm = true, Caption = "粘贴列", Image = Application.Current.Resources["tree_item"] as ImageSource }); commands.Add(new CommandItem { IsButton = true, Action = ClearColumns, Caption = "清除列", Image = Application.Current.Resources["img_del"] as ImageSource }); commands.Add(new CommandItem { IsButton = true, Action = DeleteColumns, Caption = "删除所选列", Image = Application.Current.Resources["img_del"] as ImageSource }); commands.Add(new CommandItem { IsButton = true, Action = AddProperty, NoConfirm = true, Caption = "新增字段", Image = Application.Current.Resources["tree_Open"] as ImageSource }); } if (create) { CreateCommands(commands); } if (ext) { var extends = CommandCoefficient.CoefficientEditor(typeof(EntityConfig), EditorName); if (extends.Count > 0) { commands.AddRange(extends); } } return(commands); }
private async Task Init() { var notifications = await _notificationService.Get <List <Model.Notification> >(new NotificationSearchRequest() { UserId = APIService.loggedProfile.UserId }); var sorted = notifications.OrderByDescending(a => a.NotifDateTime).ToList(); NotificationList.AddRange(sorted); NotifInt = notifications.Count; NotificationNumber = "Notifications: " + NotifInt.ToString(); }