天天看点

Prism 应用系列(五) prism 架构中,如何将对象从一个ViewModel(或View)传递给另一个ViewModel(View)一、Notification通知(方法1)

一、Notification通知(方法1)

这种方法适合应用在弹出窗口,然后在通知中放置Content,然后在 public INotification Notification将该Content拿出来保存。

比如下面,我要将Content保存集合pipList中。

1、先放置数据集合SelectedMorePersons:

SenduNotification senduNotification = new SenduNotification();
                senduNotification.Title = "编辑";
                senduNotification.Content = SelectedMorePersons;

                //弹出窗口
                SenduNotificationRequest.Raise(senduNotification, returned =>
                {
                    if (returned != null && returned.Confirmed)
                    {
                        //更新数据库
                        //operateDataSheet.EditFunc(returned);
                        //刷新列表,重新显示
                        //PatientInfoList = operateDataSheet.GetPatientInfoFunc();
                    }