WPF Prism v4 MVVM

1.Install-package Prism -v 4

2.

1 using Microsoft.Practices.Prism;
2 using Microsoft.Practices.Prism.Commands;
3 using Microsoft.Practices.Prism.Events;
4 using Microsoft.Practices.Prism.Interactivity;
5 using Microsoft.Practices.Prism.Modularity;
6 using Microsoft.Practices.Prism.Logging;
7 using Microsoft.Practices.Prism.Regions;
8 using Microsoft.Practices.Prism.ViewModel;

3.

private DelegateCommand<object> clickCmd;
        public DelegateCommand<object> ClickCmd
        {
            get
            {
                if(clickCmd==null)
                {
                    clickCmd = new DelegateCommand<object>(ClickCmdExecuted);
                }
                return clickCmd;
            }
        }

        private void ClickCmdExecuted(object obj)
        {
            System.Windows.MessageBox.Show(obj.ToString());
        }

 

posted @ 2021-03-13 20:37  FredGrit  阅读(85)  评论(1编辑  收藏  举报