|
@@ -64,8 +64,16 @@ namespace PDF_Master.CustomControl.CompositeControl
|
|
|
get { return _content; }
|
|
|
private set { SetProperty(ref _content, value); }
|
|
|
}
|
|
|
-
|
|
|
- //下拉框显示的内容+单位:限数字值的单位
|
|
|
+
|
|
|
+ private FontFamily fontFamily = new FontFamily("Arial");
|
|
|
+
|
|
|
+ public FontFamily FontFamily
|
|
|
+ {
|
|
|
+ get { return fontFamily; }
|
|
|
+ set { SetProperty(ref fontFamily, value); }
|
|
|
+ }
|
|
|
+
|
|
|
+ //下拉框显示的内容+单位:限数字值的单位
|
|
|
public string Unit { get; private set; }
|
|
|
|
|
|
//数字类型
|
|
@@ -351,8 +359,7 @@ namespace PDF_Master.CustomControl.CompositeControl
|
|
|
index = control.Items.IndexOf(temp);
|
|
|
|
|
|
if (index >= 0)
|
|
|
- {
|
|
|
-
|
|
|
+ {
|
|
|
//为了改变值时选项跟着改变,但是值并没有时时刻刻改变,且影响其他事件展示注释掉 2023/4/4
|
|
|
//if (control.SelectedIndex != index)
|
|
|
//{
|
|
@@ -399,22 +406,20 @@ namespace PDF_Master.CustomControl.CompositeControl
|
|
|
{
|
|
|
//删掉了selectedIndex != -1,设置不选中任何选项的情况
|
|
|
//删掉了control.SelectedItems = null;避免崩溃
|
|
|
- if (control.comBox.Items != null && control.comBox.Items.Count > 0 )
|
|
|
+ if (control.comBox.Items != null && control.comBox.Items.Count > 0)
|
|
|
{
|
|
|
control.comBox.SelectedIndex = selectedIndex;
|
|
|
if (control.comBox.SelectedItem != null)
|
|
|
{
|
|
|
- if(control.comBox.SelectedItem is ComboDataItem comboDataItem)
|
|
|
+ if (control.comBox.SelectedItem is ComboDataItem comboDataItem)
|
|
|
{
|
|
|
bool isEqual = EqualityComparer<ComboDataItem>.Default.Equals(comboDataItem, control.SelectedItems);
|
|
|
- if (isEqual==false)
|
|
|
+ if (isEqual == false)
|
|
|
{
|
|
|
control.SelectedItems = (ComboDataItem)control.comBox.SelectedItem;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+ }
|
|
|
}
|
|
|
control.UpdateSelectedIndex();
|
|
|
}
|