wpf监听依赖属性变化 可实现监听窗口位置变化
DependencyPropertyDescriptor descriptor;
descriptor = DependencyPropertyDescriptor.FromProperty(LeftProperty, typeof(Window));
//第一个对象为触发变化的对象
descriptor.AddValueChanged(this, (o, handle) =>
{
var left = this.Left;
Trace.TraceInformation(left.ToString());
});
留待后查,同时方便他人
联系我:renhanlinbsl@163.com
联系我:renhanlinbsl@163.com