Use base Trigger in existing classes

This commit is contained in:
Nigel Sampson 2016-06-04 22:27:06 +12:00
Родитель 47bc20f3e3
Коммит d03363c002
2 изменённых файлов: 2 добавлений и 58 удалений

Просмотреть файл

@ -12,18 +12,8 @@ namespace Microsoft.Xaml.Interactions.Core
/// A behavior that performs actions when the bound data meets a specified condition.
/// </summary>
[ContentPropertyAttribute(Name = "Actions")]
public sealed class DataTriggerBehavior : Behavior
public sealed class DataTriggerBehavior : Trigger
{
/// <summary> q
/// Identifies the <seealso cref="Actions"/> dependency property.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
public static readonly DependencyProperty ActionsProperty = DependencyProperty.Register(
"Actions",
typeof(ActionCollection),
typeof(DataTriggerBehavior),
new PropertyMetadata(null));
/// <summary>
/// Identifies the <seealso cref="Binding"/> dependency property.
/// </summary>
@ -55,24 +45,6 @@ namespace Microsoft.Xaml.Interactions.Core
typeof(DataTriggerBehavior),
new PropertyMetadata(null, new PropertyChangedCallback(DataTriggerBehavior.OnValueChanged)));
/// <summary>
/// Gets the collection of actions associated with the behavior. This is a dependency property.
/// </summary>
public ActionCollection Actions
{
get
{
ActionCollection actionCollection = (ActionCollection)this.GetValue(DataTriggerBehavior.ActionsProperty);
if (actionCollection == null)
{
actionCollection = new ActionCollection();
this.SetValue(DataTriggerBehavior.ActionsProperty, actionCollection);
}
return actionCollection;
}
}
/// <summary>
/// Gets or sets the bound object that the <see cref="DataTriggerBehavior"/> will listen to. This is a dependency property.
/// </summary>

Просмотреть файл

@ -15,18 +15,8 @@ namespace Microsoft.Xaml.Interactions.Core
/// A behavior that listens for a specified event on its source and executes its actions when that event is fired.
/// </summary>
[ContentPropertyAttribute(Name = "Actions")]
public sealed class EventTriggerBehavior : Behavior
public sealed class EventTriggerBehavior : Trigger
{
/// <summary>
/// Identifies the <seealso cref="Actions"/> dependency property.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
public static readonly DependencyProperty ActionsProperty = DependencyProperty.Register(
"Actions",
typeof(ActionCollection),
typeof(EventTriggerBehavior),
new PropertyMetadata(null));
/// <summary>
/// Identifies the <seealso cref="EventName"/> dependency property.
/// </summary>
@ -61,24 +51,6 @@ namespace Microsoft.Xaml.Interactions.Core
{
}
/// <summary>
/// Gets the collection of actions associated with the behavior. This is a dependency property.
/// </summary>
public ActionCollection Actions
{
get
{
ActionCollection actionCollection = (ActionCollection)this.GetValue(EventTriggerBehavior.ActionsProperty);
if (actionCollection == null)
{
actionCollection = new ActionCollection();
this.SetValue(EventTriggerBehavior.ActionsProperty, actionCollection);
}
return actionCollection;
}
}
/// <summary>
/// Gets or sets the name of the event to listen for. This is a dependency property.
/// </summary>