diff --git a/Terminal.Gui/Application/Application.cs b/Terminal.Gui/Application/Application.cs
index bd6956425..476796b77 100644
--- a/Terminal.Gui/Application/Application.cs
+++ b/Terminal.Gui/Application/Application.cs
@@ -358,7 +358,7 @@ public static partial class Application
///
/// Intended to support unit tests that need to know when the application has been initialized.
///
- public static event EventHandler> InitializedChanged;
+ public static event EventHandler> InitializedChanged;
#endregion Initialization (Init/Shutdown)
diff --git a/Terminal.Gui/View/StateEventArgs.cs b/Terminal.Gui/View/StateEventArgs.cs
index 10cb47886..cd0020fae 100644
--- a/Terminal.Gui/View/StateEventArgs.cs
+++ b/Terminal.Gui/View/StateEventArgs.cs
@@ -3,25 +3,26 @@ using System.ComponentModel;
namespace Terminal.Gui;
-/// for events that convey state changes to a class.
+///
+/// for events that convey changes to a property of type `T`.
///
-/// Events that use this class can be cancellable. The property should be set to
+/// Events that use this class can be cancellable. Where applicable, the property should be set to
/// to prevent the state change from occurring.
///
-public class StateEventArgs : CancelEventArgs
+public class CancelEventArgs : CancelEventArgs
{
- /// Creates a new instance of the class.
- ///
- ///
- public StateEventArgs (T oldValue, T newValue)
+ /// Initializes a new instance of the class.
+ /// The current (old) value of the property.
+ /// The value the property will be set to if the event is not cancelled.
+ public CancelEventArgs (T currentValue, T newValue)
{
- OldValue = oldValue;
+ CurrentValue = currentValue;
NewValue = newValue;
}
- /// The new state
+ /// The value the property will be set to if the event is not cancelled.
public T NewValue { get; set; }
- /// The previous state
- public T OldValue { get; }
+ /// The current value of the property.
+ public T CurrentValue { get; }
}
diff --git a/Terminal.Gui/View/View.cs b/Terminal.Gui/View/View.cs
index df7f242d2..3a611ecf0 100644
--- a/Terminal.Gui/View/View.cs
+++ b/Terminal.Gui/View/View.cs
@@ -492,7 +492,7 @@ public partial class View : Responder, ISupportInitializeNotification
/// The new to be replaced.
public virtual void OnTitleChanged (string oldTitle, string newTitle)
{
- StateEventArgs args = new (oldTitle, newTitle);
+ CancelEventArgs args = new (oldTitle, newTitle);
TitleChanged?.Invoke (this, args);
}
@@ -505,20 +505,20 @@ public partial class View : Responder, ISupportInitializeNotification
/// `true` if an event handler canceled the Title change.
public virtual bool OnTitleChanging (string oldTitle, string newTitle)
{
- StateEventArgs args = new (oldTitle, newTitle);
+ CancelEventArgs args = new (oldTitle, newTitle);
TitleChanging?.Invoke (this, args);
return args.Cancel;
}
/// Event fired after the has been changed.
- public event EventHandler> TitleChanged;
+ public event EventHandler> TitleChanged;
///
/// Event fired when the is changing. Set to `true`
/// to cancel the Title change.
///
- public event EventHandler> TitleChanging;
+ public event EventHandler> TitleChanging;
#endregion
}
diff --git a/Terminal.Gui/View/ViewAdornments.cs b/Terminal.Gui/View/ViewAdornments.cs
index 27223ef11..68c866e38 100644
--- a/Terminal.Gui/View/ViewAdornments.cs
+++ b/Terminal.Gui/View/ViewAdornments.cs
@@ -124,7 +124,7 @@ public partial class View
get => Border?.LineStyle ?? LineStyle.Single;
set
{
- StateEventArgs e = new (Border?.LineStyle ?? LineStyle.None, value);
+ CancelEventArgs e = new (Border?.LineStyle ?? LineStyle.None, value);
OnBorderStyleChanging (e);
}
@@ -137,7 +137,7 @@ public partial class View
/// Override to prevent the from changing.
///
///
- protected void OnBorderStyleChanging (StateEventArgs e)
+ protected void OnBorderStyleChanging (CancelEventArgs e)
{
if (Border is null)
{
@@ -193,7 +193,7 @@ public partial class View
///
/// Fired when the is changing. Allows the event to be cancelled.
///
- public event EventHandler> BorderStyleChanging;
+ public event EventHandler> BorderStyleChanging;
///
/// The inside of the view that offsets the
diff --git a/Terminal.Gui/View/ViewText.cs b/Terminal.Gui/View/ViewText.cs
index 12def9323..bb31e9cab 100644
--- a/Terminal.Gui/View/ViewText.cs
+++ b/Terminal.Gui/View/ViewText.cs
@@ -80,13 +80,13 @@ public partial class View
///
public void OnTextChanged (string oldValue, string newValue)
{
- TextChanged?.Invoke (this, new StateEventArgs (oldValue, newValue));
+ TextChanged?.Invoke (this, new CancelEventArgs (oldValue, newValue));
}
///
/// Text changed event, raised when the text has changed.
///
- public event EventHandler> TextChanged;
+ public event EventHandler> TextChanged;
///
/// Gets or sets how the View's is aligned horizontally when drawn. Changing this property will
diff --git a/Terminal.Gui/Views/Button.cs b/Terminal.Gui/Views/Button.cs
index 831cd5386..fc14ec9b5 100644
--- a/Terminal.Gui/Views/Button.cs
+++ b/Terminal.Gui/Views/Button.cs
@@ -110,7 +110,7 @@ public class Button : View
e.Handled = InvokeCommand (Command.HotKey) == true;
}
- private void Button_TitleChanged (object sender, StateEventArgs e)
+ private void Button_TitleChanged (object sender, CancelEventArgs e)
{
base.Text = e.NewValue;
TextFormatter.HotKeySpecifier = HotKeySpecifier;
diff --git a/Terminal.Gui/Views/CheckBox.cs b/Terminal.Gui/Views/CheckBox.cs
index 471ab5203..e28e276ad 100644
--- a/Terminal.Gui/Views/CheckBox.cs
+++ b/Terminal.Gui/Views/CheckBox.cs
@@ -42,7 +42,7 @@ public class CheckBox : View
e.Handled = OnToggled () == true;
}
- private void Checkbox_TitleChanged (object? sender, StateEventArgs e)
+ private void Checkbox_TitleChanged (object? sender, CancelEventArgs e)
{
base.Text = e.NewValue;
TextFormatter.HotKeySpecifier = HotKeySpecifier;
@@ -99,7 +99,7 @@ public class CheckBox : View
/// If the event was canceled.
public bool? OnToggled ()
{
- StateEventArgs e = new (Checked, false);
+ CancelEventArgs e = new (Checked, false);
if (AllowNullChecked)
{
@@ -147,7 +147,7 @@ public class CheckBox : View
/// This event can be cancelled. If cancelled, the will not change its state.
///
///
- public event EventHandler>? Toggled;
+ public event EventHandler>? Toggled;
///
protected override void UpdateTextFormatterText ()
diff --git a/Terminal.Gui/Views/ComboBox.cs b/Terminal.Gui/Views/ComboBox.cs
index 17ef47651..80956bb74 100644
--- a/Terminal.Gui/Views/ComboBox.cs
+++ b/Terminal.Gui/Views/ComboBox.cs
@@ -68,7 +68,7 @@ public class ComboBox : View
SetNeedsLayout ();
SetNeedsDisplay ();
- Search_Changed (this, new StateEventArgs (string.Empty, Text));
+ Search_Changed (this, new CancelEventArgs (string.Empty, Text));
};
// Things this view knows how to do
@@ -187,7 +187,7 @@ public class ComboBox : View
{
SelectedItem = -1;
_search.Text = string.Empty;
- Search_Changed (this, new StateEventArgs (string.Empty, _search.Text));
+ Search_Changed (this, new CancelEventArgs (string.Empty, _search.Text));
SetNeedsDisplay ();
}
}
@@ -660,7 +660,7 @@ public class ComboBox : View
// Tell TextField to handle Accept Command (Enter)
void Search_Accept (object sender, HandledEventArgs e) { e.Handled = true; }
- private void Search_Changed (object sender, StateEventArgs e)
+ private void Search_Changed (object sender, CancelEventArgs e)
{
if (_source is null)
{
@@ -730,7 +730,7 @@ public class ComboBox : View
SetValue (_listview.SelectedItem > -1 ? _searchSet [_listview.SelectedItem] : _text);
_search.CursorPosition = _search.Text.GetColumns ();
- Search_Changed (this, new StateEventArgs (_search.Text, _search.Text));
+ Search_Changed (this, new CancelEventArgs (_search.Text, _search.Text));
OnOpenSelectedItem ();
Reset (true);
HideList ();
diff --git a/Terminal.Gui/Views/DateField.cs b/Terminal.Gui/Views/DateField.cs
index 7a4797fb6..7677ba863 100644
--- a/Terminal.Gui/Views/DateField.cs
+++ b/Terminal.Gui/Views/DateField.cs
@@ -182,7 +182,7 @@ public class DateField : TextField
}
}
- private void DateField_Changing (object sender, StateEventArgs e)
+ private void DateField_Changing (object sender, CancelEventArgs e)
{
try
{
diff --git a/Terminal.Gui/Views/Label.cs b/Terminal.Gui/Views/Label.cs
index 992ea1aca..bdbaa2dff 100644
--- a/Terminal.Gui/Views/Label.cs
+++ b/Terminal.Gui/Views/Label.cs
@@ -31,7 +31,7 @@ public class Label : View
e.Handled = InvokeCommand (Command.HotKey) == true;
}
- private void Label_TitleChanged (object sender, StateEventArgs e)
+ private void Label_TitleChanged (object sender, CancelEventArgs e)
{
base.Text = e.NewValue;
TextFormatter.HotKeySpecifier = HotKeySpecifier;
diff --git a/Terminal.Gui/Views/Shortcut.cs b/Terminal.Gui/Views/Shortcut.cs
index 812994cdc..53d7c892e 100644
--- a/Terminal.Gui/Views/Shortcut.cs
+++ b/Terminal.Gui/Views/Shortcut.cs
@@ -446,7 +446,7 @@ public class Shortcut : View
CommandView.Y = 0; //Pos.Center ();
}
-private void Shortcut_TitleChanged (object sender, StateEventArgs e)
+private void Shortcut_TitleChanged (object sender, CancelEventArgs e)
{
// If the Title changes, update the CommandView text.
// This is a helper to make it easier to set the CommandView text.
diff --git a/Terminal.Gui/Views/TextField.cs b/Terminal.Gui/Views/TextField.cs
index 8967f984f..8ef482655 100644
--- a/Terminal.Gui/Views/TextField.cs
+++ b/Terminal.Gui/Views/TextField.cs
@@ -532,7 +532,7 @@ public class TextField : View
return;
}
- StateEventArgs newText = OnTextChanging (value.Replace ("\t", "").Split ("\n") [0]);
+ CancelEventArgs newText = OnTextChanging (value.Replace ("\t", "").Split ("\n") [0]);
if (newText.Cancel)
{
@@ -1103,9 +1103,9 @@ public class TextField : View
/// Virtual method that invoke the event if it's defined.
/// The new text to be replaced.
/// Returns the
- public virtual StateEventArgs OnTextChanging (string newText)
+ public virtual CancelEventArgs OnTextChanging (string newText)
{
- StateEventArgs ev = new (string.Empty, newText);
+ CancelEventArgs ev = new (string.Empty, newText);
TextChanging?.Invoke (this, ev);
return ev;
@@ -1195,7 +1195,7 @@ public class TextField : View
//public event EventHandler> TextChanged;
/// Changing event, raised before the changes and can be canceled or changing the new text.
- public event EventHandler> TextChanging;
+ public event EventHandler> TextChanging;
/// Undoes the latest changes.
public void Undo ()
diff --git a/Terminal.Gui/Views/TimeField.cs b/Terminal.Gui/Views/TimeField.cs
index d1101c243..b7aad9fec 100644
--- a/Terminal.Gui/Views/TimeField.cs
+++ b/Terminal.Gui/Views/TimeField.cs
@@ -430,7 +430,7 @@ public class TimeField : TextField
return true;
}
- private void TextField_TextChanging (object sender, StateEventArgs e)
+ private void TextField_TextChanging (object sender, CancelEventArgs e)
{
try
{
diff --git a/Terminal.Gui/Views/Wizard/Wizard.cs b/Terminal.Gui/Views/Wizard/Wizard.cs
index 1f11036c1..589cc8ec5 100644
--- a/Terminal.Gui/Views/Wizard/Wizard.cs
+++ b/Terminal.Gui/Views/Wizard/Wizard.cs
@@ -562,7 +562,7 @@ public class Wizard : Dialog
// gets the first step if CurrentStep == null
}
- private void Wizard_TitleChanged (object sender, StateEventArgs e)
+ private void Wizard_TitleChanged (object sender, CancelEventArgs e)
{
if (string.IsNullOrEmpty (_wizardTitle))
{
diff --git a/UICatalog/Scenarios/AdornmentEditor.cs b/UICatalog/Scenarios/AdornmentEditor.cs
index a83aef990..e97d25ada 100644
--- a/UICatalog/Scenarios/AdornmentEditor.cs
+++ b/UICatalog/Scenarios/AdornmentEditor.cs
@@ -186,7 +186,7 @@ public class AdornmentEditor : View
};
}
- private void Top_ValueChanging (object sender, StateEventArgs e)
+ private void Top_ValueChanging (object sender, CancelEventArgs e)
{
if (e.NewValue < 0 || AdornmentToEdit is null)
{
@@ -198,7 +198,7 @@ public class AdornmentEditor : View
AdornmentToEdit.Thickness = new (AdornmentToEdit.Thickness.Left, e.NewValue, AdornmentToEdit.Thickness.Right, AdornmentToEdit.Thickness.Bottom);
}
- private void Left_ValueChanging (object sender, StateEventArgs e)
+ private void Left_ValueChanging (object sender, CancelEventArgs e)
{
if (e.NewValue < 0 || AdornmentToEdit is null)
{
@@ -210,7 +210,7 @@ public class AdornmentEditor : View
AdornmentToEdit.Thickness = new (e.NewValue, AdornmentToEdit.Thickness.Top, AdornmentToEdit.Thickness.Right, AdornmentToEdit.Thickness.Bottom);
}
- private void Right_ValueChanging (object sender, StateEventArgs e)
+ private void Right_ValueChanging (object sender, CancelEventArgs e)
{
if (e.NewValue < 0 || AdornmentToEdit is null)
{
@@ -222,7 +222,7 @@ public class AdornmentEditor : View
AdornmentToEdit.Thickness = new (AdornmentToEdit.Thickness.Left, AdornmentToEdit.Thickness.Top, e.NewValue, AdornmentToEdit.Thickness.Bottom);
}
- private void Bottom_ValueChanging (object sender, StateEventArgs e)
+ private void Bottom_ValueChanging (object sender, CancelEventArgs e)
{
if (e.NewValue < 0 || AdornmentToEdit is null)
{
diff --git a/UICatalog/Scenarios/BorderEditor.cs b/UICatalog/Scenarios/BorderEditor.cs
index 7ba532ff4..671924f94 100644
--- a/UICatalog/Scenarios/BorderEditor.cs
+++ b/UICatalog/Scenarios/BorderEditor.cs
@@ -81,6 +81,6 @@ public class BorderEditor : AdornmentEditor
LayoutSubviews ();
}
- void OnCkbTitleOnToggled (object sender, StateEventArgs args) { ((Border)AdornmentToEdit).ShowTitle = args.NewValue!.Value; }
+ void OnCkbTitleOnToggled (object sender, CancelEventArgs args) { ((Border)AdornmentToEdit).ShowTitle = args.NewValue!.Value; }
}
}
\ No newline at end of file
diff --git a/UICatalog/Scenarios/Buttons.cs b/UICatalog/Scenarios/Buttons.cs
index 12c7b2469..c996ddb23 100644
--- a/UICatalog/Scenarios/Buttons.cs
+++ b/UICatalog/Scenarios/Buttons.cs
@@ -341,7 +341,7 @@ public class Buttons : Scenario
};
numericUpDown.ValueChanged += NumericUpDown_ValueChanged;
- void NumericUpDown_ValueChanged (object sender, StateEventArgs e) { }
+ void NumericUpDown_ValueChanged (object sender, CancelEventArgs e) { }
main.Add (label, numericUpDown);
@@ -518,7 +518,7 @@ public class Buttons : Scenario
}
T oldValue = value;
- StateEventArgs args = new StateEventArgs (_value, value);
+ CancelEventArgs args = new CancelEventArgs (_value, value);
ValueChanging?.Invoke (this, args);
if (args.Cancel)
@@ -533,16 +533,16 @@ public class Buttons : Scenario
}
///
- /// Fired when the value is about to change. Set to true to prevent the change.
+ /// Fired when the value is about to change. Set to true to prevent the change.
///
[CanBeNull]
- public event EventHandler> ValueChanging;
+ public event EventHandler> ValueChanging;
///
/// Fired when the value has changed.
///
[CanBeNull]
- public event EventHandler> ValueChanged;
+ public event EventHandler> ValueChanged;
///
/// The number of digits to display. The will be resized to fit this number of characters plus the buttons. The default is 3.
diff --git a/UICatalog/Scenarios/CharacterMap.cs b/UICatalog/Scenarios/CharacterMap.cs
index c310bdbb0..32d2c03ce 100644
--- a/UICatalog/Scenarios/CharacterMap.cs
+++ b/UICatalog/Scenarios/CharacterMap.cs
@@ -240,7 +240,7 @@ public class CharacterMap : Scenario
return item;
}
- private void JumpEdit_TextChanged (object sender, StateEventArgs e)
+ private void JumpEdit_TextChanged (object sender, CancelEventArgs e)
{
var jumpEdit = sender as TextField;
diff --git a/UICatalog/Scenarios/ContentScrolling.cs b/UICatalog/Scenarios/ContentScrolling.cs
index 9bad9bd99..c3f711cca 100644
--- a/UICatalog/Scenarios/ContentScrolling.cs
+++ b/UICatalog/Scenarios/ContentScrolling.cs
@@ -138,7 +138,7 @@ public class ContentScrolling : Scenario
cbAllowNegativeX.Checked = view.ViewportSettings.HasFlag (ViewportSettings.AllowNegativeX);
cbAllowNegativeX.Toggled += AllowNegativeX_Toggled;
- void AllowNegativeX_Toggled (object sender, StateEventArgs e)
+ void AllowNegativeX_Toggled (object sender, CancelEventArgs e)
{
if (e.NewValue == true)
{
@@ -162,7 +162,7 @@ public class ContentScrolling : Scenario
cbAllowNegativeY.Checked = view.ViewportSettings.HasFlag (ViewportSettings.AllowNegativeY);
cbAllowNegativeY.Toggled += AllowNegativeY_Toggled;
- void AllowNegativeY_Toggled (object sender, StateEventArgs e)
+ void AllowNegativeY_Toggled (object sender, CancelEventArgs e)
{
if (e.NewValue == true)
{
@@ -185,7 +185,7 @@ public class ContentScrolling : Scenario
cbAllowXGreaterThanContentWidth.Checked = view.ViewportSettings.HasFlag (ViewportSettings.AllowXGreaterThanContentWidth);
cbAllowXGreaterThanContentWidth.Toggled += AllowXGreaterThanContentWidth_Toggled;
- void AllowXGreaterThanContentWidth_Toggled (object sender, StateEventArgs e)
+ void AllowXGreaterThanContentWidth_Toggled (object sender, CancelEventArgs e)
{
if (e.NewValue == true)
{
@@ -209,7 +209,7 @@ public class ContentScrolling : Scenario
cbAllowYGreaterThanContentHeight.Checked = view.ViewportSettings.HasFlag (ViewportSettings.AllowYGreaterThanContentHeight);
cbAllowYGreaterThanContentHeight.Toggled += AllowYGreaterThanContentHeight_Toggled;
- void AllowYGreaterThanContentHeight_Toggled (object sender, StateEventArgs e)
+ void AllowYGreaterThanContentHeight_Toggled (object sender, CancelEventArgs e)
{
if (e.NewValue == true)
{
@@ -237,7 +237,7 @@ public class ContentScrolling : Scenario
};
contentSizeWidth.ValueChanging += ContentSizeWidth_ValueChanged;
- void ContentSizeWidth_ValueChanged (object sender, StateEventArgs e)
+ void ContentSizeWidth_ValueChanged (object sender, CancelEventArgs e)
{
if (e.NewValue < 0)
{
@@ -265,7 +265,7 @@ public class ContentScrolling : Scenario
};
contentSizeHeight.ValueChanging += ContentSizeHeight_ValueChanged;
- void ContentSizeHeight_ValueChanged (object sender, StateEventArgs e)
+ void ContentSizeHeight_ValueChanged (object sender, CancelEventArgs e)
{
if (e.NewValue < 0)
{
@@ -287,7 +287,7 @@ public class ContentScrolling : Scenario
cbClearOnlyVisible.Checked = view.ViewportSettings.HasFlag (ViewportSettings.ClearContentOnly);
cbClearOnlyVisible.Toggled += ClearVisibleContentOnly_Toggled;
- void ClearVisibleContentOnly_Toggled (object sender, StateEventArgs e)
+ void ClearVisibleContentOnly_Toggled (object sender, CancelEventArgs e)
{
if (e.NewValue == true)
{
@@ -309,7 +309,7 @@ public class ContentScrolling : Scenario
cbDoNotClipContent.Checked = view.ViewportSettings.HasFlag (ViewportSettings.ClipContentOnly);
cbDoNotClipContent.Toggled += ClipVisibleContentOnly_Toggled;
- void ClipVisibleContentOnly_Toggled (object sender, StateEventArgs e)
+ void ClipVisibleContentOnly_Toggled (object sender, CancelEventArgs e)
{
if (e.NewValue == true)
{
diff --git a/UICatalog/Scenarios/CsvEditor.cs b/UICatalog/Scenarios/CsvEditor.cs
index b3d734ad1..2a05c4178 100644
--- a/UICatalog/Scenarios/CsvEditor.cs
+++ b/UICatalog/Scenarios/CsvEditor.cs
@@ -565,7 +565,7 @@ public class CsvEditor : Scenario
}
}
- private void SelectedCellLabel_TextChanged (object sender, StateEventArgs e)
+ private void SelectedCellLabel_TextChanged (object sender, CancelEventArgs e)
{
// if user is in the text control and editing the selected cell
if (!_selectedCellTextField.HasFocus)
diff --git a/UICatalog/Scenarios/ExpanderButton.cs b/UICatalog/Scenarios/ExpanderButton.cs
index e770c43f6..5484b2065 100644
--- a/UICatalog/Scenarios/ExpanderButton.cs
+++ b/UICatalog/Scenarios/ExpanderButton.cs
@@ -136,7 +136,7 @@ public class ExpanderButton : Button
/// True of the event was cancelled.
protected virtual bool OnCollapsedChanging (bool newValue)
{
- StateEventArgs args = new (Collapsed, newValue);
+ CancelEventArgs args = new (Collapsed, newValue);
CollapsedChanging?.Invoke (this, args);
if (!args.Cancel)
@@ -168,7 +168,7 @@ public class ExpanderButton : Button
/// Fired when the orientation has changed. Can be cancelled by setting
/// to true.
///
- public event EventHandler> CollapsedChanging;
+ public event EventHandler> CollapsedChanging;
///
/// Collapses or Expands the view.
diff --git a/UICatalog/Scenarios/ListViewWithSelection.cs b/UICatalog/Scenarios/ListViewWithSelection.cs
index a11d6950d..5f3baf146 100644
--- a/UICatalog/Scenarios/ListViewWithSelection.cs
+++ b/UICatalog/Scenarios/ListViewWithSelection.cs
@@ -118,7 +118,7 @@ public class ListViewWithSelection : Scenario
Application.Shutdown ();
}
- private void _customRenderCB_Toggled (object sender, StateEventArgs stateEventArgs)
+ private void _customRenderCB_Toggled (object sender, CancelEventArgs stateEventArgs)
{
if (stateEventArgs.OldValue == true)
{
@@ -132,14 +132,14 @@ public class ListViewWithSelection : Scenario
_appWindow.SetNeedsDisplay ();
}
- private void AllowMarkingCB_Toggled (object sender, [NotNull] StateEventArgs stateEventArgs)
+ private void AllowMarkingCB_Toggled (object sender, [NotNull] CancelEventArgs stateEventArgs)
{
_listView.AllowsMarking = (bool)!stateEventArgs.OldValue;
_allowMultipleCB.Visible = _listView.AllowsMarking;
_appWindow.SetNeedsDisplay ();
}
- private void AllowMultipleCB_Toggled (object sender, [NotNull] StateEventArgs stateEventArgs)
+ private void AllowMultipleCB_Toggled (object sender, [NotNull] CancelEventArgs stateEventArgs)
{
_listView.AllowsMultipleSelection = (bool)!stateEventArgs.OldValue;
_appWindow.SetNeedsDisplay ();
diff --git a/UICatalog/Scenarios/Text.cs b/UICatalog/Scenarios/Text.cs
index 13e61c168..6bef53457 100644
--- a/UICatalog/Scenarios/Text.cs
+++ b/UICatalog/Scenarios/Text.cs
@@ -35,7 +35,7 @@ public class Text : Scenario
textField.Autocomplete.SuggestionGenerator = singleWordGenerator;
textField.TextChanging += TextField_TextChanging;
- void TextField_TextChanging (object sender, StateEventArgs e)
+ void TextField_TextChanging (object sender, CancelEventArgs e)
{
singleWordGenerator.AllSuggestions = Regex.Matches (e.NewValue, "\\w+")
.Select (s => s.Value)
diff --git a/UnitTests/Application/ApplicationTests.cs b/UnitTests/Application/ApplicationTests.cs
index 964fada3b..4140b5da5 100644
--- a/UnitTests/Application/ApplicationTests.cs
+++ b/UnitTests/Application/ApplicationTests.cs
@@ -295,7 +295,7 @@ public class ApplicationTests
return;
- void OnApplicationOnInitializedChanged (object s, StateEventArgs a)
+ void OnApplicationOnInitializedChanged (object s, CancelEventArgs a)
{
if (a.NewValue)
{
@@ -1151,7 +1151,7 @@ public class ApplicationTests
return;
- void OnApplicationOnInitializedChanged (object s, StateEventArgs a)
+ void OnApplicationOnInitializedChanged (object s, CancelEventArgs a)
{
if (a.NewValue)
{
diff --git a/UnitTests/Application/KeyboardTests.cs b/UnitTests/Application/KeyboardTests.cs
index 13f29a496..c805587fb 100644
--- a/UnitTests/Application/KeyboardTests.cs
+++ b/UnitTests/Application/KeyboardTests.cs
@@ -129,7 +129,7 @@ public class KeyboardTests
return;
- void OnApplicationOnInitializedChanged (object s, StateEventArgs a)
+ void OnApplicationOnInitializedChanged (object s, CancelEventArgs a)
{
_output.WriteLine ("OnApplicationOnInitializedChanged: {0}", a.NewValue);
if (a.NewValue)
diff --git a/UnitTests/UICatalog/ScenarioTests.cs b/UnitTests/UICatalog/ScenarioTests.cs
index 30b0d7cc8..10b5abc80 100644
--- a/UnitTests/UICatalog/ScenarioTests.cs
+++ b/UnitTests/UICatalog/ScenarioTests.cs
@@ -73,7 +73,7 @@ public class ScenarioTests : TestsAllViews
return;
- void OnApplicationOnInitializedChanged (object s, StateEventArgs a)
+ void OnApplicationOnInitializedChanged (object s, CancelEventArgs a)
{
if (a.NewValue)
{
diff --git a/UnitTests/Views/TextFieldTests.cs b/UnitTests/Views/TextFieldTests.cs
index 1ad2ad9c6..8df80c681 100644
--- a/UnitTests/Views/TextFieldTests.cs
+++ b/UnitTests/Views/TextFieldTests.cs
@@ -363,7 +363,7 @@ public class TextFieldTests (ITestOutputHelper output)
_textField.TextChanging += _textField_TextChanging;
- void _textField_TextChanging (object sender, StateEventArgs e)
+ void _textField_TextChanging (object sender, CancelEventArgs e)
{
if (e.NewValue.GetRuneCount () > 11)
{