/// <summary> /// 开始选择答题 /// </summary> /// <param name="parentWindow"></param> /// <param name="fromPage"></param> /// <param name="user"></param> //private void Select(Type fromPage, User user) { // if (_user != null) { // _user.LevelChanged -= UserLevelChangedFun; // } // FromPage = fromPage; // _user = user; // user.LevelChanged += UserLevelChangedFun; // SelList.ItemsSource = StoreRoom.GetCreaters(user); // labUserName.Text = user.NickName; //} protected override void OnNavigatedTo(NavigationEventArgs e) { if (_user != null) { _user.LevelChanged -= UserLevelChangedFun; } Info info = e.Parameter as Info; if (info == null) { ShowMsg("错误的启动信息!"); } else { FromPage = info.FromPage; _user = info.User; _user.LevelChanged += UserLevelChangedFun; SelList.ItemsSource = StoreRoom.GetCreaters(_user); labUserName.Text = _user.NickName; if (info.Message != null) { ShowMsg(info.Message); } } //开始动画 foreach (var item in this.Resources.Values) { Storyboard story = item as Storyboard; if (story != null) { story.Begin(); } } }
/// <summary> /// 用户等级改变时方法 /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void UserLevelChangedFun(User sender, object[] args) { SelList.ItemsSource = StoreRoom.GetCreaters(_user); }