Example #1
0
        public UserWindow(int userId)
        {
            InitializeComponent();
            User = User.ReadById(userId);
            UserShow userShow = new UserShow(User);

            grdElement.Children.Add(userShow);
        }
Example #2
0
        private void ChangeState(MachineState state)
        {
            grdElement.Children.Clear();
            UserControl uc = null;

            switch (state)
            {
            case MachineState.Read:
                uc = new UserShow(User);
                break;

            case MachineState.Update:
                if (_userUpdate == null)
                {
                    _userUpdate = new UserUpdate(User);
                }
                uc = _userUpdate;
                break;
            }

            grdElement.Children.Add(uc);
        }