Browse Source

Merge pull request #3461 from jp2masa/update-obsolete-api-usages

Updated GotFocusEventArgs obsolete API usages
pull/3476/head
Dariusz Komosiński 6 years ago
committed by GitHub
parent
commit
dbc66b7787
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/Avalonia.Controls/ListBox.cs
  2. 2
      src/Avalonia.Controls/TreeView.cs
  3. 13
      src/Avalonia.Input/GotFocusEventArgs.cs

2
src/Avalonia.Controls/ListBox.cs

@ -124,7 +124,7 @@ namespace Avalonia.Controls
e.Handled = UpdateSelectionFromEventSource(
e.Source,
true,
(e.InputModifiers & InputModifiers.Shift) != 0);
(e.KeyModifiers & KeyModifiers.Shift) != 0);
}
}

2
src/Avalonia.Controls/TreeView.cs

@ -406,7 +406,7 @@ namespace Avalonia.Controls
e.Handled = UpdateSelectionFromEventSource(
e.Source,
true,
(e.InputModifiers & InputModifiers.Shift) != 0);
(e.KeyModifiers & KeyModifiers.Shift) != 0);
}
}

13
src/Avalonia.Input/GotFocusEventArgs.cs

@ -1,6 +1,7 @@
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System;
using Avalonia.Interactivity;
namespace Avalonia.Input
@ -18,6 +19,16 @@ namespace Avalonia.Input
/// <summary>
/// Gets or sets any input modifiers active at the time of focus.
/// </summary>
public InputModifiers InputModifiers { get; set; }
[Obsolete("Use KeyModifiers")]
public InputModifiers InputModifiers
{
get => (InputModifiers)KeyModifiers;
set => KeyModifiers = (KeyModifiers)((int)value & 0xF);
}
/// <summary>
/// Gets or sets any key modifiers active at the time of focus.
/// </summary>
public KeyModifiers KeyModifiers { get; set; }
}
}

Loading…
Cancel
Save