Пример #1
0
        public UserWindowViewModel(ChildWindow aChildWindow, UserWindowType aUserWindowType, UserEntity aUserEntity)
        {
            childWindow    = aChildWindow;
            userWindowType = aUserWindowType;
            UserEntity     = aUserEntity;
            if (aUserWindowType == UserWindowType.ADD)
            {
                Title = "添加用户";
            }
            else
            {
                Title = "修改用户 用户名:" + UserEntity.UserName;
            }

            OnOK     = new DelegateCommand(onOK);
            OnCancel = new DelegateCommand(onCancel);
            OnClose  = new DelegateCommand(onClose);
        }
        public UserWindowViewModel(ChildWindow aChildWindow, UserWindowType aUserWindowType, UserEntity aUserEntity)
        {
            childWindow = aChildWindow;
            userWindowType = aUserWindowType;
            UserEntity = aUserEntity;
            if( aUserWindowType == UserWindowType.ADD )
            {
                Title = "添加用户";
            }
            else
            {
                Title = "修改用户 用户名:" + UserEntity.UserName;
            }

            OnOK = new DelegateCommand(onOK);
            OnCancel = new DelegateCommand(onCancel);
            OnClose = new DelegateCommand(onClose);
        }
 public UserWindow(UserWindowType aUserWindowType, UserEntity aUserEntity)
 {
     InitializeComponent();
     this.DataContext = new UserWindowViewModel(this, aUserWindowType, aUserEntity);
 }
Пример #4
0
 public UserWindow(UserWindowType aUserWindowType, UserEntity aUserEntity)
 {
     InitializeComponent();
     this.DataContext = new UserWindowViewModel(this, aUserWindowType, aUserEntity);
 }