Custom UI Markup based on Xaml #673
DarkLiKally
started this conversation in
Blish HUD Core Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Since there is already a good collection of GW2 styled UI components in Blish HUD that can be created and thrown together in pure C# it might be useful to have some kind of UI markup language that simplified UI creation and maintenance for modules.
The idea:
There is Xaml out there, which is a great serialization format for any .NET object construct since it is supporting every nesting, notation and referencing other elements. Also Blish HUD is already making use of INotifyPropertyChanged.
We should maybe try to use platform independent solutions if possible. Microsofts Xaml implementation is dependent on Windows libraries.
Based on this, it would be possible to write a custom Xaml Reader supporting all features needed by Blish HUD.
It can be easily integrated with existing blish hud component classes by just adding a few decorators for telling it where it should place child components or the text content.
With Xaml Blish HUD could just reuse the existing UI component classes already existing and use all their properties without any issue.
Module developers could create xaml files for their UIs and easily create custom UIs in a more structured way than throwing together element instances in a big C# class.
Of course there would be some additional effort required for making advanced features like building a simple binding framework or when we stay with (not maintained) Adhesive integrate that into our custom xaml interpretor after reading it.
Also we would have to write some value converters for things like "Thickness" and so on.
The way Blish HUD is currently handling the addition and removal of child components must be improved aswell, or we create an adjusted Xaml parser which knows how to handle it with the "AddChild" and "RemoveChild" functions of the "Container" class.
But in the end it is not a super huge effort to implement it.
I think this could benefit module developers with an easy way of defining their UIs and connecting them to their models or view-models. Maintaining UI would become much easier since you have a look at a more abstract markup file and you can easily move around things in there without taking care of adjusting bindings (if you create custom ones) or and making sure you're adding all components again to the correct parents.
Beta Was this translation helpful? Give feedback.
All reactions