Browse Source

whitespace fixes.

pull/1526/head
Dan Walmsley 9 years ago
parent
commit
240bb40be4
  1. 18
      src/Avalonia.Controls/Primitives/Popup.cs

18
src/Avalonia.Controls/Primitives/Popup.cs

@ -39,7 +39,7 @@ namespace Avalonia.Controls.Primitives
/// </summary> /// </summary>
public static readonly StyledProperty<PlacementMode> PlacementModeProperty = public static readonly StyledProperty<PlacementMode> PlacementModeProperty =
AvaloniaProperty.Register<Popup, PlacementMode>(nameof(PlacementMode), defaultValue: PlacementMode.Bottom); AvaloniaProperty.Register<Popup, PlacementMode>(nameof(PlacementMode), defaultValue: PlacementMode.Bottom);
/// <summary> /// <summary>
/// Degines the <see cref="ObeyScreenEdges"/> property. /// Degines the <see cref="ObeyScreenEdges"/> property.
/// </summary> /// </summary>
@ -232,12 +232,12 @@ namespace Avalonia.Controls.Primitives
var window = _topLevel as Window; var window = _topLevel as Window;
if (window != null) if (window != null)
{ {
window.Deactivated += WindowDeactivated; window.Deactivated += WindowDeactivated;
} }
else else
{ {
var parentPopuproot = _topLevel as PopupRoot; var parentPopuproot = _topLevel as PopupRoot;
if(parentPopuproot != null && parentPopuproot.Parent!=null) if (parentPopuproot != null && parentPopuproot.Parent != null)
{ {
((Popup)(parentPopuproot.Parent)).Closed += ParentClosed; ((Popup)(parentPopuproot.Parent)).Closed += ParentClosed;
} }
@ -261,7 +261,7 @@ namespace Avalonia.Controls.Primitives
Opened?.Invoke(this, EventArgs.Empty); Opened?.Invoke(this, EventArgs.Empty);
} }
/// <summary> /// <summary>
/// Closes the popup. /// Closes the popup.
/// </summary> /// </summary>
@ -367,7 +367,7 @@ namespace Avalonia.Controls.Primitives
/// <returns>The popup's position in screen coordinates.</returns> /// <returns>The popup's position in screen coordinates.</returns>
protected virtual Point GetPosition() protected virtual Point GetPosition()
{ {
var result = GetPosition(PlacementTarget ?? this.GetVisualParent<Control>(), PlacementMode, PopupRoot, var result = GetPosition(PlacementTarget ?? this.GetVisualParent<Control>(), PlacementMode, PopupRoot,
HorizontalOffset, VerticalOffset); HorizontalOffset, VerticalOffset);
return result; return result;
@ -422,8 +422,8 @@ namespace Avalonia.Controls.Primitives
{ {
if (!StaysOpen) if (!StaysOpen)
{ {
if(!IsChildOrThis((IVisual)e.Source)) if (!IsChildOrThis((IVisual)e.Source))
{ {
Close(); Close();
e.Handled = true; e.Handled = true;
} }
@ -435,12 +435,12 @@ namespace Avalonia.Controls.Primitives
IVisual root = child.GetVisualRoot(); IVisual root = child.GetVisualRoot();
while (root is PopupRoot) while (root is PopupRoot)
{ {
if (root == PopupRoot) return true; if (root == PopupRoot) return true;
root = ((PopupRoot)root).Parent.GetVisualRoot(); root = ((PopupRoot)root).Parent.GetVisualRoot();
} }
return false; return false;
} }
private void WindowDeactivated(object sender, EventArgs e) private void WindowDeactivated(object sender, EventArgs e)
{ {
if (!StaysOpen) if (!StaysOpen)

Loading…
Cancel
Save