Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlacementMode -> Placement #10664

Merged
merged 10 commits into from
Mar 17, 2023
Merged

PlacementMode -> Placement #10664

merged 10 commits into from
Mar 17, 2023

Conversation

robloo
Copy link
Contributor

@robloo robloo commented Mar 14, 2023

What does the pull request do?

Follow-up to #10492 as discussed starting here: #10492 (comment)

What is the current behavior?

What is the updated/expected behavior with this PR?

All properties standardized to use Placement naming.

How was the solution implemented (if it's not obvious)?

Obvious.

Checklist

Breaking changes

Yes, property name change:

  1. Popup.PlacementMode to Popup.Placement
  2. ContextMenu.PlacementMode to ContextMenu.Placement

Obsoletions / Deprecations

None

Fixed issues

Also fixes #9583

/// </summary>
public PlacementMode PlacementMode
/// <inheritdoc cref="Popup.Placement"/>
public PlacementMode Placement
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the Popup "Placement" properties shouldn't really be duplicated here. There is an open question if ContextMenu should be deriving from PopupFlyoutBase as well (like MenuFlyout).

/// <summary>
/// Gets or sets the Horizontal offset of the context menu in relation to the <see cref="PlacementTarget"/>.
/// </summary>
/// <inheritdoc cref="Popup.HorizontalOffset"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm inheriting the docs from Popup now. The only downside is "context menu" wording is replaced by "popup". I don't consider this a major issue and it's better to find more general wording in the base docs than duplicate them everywhere.

@@ -256,8 +256,8 @@ public PlacementMode PlacementMode
/// </remarks>
public Rect? PlacementRect
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PlacementRect seems like an unnecessary deviation from naming conventions and WPF which uses PlacementRectangle. Honestly, I would like to switch to WPF terminology: https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.primitives.popup.placementrectangle?view=windowsdesktop-7.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there is precedent for the new naming: https://learn.microsoft.com/en-us/uwp/api/windows.ui.input.pointerpointproperties.contactrect?view=winrt-22621

PointerPointProperties.ContactRect

@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0031879-beta. (feed url: https://pkgs.dev.azure.com/AvaloniaUI/AvaloniaUI/_packaging/avalonia-all/nuget/v3/index.json) [PRBUILDID]

@kekekeks
Copy link
Member

kekekeks commented Mar 15, 2023

Can we have [Obsolete] PlacementMode and PlacementModeProperty proxy properties? I'd like to not cause compilation errors unless necessary.

@robloo
Copy link
Contributor Author

robloo commented Mar 15, 2023

Really isn't ideal to support considering all the other breaking changes. I can't think of many cases where two styled properties exist that do the same thing either.

That said if it's required it can be done.

@kekekeks
Copy link
Member

There won't be two separate properties, just an alias: public static StyledProperty<PlacementMode> PlacementModeProperty = PlacementProperty;

@robloo
Copy link
Contributor Author

robloo commented Mar 15, 2023

@kekekeks Updated to add back an obsolete alias for PlacementMode

@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0031912-beta. (feed url: https://pkgs.dev.azure.com/AvaloniaUI/AvaloniaUI/_packaging/avalonia-all/nuget/v3/index.json) [PRBUILDID]

@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0031914-beta. (feed url: https://pkgs.dev.azure.com/AvaloniaUI/AvaloniaUI/_packaging/avalonia-all/nuget/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 added this pull request to the merge queue Mar 17, 2023
Merged via the queue into AvaloniaUI:master with commit aa1aa33 Mar 17, 2023
@robloo robloo deleted the placementmode branch March 17, 2023 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flyouts should share PlacementMode with popups
5 participants