Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
[Material,WIP] Add attached properties for Material specific attributes #5005
Add Material Attached properties
Current front runner
Other API Choices
Difficulty : medium
referenced this issue
Mar 7, 2019
Hi, here from the .NET Standup Video which mentioned this PR.
I love this feature
Would it be possible to specify something at the App level to auto-import the
Then you could have something like:
Also, regarding :
What do you mean specifically by this? Do you mean the
@arggrande something like
Is a possible option. If we were to put all the material things into the same namespace then you wouldn't need the prefix. My only concern with this was discoverability or possibly having too many things show up by default
MaterialEditorProp1, MaterialEditorProp2, MaterialEditorProp3,
A conditional like you have is an interesting thought. I wonder if we could just enable intellisense if you set the visual
that'd be kind of neat
referenced this issue
Mar 8, 2019
@pranshaggarwal yes :-/ that wasn't one of the case I had even initially proposed and just wasn't thinking of it straight when I commented above.
My main point with that still stands even with using XmlnsDefinitionAttribute
Material.ButtonStyle vs material:Button.Style
I played around with it a little bit here with using XmlnsDefinitionAttribute
The other nuance of XmlnsDefinitionAttribute is that the cross platform library has to have an init call or something calling into Xamarin.Forms.Material otherwise it runs into issues with the linker.
For example if you just call init on the platform project then the cross platform fails to compile with a namespace not found exception
@PureWeen yes you are right, XmlnsDefinitionAttribute will not solve this problem.
Another option is to defines all the attached property in their respective class then have a clone of all the properties in one class(Material).
Btw if we are able to somehow simplify the attached property syntax as I describe here #5487 then we will not have to worry about this.
to avoid reinventing the wheel again and again, I'd go for something very similar to PlatformSpecific
<Button m:Button.Style="Outline" />
everyone being able to redefine his own MaterialButton and include the properties directly. This is also what gives us the best options to move forward if we decide at some point to move the Material Style property directly to the Button class