Browse Source

Renamed OnDataContextFinishedChanging

To OnDataContextChanged and added DataContextChanged event.
pull/342/merge
Steven Kirk 11 years ago
parent
commit
195fb6df3b
  1. 14
      src/Perspex.Controls/Control.cs
  2. 2
      src/Perspex.Controls/Primitives/SelectingItemsControl.cs

14
src/Perspex.Controls/Control.cs

@ -93,6 +93,15 @@ namespace Perspex.Controls
_nameScope = this as INameScope;
}
/// <summary>
/// Occurs when the <see cref="DataContext"/> property changes.
/// </summary>
/// <remarks>
/// This event will be raised when the <see cref="DataContext"/> property has changed and
/// all subscribers to that change have been notified.
/// </remarks>
public event EventHandler DataContextChanged;
/// <summary>
/// Gets or sets the control's classes.
/// </summary>
@ -394,8 +403,9 @@ namespace Perspex.Controls
/// Called when the <see cref="DataContext"/> is changed and all subscribers to that change
/// have been notified.
/// </summary>
protected virtual void OnDataContextFinishedChanging()
protected virtual void OnDataContextChanged()
{
DataContextChanged?.Invoke(this, EventArgs.Empty);
}
/// <summary>
@ -422,7 +432,7 @@ namespace Perspex.Controls
if (!notifying)
{
control.OnDataContextFinishedChanging();
control.OnDataContextChanged();
}
}
}

2
src/Perspex.Controls/Primitives/SelectingItemsControl.cs

@ -287,7 +287,7 @@ namespace Perspex.Controls.Primitives
}
/// <inheritdoc/>
protected override void OnDataContextFinishedChanging()
protected override void OnDataContextChanged()
{
if (_clearSelectedItemsAfterDataContextChanged == SelectedItems)
{

Loading…
Cancel
Save