Пример #1
0
 private void btnModifyGroupName_Click(object sender, RoutedEventArgs e)
 {
     if (this.DataContext is GroupViewModel groupVM)
     {
         GroupModel group    = groupVM.Model as GroupModel;
         string     newValue = EditStringValueWindow.ShowInstance(group.DisplayName, "修改群名称");
         EditStringValueWindow.Win.GroupNameEvent -= EditStringValueWindow_GroupNameEvent;
         EditStringValueWindow.Win.GroupNameEvent += EditStringValueWindow_GroupNameEvent;
     }
 }
Пример #2
0
        private void miChangeGroupName_Click(object sender, RoutedEventArgs e)
        {
            if (sender is MenuItem item && item.DataContext is GroupViewModel groupVM)
            {
                tempGroupViewModel = groupVM;
                GroupModel group = groupVM.Model as GroupModel;

                string newValue = EditStringValueWindow.ShowInstance(group.DisplayName, "修改群名称");
                EditStringValueWindow.Win.GroupNameEvent -= EditStringValueWindow_GroupNameEvent;
                EditStringValueWindow.Win.GroupNameEvent += EditStringValueWindow_GroupNameEvent;
            }
        }