新建RadioButtonEx.cs public class RadioButtonEx : RadioButton { public Geometry SelectIcon { get { return (Geometry)GetValue(SelectIconProperty); } set { SetValue(SelectIconProperty, value); } } // Using a DependencyProperty as the backing store for Se
模型 public class people { public string name{get;set;} public bool? sex{get;set;} } 转换器 namespace Helper { public class StringRadioConvert : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.
1. 枚举类 public enum EnumDataTypes { Simulation, Test } 2. 枚举型与布尔型的转换 public class EnumToBooleanConverter : IValueConverter { /// <inheritdoc/> public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return value
在主窗体上点击菜单时,如果做到每个窗体不会被重复打开,如果打开了,可以将其重新获得焦点. 首先在主窗体中将菜单关联的窗体实例化. 第二步:将每个菜单对应窗体的closing事件重写.之所以要重写closing事件,是因为在菜单对应的窗口关闭之后,再次打开就会报错 第三步:在主窗体中菜单事件里面进行判断处理 栗子如下: public partial class main : Window { //实例化关联的窗口 MainWindow m = new MainWi