Explorar o código

Prism可用OnPropertyChanged通知变量改变

tanghai %!s(int64=11) %!d(string=hai) anos
pai
achega
324a68e4bd
Modificáronse 1 ficheiros con 3 adicións e 4 borrados
  1. 3 4
      CSharp/App/Modules/Tree/TreeNodeViewModel.cs

+ 3 - 4
CSharp/App/Modules/Tree/TreeNodeViewModel.cs

@@ -116,9 +116,8 @@ namespace Tree
 				{
 					return;
 				}
-				double x = 0;
-				this.SetProperty(ref x, value);
 				this.treeNode.X = value;
+				this.OnPropertyChanged("X");
 
 				this.ConnectorX2 = Width / 2 + this.Parent.X - this.X;
 
@@ -141,9 +140,9 @@ namespace Tree
 				{
 					return;
 				}
-				double y = 0;
-				this.SetProperty(ref y, value);
+
 				this.treeNode.Y = value;
+				this.OnPropertyChanged("Y");
 
 				this.ConnectorY2 = Height + this.Parent.Y - this.Y;