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

Add KeepCenterOnSizeChanged attached property. #818

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

GF-Huang
Copy link
Member

In default, set Window.SizeToContent to Width or Height or WidthAndHeight, when the content size changed, the window will not re-center to screen or owner. After add this attached property, it will auto re-center.

SamirKharchi pushed a commit to SamirKharchi/HandyControl that referenced this pull request May 11, 2021
In default, set Window.SizeToContent to Width or Height or WidthAndHeight, when the content size changed, the window will not re-center to screen or owner. After add this attached property, it will auto re-center.
@GF-Huang
Copy link
Member Author

GF-Huang commented May 21, 2021

When typing in multi-line TextBox or something else input element which will change the Window size if Window.SizeToContent contains Height, it will cause the input element lost focus (e.g. user press enter to break line), the user is forced to abort the input.

Commit 6c05c45 fix this issue.

@ghost1372 ghost1372 added this to In progress in Roadmap May 24, 2021
@NaBian
Copy link
Member

NaBian commented May 27, 2021

Have you considered the case where the user manually resizes or moves the window @GF-Huang

@GF-Huang
Copy link
Member Author

GF-Huang commented May 27, 2021

Have you considered the case where the user manually resizes or moves the window @GF-Huang

No, maybe rename to KeepRelativeCenterOnSizeChanged will be better.

@NaBian I found that when user resize the window, Window.SizeToContent will change to SizeToContent.Manual from Width, Height or WidthAndHeight, we can detect this to stopping re-center behavior.

@ghost1372 ghost1372 added the 🏭 enhancement New feature or request label Dec 18, 2021
@GF-Huang
Copy link
Member Author

Why still not merge? 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏭 enhancement New feature or request
Projects
Status: In Progress
Roadmap
  
In progress
Development

Successfully merging this pull request may close these issues.

None yet

3 participants