public UserWindow(int userId) { InitializeComponent(); User = User.ReadById(userId); UserShow userShow = new UserShow(User); grdElement.Children.Add(userShow); }
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); }