Browse Source

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

Fixed obsolete API usages
pull/3618/head
Dariusz Komosiński 7 years ago
committed by GitHub
parent
commit
fe2af3fd4d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/Avalonia.Controls/ContextMenu.cs
  2. 4
      src/Avalonia.Input/NavigationDirection.cs
  3. 1
      src/Avalonia.Themes.Default/ComboBox.xaml
  4. 6
      src/Avalonia.Themes.Default/MenuItem.xaml

3
src/Avalonia.Controls/ContextMenu.cs

@ -104,8 +104,7 @@ namespace Avalonia.Controls
{ {
PlacementMode = PlacementMode.Pointer, PlacementMode = PlacementMode.Pointer,
PlacementTarget = control, PlacementTarget = control,
StaysOpen = false, StaysOpen = false
ObeyScreenEdges = true
}; };
_popup.Opened += PopupOpened; _popup.Opened += PopupOpened;

4
src/Avalonia.Input/NavigationDirection.cs

@ -100,12 +100,12 @@ namespace Avalonia.Input
/// </returns> /// </returns>
public static NavigationDirection? ToNavigationDirection( public static NavigationDirection? ToNavigationDirection(
this Key key, this Key key,
InputModifiers modifiers = InputModifiers.None) KeyModifiers modifiers = KeyModifiers.None)
{ {
switch (key) switch (key)
{ {
case Key.Tab: case Key.Tab:
return (modifiers & InputModifiers.Shift) != 0 ? return (modifiers & KeyModifiers.Shift) != 0 ?
NavigationDirection.Next : NavigationDirection.Previous; NavigationDirection.Next : NavigationDirection.Previous;
case Key.Up: case Key.Up:
return NavigationDirection.Up; return NavigationDirection.Up;

1
src/Avalonia.Themes.Default/ComboBox.xaml

@ -37,7 +37,6 @@
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}" MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
MaxHeight="{TemplateBinding MaxDropDownHeight}" MaxHeight="{TemplateBinding MaxDropDownHeight}"
PlacementTarget="{TemplateBinding}" PlacementTarget="{TemplateBinding}"
ObeyScreenEdges="True"
StaysOpen="False"> StaysOpen="False">
<Border BorderBrush="{DynamicResource ThemeBorderMidBrush}" <Border BorderBrush="{DynamicResource ThemeBorderMidBrush}"
BorderThickness="1"> BorderThickness="1">

6
src/Avalonia.Themes.Default/MenuItem.xaml

@ -45,8 +45,7 @@
<Popup Name="PART_Popup" <Popup Name="PART_Popup"
PlacementMode="Right" PlacementMode="Right"
StaysOpen="True" StaysOpen="True"
IsOpen="{TemplateBinding IsSubMenuOpen, Mode=TwoWay}" IsOpen="{TemplateBinding IsSubMenuOpen, Mode=TwoWay}">
ObeyScreenEdges="True">
<Border Background="{TemplateBinding Background}" <Border Background="{TemplateBinding Background}"
BorderBrush="{DynamicResource ThemeBorderMidBrush}" BorderBrush="{DynamicResource ThemeBorderMidBrush}"
BorderThickness="{TemplateBinding BorderThickness}"> BorderThickness="{TemplateBinding BorderThickness}">
@ -95,8 +94,7 @@
</ContentPresenter> </ContentPresenter>
<Popup Name="PART_Popup" <Popup Name="PART_Popup"
IsOpen="{TemplateBinding IsSubMenuOpen, Mode=TwoWay}" IsOpen="{TemplateBinding IsSubMenuOpen, Mode=TwoWay}"
StaysOpen="True" StaysOpen="True">
ObeyScreenEdges="True">
<Border Background="{TemplateBinding Background}" <Border Background="{TemplateBinding Background}"
BorderBrush="{DynamicResource ThemeBorderMidBrush}" BorderBrush="{DynamicResource ThemeBorderMidBrush}"
BorderThickness="{TemplateBinding BorderThickness}"> BorderThickness="{TemplateBinding BorderThickness}">

Loading…
Cancel
Save