/// <summary> /// 新增用户 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ButtonAddUserClick(object sender, RoutedEventArgs e) { var listType = MyListView.ItemsSource as List <string>; if (object.Equals(listType, null) || listType.Count < 1) { MessageBox.Show("请先新建一个分类"); return; } var currentType = MyListView.SelectedIndex == -1 ? string.Empty : MyListView.SelectedItem.ToString(); frmNewNote frm = new frmNewNote(listType, _currentUser, currentType); DoubleAnimation animFadeIn = new DoubleAnimation(); animFadeIn.From = 0; animFadeIn.To = 1; animFadeIn.Duration = new Duration(TimeSpan.FromSeconds(2)); frm.BeginAnimation(Window.OpacityProperty, animFadeIn); //window.ShowDialog(); if (frm.ShowDialog() == true) { Refresh(); } }