Files
2026-04-30 11:34:41 +08:00

57 lines
1.4 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using SamplePre.UIWpf.BaseWindows;
using SamplePreSystem.UI.BaseControls;
using SamplePreSystem.UI.ViewModel.ConfigManager;
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.Shapes;
namespace SamplePre.UIWpf.ConfigManager.chirld
{
/// <summary>
/// NewUserWindow.xaml 的交互逻辑
/// </summary>
public partial class NewUserWindow : BaseWindow
{
public NewUserWindow(UsersViewModel vm)
{
InitializeComponent();
vm.CloseAction = (val) => DialogResult = val;
this.DataContext = vm;
}
private void ckbRole_Click(object sender, RoutedEventArgs e)
{
e.Handled = true;
UpdateSelectedText();
}
// 把选中的项显示在文本框中
private void UpdateSelectedText()
{
var selected = cmbRole.ItemsSource.Cast<dynamic>()
.Where(x => x.IsSelected == true)
.Select(x => x.name);
txtSelectedRoles.Text = string.Join("", selected);
}
private void btnCancel_Click(object sender, RoutedEventArgs e)
{
UpdateSelectedText();
}
}
}