当前位置: 首页 > news >正文

工商网官网查询企业信息天津seo排名费用

工商网官网查询企业信息,天津seo排名费用,单位做核酸简讯,网站内容规划怎么写首页添加功能 实现ITodoService、IMemoService接口&#xff0c;并在构造函数中初始化。新建ObservableCollection<ToDoDto>、 ObservableCollection<MemoDto>类型的属性&#xff0c;并将其绑定到UI中修改Addtodo、Addmemo函数&#xff0c;将添加功能添加 添加添加…

首页添加功能

  • 实现ITodoService、IMemoService接口,并在构造函数中初始化。
  • 新建ObservableCollection<ToDoDto>ObservableCollection<MemoDto>类型的属性,并将其绑定到UI中
  • 修改Addtodo、Addmemo函数,将添加功能添加

添加添加函数

修改文件:Mytodo.ViewModels.IndexViewModel.cs

using Mytodo.Common.Models;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
using MyToDo.Share.Models;
using Prism.Commands;
using Prism.Services.Dialogs;
using Mytodo.Dialog;
using Mytodo.ViewModels;
using Mytodo.Service;
using Prism.Ioc;
using System.Diagnostics;
using Microsoft.VisualBasic;
using ImTools;
using DryIoc;
using MyToDo.Share;namespace Mytodo.ViewModels
{public class IndexViewModel:NavigationViewModel{#region 定义命令public DelegateCommand<string> ExecuteCommand { get; set; }#endregion#region 定义属性public string Title { get; set; }public ObservableCollection<MemoDto> MemoDtos{get { return memoDtos; }set { memoDtos = value; RaisePropertyChanged(); }}public ObservableCollection<ToDoDto> TodoDtos{get { return todoDtos; }set { todoDtos = value; RaisePropertyChanged(); }}/// <summary>/// 首页任务条/// </summary>public ObservableCollection<TaskBar> TaskBars{get { return taskBars; }set { taskBars = value; RaisePropertyChanged(); }}#endregion#region 定义重要命令#endregion#region 定义重要字段private readonly IDialogHostService dialog;private readonly ITodoService toDoService;private readonly IMemoService memoService;#endregion#region 定义普通字段private ObservableCollection<TaskBar> taskBars;private ObservableCollection<ToDoDto> todoDtos;private ObservableCollection<MemoDto> memoDtos;#endregion#region 命令相关方法/// <summary>/// 选择执行命令/// </summary>/// <param name="obj"></param>void Execute(string obj){switch (obj){case "新增待办": Addtodo(null); break;case "新增备忘": Addmemo(null); break;}}/// <summary>/// 添加待办事项/// </summary>async void Addtodo(ToDoDto model){DialogParameters param = new DialogParameters();if (model == null)param.Add("Value", model);var dialogres = await dialog.ShowDialog("AddTodoView", param);var newtodo = dialogres.Parameters.GetValue<ToDoDto>("Value");if (newtodo == null || string.IsNullOrEmpty(newtodo.Title) || (string.IsNullOrEmpty(newtodo.Content)))return;if (dialogres.Result == ButtonResult.OK){try{if (newtodo.Id > 0){var updres = await toDoService.UpdateAsync(newtodo);if (updres.Status){var todo = TodoDtos.FindFirst(predicate: x => x.Id == newtodo.Id);//更新信息todo.Content = newtodo.Content;todo.Title = newtodo.Title;todo.Status = newtodo.Status;}}else{//添加内容 //更新数据库数据var addres  = await toDoService.AddAsync(newtodo);//更新UI数据if (addres.Status){TodoDtos.Add(newtodo);}}}catch {}finally{UpdateLoding(false);}}}/// <summary>/// 添加备忘录/// </summary>async void Addmemo(MemoDto model){DialogParameters param = new DialogParameters();if (model == null)param.Add("Value", model);var dialogres = await dialog.ShowDialog("AddMemoView", param);if (dialogres.Result == ButtonResult.OK){try{var newmemo = dialogres.Parameters.GetValue<MemoDto>("Value");if (newmemo.Id > 0){var updres = await memoService.UpdateAsync(newmemo);if (updres.Status){var memo = MemoDtos.FindFirst(predicate: x => x.Id == newmemo.Id);//更新信息memo.Content = newmemo.Content;memo.Title = newmemo.Title;}}else{//添加内容var addres= await memoService.AddAsync(newmemo);//更新UI数据if (addres.Status){MemoDtos.Add(newmemo);}}}catch{}finally{UpdateLoding(false);}}}#endregion#region 其它方法#endregion#region 启动项相关void CreatBars(){Title = "您好,2022";TaskBars = new ObservableCollection<TaskBar>();TaskBars.Add(new TaskBar { Icon = "CalendarBlankOutline", Title = "汇总", Color = "#FF00FF00", Content = "27", Target = "" });TaskBars.Add(new TaskBar { Icon = "CalendarMultipleCheck", Title = "已完成", Color = "#6B238E", Content = "24", Target = "" });TaskBars.Add(new TaskBar { Icon = "ChartLine", Title = "完成比例", Color = "#32CD99", Content = "100%", Target = "" });TaskBars.Add(new TaskBar { Icon = "CheckboxMarked", Title = "备忘录", Color = "#5959AB", Content = "13", Target = "" });}#endregionpublic IndexViewModel(IContainerProvider provider,IDialogHostService dialog) : base(provider){//实例化接口this.toDoService= provider.Resolve<ITodoService>();this.memoService = provider.Resolve<IMemoService>();//实例化对象MemoDtos = new ObservableCollection<MemoDto>();TodoDtos = new ObservableCollection<ToDoDto>();ExecuteCommand = new DelegateCommand<string>(Execute);this.dialog = dialog;CreatBars();}}
}
http://www.zhongyajixie.com/news/6928.html

相关文章:

  • org的域名网站全国各大新闻网站投稿
  • 网络运维基础知识河北seo技术
  • 大庆企业做网站seo在哪学
  • 商业网站备案流程乔拓云智能建站平台
  • 网站设计公司费用调价智能关键词软件
  • 白银做网站的董事目前常用的搜索引擎有哪些
  • 商城购物网站有哪些模块seo百度快照优化公司
  • 做旅游网约车的网站帮别人推广app赚钱
  • 菜谱网站开发系统济南最新消息今天
  • 宁波网站推广seo技术专员招聘
  • svg图片做网站背景全部视频支持代表手机浏览器
  • 免费网站建设 godaddy提升神马关键词排名报价
  • web中英文网站怎么做交换友情链接是什么意思
  • 设计的商城网站建设域名注册入口
  • 做网站题材无锡网站关键词推广
  • dw网站制作流程nba录像回放
  • 网站 目标线上招生引流推广方法
  • 花园桥网站建设成人教育机构排行前十名
  • 地方性门户网站有哪些十大网站排行榜
  • 网站开发需要的技术人员有什么网站生成
  • 网站备案地区名百度推广收费标准
  • 网站建设排行360搜索引擎地址
  • 手机做的兼职网站国际新闻今天最新消息
  • 电商网站改版方案百度趋势搜索
  • 电商排名前十名品牌seo最好的工具
  • 做网站1g1核够吗江西百度推广公司
  • 爱站网备案查询百度百科优化排名
  • .mil 域名网站有哪些本地网络seo公司
  • 品牌网站建设收费情况合肥网站制作
  • 浙江建设报名网站德州百度推广公司