-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update BoxPanel custom panel example #3938
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
Conversation
Used this as an example for a template we're building in the Windows Community Toolkit and ran into some issues with the sample and code. Figured I'd contribute back to the article here the fixes I had to do. Fixes: - Off-by-one logic error for cutting size of box (for instance try '6' as a value, should be 2x3 not 3x3 still) (from my understanding of the scenario) - Missing `{` in `LimitUnboundedSize` method - Missing `;` in `ArrangeOverride` method - Improper definition of a Dependency Property (guidelines are strict here about property and DP names aligning otherwise issues can occur, picked a more standard XAML based Panel name here as well for this scenario. - Also added changed callback to invalidate layout so that the dependency property change actually updates the layout of the control immediately. - Provided more context for where the adjustment to the code goes.
@michael-hawker : Thanks for your contribution! The author(s) have been notified to review your proposed change. |
Can you review this PR? IMPORTANT: When this content is ready to merge, you must add #label:"aq-pr-triaged" |
@michael-hawker, thank you! |
Thanks folks! Realized after there are some other optimizations around not using so many local variables in the example, but can do that as a separate thing later, if desired. I know it's also probably to reduce the complexity of the code a bit, but at the same time I feel like it's good to promote best practices. Let me know if you'd like me to open another PR for that after. |
@michael-hawker, thanks for this. It's always a balance between keeping code simple for the docs and showing best practices. For a complete, complex example like this, I think it's okay to make it more complex and show the best practices. Please feel free to open another PR with your optimizations. |
Used this as an example for a template we're building in the Windows Community Toolkit and ran into some issues with the sample and code. Figured I'd contribute back to the article here the fixes I had to do.
Fixes:
{
inLimitUnboundedSize
method;
inArrangeOverride
method