-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Adds FlowDirection Design TypeConverter #6384
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
|
@mgoertz-msft does this look correct? |
|
@Redth Looks good, but it begs the question why we wouldn't just add the new values to the enum and remove the runtime TypeConverter? There also still seems to be a slight difference in what the runtime TC accepts. The new values are case insensitive whereas the enum values and this DT converter I believe do check the case. |
|
Adding duplicate values seemed off to me... @StephaneDelcroix thoughts ? |
|
also, as @mgoertz-msft said, Xaml syntax is case-sensitive, where CSS is not. Depending on what's our goal here, there are multiple courses of action: The right path forward is 4/ (imho), and in the meantime I could create a Compiled version of this converter that will fail at compile time |
| AddMemberAttributes("Microsoft.Maui.Controls.VisualElement", "Visual", | ||
| new TypeConverterAttribute(typeof(VisualDesignTypeConverter))); | ||
|
|
||
| AddMemberAttributes("Microsoft.Maui.Controls.VisualElement", "FlowDirection", |
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.
side question, why do we have a [TypeConverter] on the Property, and not on the Type ?
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.
Probably because the real type converter is also on the property.
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.
Probably because the real type converter is also on the property.
that was my question. Why are we doing this at the Core and Controls level. I understand we have to mimic it here
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.
Yeah, that I don't know. @Redth?
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.
Not sure, I was mostly just following what had been done for similar cases previously.
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.
What this means is that the FlowDirection enum will only behave this way for the VisualElement.FlowDirection property. If that type is used for any other property, by 3rd party control vendors for example, then it will behave just like the regular enum and not allow those CSS values to be used.
Fixes #6343
Adds a Design TypeConverter for FlowDirection so that XAML editor/intellisense can report the values and invalid values correctly.