-
Notifications
You must be signed in to change notification settings - Fork 65
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 a new control AspectRatioLayout #480
Conversation
Go to AspectRatioLayout demo and go to another and go back, the demo will crash. |
Providing a default value in AspectRatioLayout.ItemsProperty causes all AspectRatioLayouts to share a List. This issue has been fixed, please help review it. |
My suggestions: public double MinRatio { get; set; }
public double MaxRaio { get; set; } for layout item. when bounds ratio change, find the first item that fall into it's range. |
Having users study the relationship between aspect ratio values and shapes can degrade the development experience. |
Features have been added, please help review. |
I asked github copilot, it suggest to rename |
AvaloniaProperty.Register<AspectRatioLayout, double>( | ||
nameof(AspectRatioChangeAmbiguity), 0.2); | ||
|
||
public static readonly StyledProperty<AspectRatioMode> CurrentAspectRatioModeProperty = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be a readonly DirectProperty.
set => SetValue(AspectRatioChangeAmbiguityProperty, value); | ||
} | ||
|
||
private void UpdataHistory(bool value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: Updata -> Update
|
||
private bool _isUseAspectRatioRange; | ||
|
||
public static readonly DirectProperty<AspectRatioLayoutItem, bool> IsUseAspectRatioRangeProperty = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An internal CLR property is enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionally works well, please check these minor issues.
2.CurrentAspectRatioModeProperty to DirectProperty. 3.Fix misspelling: Updata -> Update 4.IsUseAspectRatioRange to an internal CLR property.
Four minor issues have been fixed. |
The control AspectRatioLayout provides a feature to select control layout based on the aspect ratio of the visual area (Bounds).