Ai
7 Star 81 Fork 20

CookCSharp/CookPopularUI

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
DialogBoxDemoViewModel.cs 1.39 KB
一键复制 编辑 原始数据 按行查看 历史
写代码的厨子 提交于 2023-12-21 10:12 +08:00 . update demo folder name
/*
*Description: DialogBoxDemoViewModel
*Author: Chance.zheng
*Creat Time: 2023/11/10 14:09:58
*.Net Version: 6.0
*CLR Version: 4.0.30319.42000
*Copyright © CookCSharp 2023 All Rights Reserved.
*/
using CookPopularUI.WPF.Controls;
using CookPopularUI.WPFDemo.UserControls;
using Prism.Commands;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CookPopularUI.WPFDemo.ViewModels
{
public class DialogBoxDemoViewModel : ViewModelBase
{
public string Text { get; set; } = "写代码的厨子";
public string InternalText { get; set; } = "Chance";
public DelegateCommand OpenCommand => new Lazy<DelegateCommand>(() => new DelegateCommand(() => OnOpenActionAsync())).Value;
public DelegateCommand OpenInternalCommand => new Lazy<DelegateCommand>(() => new DelegateCommand(() => OnOpenInternalAction())).Value;
private async void OnOpenActionAsync()
{
Text = await DialogBox.Show<DialogContentView>().Initialize<DialogContentViewModel>(vm => { vm.Result = Text; }).GetResultAsync<string>();
}
private async void OnOpenInternalAction()
{
InternalText = await DialogBox.Show<DialogContentView>("DialogBoxContainer").Initialize<DialogContentViewModel>(vm => { vm.Result = InternalText; }).GetResultAsync<string>();
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/CookCSharp/CookPopularUI.git
git@gitee.com:CookCSharp/CookPopularUI.git
CookCSharp
CookPopularUI
CookPopularUI
master

搜索帮助