using BPASmartClient.CustomResource.Pages.Enums; using BPASmartClient.CustomResource.Pages.ViewModel; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace BPASmartClient.CustomResource.Pages.View { /// /// UserManageView.xaml 的交互逻辑 /// public partial class UserManageView : UserControl { public UserManageView() { InitializeComponent(); //this.DataContext = UserManageViewModel.GetInstance; } private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBox cbo = sender as ComboBox; var id = cbo.Tag; var per = cbo.SelectedItem; if (id != null) { var a = UserManageViewModel.usersInfo.FirstOrDefault(p => p.Id == id.ToString()); if (a != null && per != null) { a.permission = (Permission)Enum.Parse(typeof(Permission), per.ToString()); } } //else //{ // if (UserManageViewModel.usersInfo.Last().permission.ToString() == null) // UserManageViewModel.usersInfo.Last().permission = (Permission)Enum.Parse(typeof(Permission), per.ToString()); //} } } }