You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 1, 2024. It is now read-only.
Attached properties are great when it comes to extending existing control functionality without inheritance but the problem with them is lengthy syntax especially for custom attached property.
So this can be replace <Button material:Button.ButtonStyle="Outline"></Button>
with <Button ButtonStyle="Outline"></Button>
API
I can think of two API options for this(not sure even if it is possible or not) x:using="Visual.Material.AttachedProperties, OtherClasses" in XAML
or [assembly:GlobalAttached(Visual.Material.AttachedProperties, OtherClasses)] in C#
Intended Use Case
One use case of this is to provide a simplified way to extend Entry, Button etc for Material API like #5005
The text was updated successfully, but these errors were encountered:
I did some research and looked into the code of how Xamarin parses XAML. The problem with this enhancement is that <Button ButtonStyle="Outline" /> will be invalid xml and I think this is not wise.
Maybe what we can do, we can create a build task which will replace <Button ButtonStyle="Outline"/> with <Button material:Button.ButtonStyle="Outline"/>. Hence ButtonStyle="Outline" will be just syntactical sugar. We can run this task before XamlGTask.
@pranshaggarwal we can't use invalid XAML, eve if we validify it before processing. the reason is that it'd break all the tooling around Xaml, like intelisense, previewer, 3rd party hot-reload solutions...
Summary
Attached properties are great when it comes to extending existing control functionality without inheritance but the problem with them is lengthy syntax especially for custom attached property.
So this can be replace
<Button material:Button.ButtonStyle="Outline"></Button>
with
<Button ButtonStyle="Outline"></Button>
API
I can think of two API options for this(not sure even if it is possible or not)
x:using="Visual.Material.AttachedProperties, OtherClasses"
in XAMLor
[assembly:GlobalAttached(Visual.Material.AttachedProperties, OtherClasses)]
in C#Intended Use Case
One use case of this is to provide a simplified way to extend Entry, Button etc for Material API like #5005
The text was updated successfully, but these errors were encountered: