|
|
@@ -29,7 +29,6 @@ namespace TeamAAS_VP.Controls
|
|
|
public ParameterEdit()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
- DataContext = this;
|
|
|
}
|
|
|
|
|
|
private ProductGlobalParam _SelectParam;
|
|
|
@@ -37,7 +36,7 @@ namespace TeamAAS_VP.Controls
|
|
|
public ProductGlobalParam SelectParam
|
|
|
{
|
|
|
get { return _SelectParam; }
|
|
|
- set { SetProperty(ref _SelectParam,value); }
|
|
|
+ set { SetProperty(ref _SelectParam, value); }
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -49,7 +48,7 @@ namespace TeamAAS_VP.Controls
|
|
|
nameof(GlobalParamListCollection),
|
|
|
typeof(ObservableCollection<ProductGlobalParam>),
|
|
|
typeof(ParameterEdit),
|
|
|
- new PropertyMetadata(new ObservableCollection<ProductGlobalParam>()));
|
|
|
+ new PropertyMetadata(null));
|
|
|
|
|
|
/// <summary>
|
|
|
/// 公开可绑定属性
|
|
|
@@ -70,6 +69,8 @@ namespace TeamAAS_VP.Controls
|
|
|
|
|
|
void ExecuteRemoveCommand(ProductGlobalParam param)
|
|
|
{
|
|
|
+ if (param == null || GlobalParamListCollection == null) return;
|
|
|
+
|
|
|
GlobalParamListCollection.Remove(param);
|
|
|
for (int i = 0; i < GlobalParamListCollection.Count; i++)
|
|
|
{
|
|
|
@@ -79,7 +80,12 @@ namespace TeamAAS_VP.Controls
|
|
|
|
|
|
void ExecuteAddCommand()
|
|
|
{
|
|
|
- GlobalParamListCollection.Add(new ProductGlobalParam() { Number= GlobalParamListCollection .Count});
|
|
|
+ if (GlobalParamListCollection == null)
|
|
|
+ {
|
|
|
+ GlobalParamListCollection = new ObservableCollection<ProductGlobalParam>();
|
|
|
+ }
|
|
|
+
|
|
|
+ GlobalParamListCollection.Add(new ProductGlobalParam() { Number = GlobalParamListCollection.Count });
|
|
|
}
|
|
|
#region 属性通知
|
|
|
/// <summary>
|