diff --git a/Stylet/ActionCommand.cs b/Stylet/ActionCommand.cs index 02f3688..872f361 100644 --- a/Stylet/ActionCommand.cs +++ b/Stylet/ActionCommand.cs @@ -29,7 +29,7 @@ namespace Stylet this.UpdateGuardHandler(); - DependencyPropertyDescriptor.FromProperty(View.TargetProperty, typeof(View)).AddValueChanged(this.subject, (o, e) => this.UpdateGuardHandler()); + DependencyPropertyDescriptor.FromProperty(View.ActionTargetProperty, typeof(View)).AddValueChanged(this.subject, (o, e) => this.UpdateGuardHandler()); } private string GuardName @@ -39,7 +39,7 @@ namespace Stylet private void UpdateGuardHandler() { - var newTarget = View.GetTarget(this.subject); + var newTarget = View.GetActionTarget(this.subject); MethodInfo targetMethodInfo = null; this.guardPropertyGetter = null; diff --git a/Stylet/EventCommand.cs b/Stylet/EventCommand.cs index 70e58c4..9923035 100644 --- a/Stylet/EventCommand.cs +++ b/Stylet/EventCommand.cs @@ -35,7 +35,7 @@ namespace Stylet private void InvokeCommand(object sender, RoutedEventArgs e) { - var target = View.GetTarget(this.subject); + var target = View.GetActionTarget(this.subject); if (target == null) throw new Exception("Target not set"); diff --git a/Stylet/View.cs b/Stylet/View.cs index 614afb3..113a5e9 100644 --- a/Stylet/View.cs +++ b/Stylet/View.cs @@ -13,21 +13,18 @@ namespace Stylet { static readonly ContentPropertyAttribute DefaultContentProperty = new ContentPropertyAttribute("Content"); - public static object GetTarget(DependencyObject obj) + public static object GetActionTarget(DependencyObject obj) { - return (object)obj.GetValue(TargetProperty); + return (object)obj.GetValue(ActionTargetProperty); } - public static void SetTarget(DependencyObject obj, object value) + public static void SetActionTarget(DependencyObject obj, object value) { - obj.SetValue(TargetProperty, value); + obj.SetValue(ActionTargetProperty, value); } - // Using a DependencyProperty as the backing store for Target. This enables animation, styling, binding, etc... - public static readonly DependencyProperty TargetProperty = - DependencyProperty.RegisterAttached("Target", typeof(object), typeof(View), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits)); - - + public static readonly DependencyProperty ActionTargetProperty = + DependencyProperty.RegisterAttached("ActionTarget", typeof(object), typeof(View), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits)); public static object GetModel(DependencyObject obj) { @@ -39,7 +36,6 @@ namespace Stylet obj.SetValue(ModelProperty, value); } - // Using a DependencyProperty as the backing store for Model. This enables animation, styling, binding, etc... public static readonly DependencyProperty ModelProperty = DependencyProperty.RegisterAttached("Model", typeof(object), typeof(View), new PropertyMetadata(null, (d, e) => IoC.Get().OnModelChanged(d, e) )); diff --git a/Stylet/ViewManager.cs b/Stylet/ViewManager.cs index 75b618c..eb015c3 100644 --- a/Stylet/ViewManager.cs +++ b/Stylet/ViewManager.cs @@ -71,7 +71,7 @@ namespace Stylet public virtual void BindViewToModel(UIElement view, object viewModel) { - View.SetTarget(view, viewModel); + View.SetActionTarget(view, viewModel); var viewAsFrameworkElement = view as FrameworkElement; if (viewAsFrameworkElement != null)