Replies: 2 comments 1 reply
-
I definitely agree that this should be better documented for contributors. Re: duplication: the styles and resources in Uno.UI are the 'framework resources'. The ones in Uno.UI.FluentTheme are bundled with the So unfortunately the duplication is necessary, since we need both sets of styles to conform to what WinUI/UWP are doing. |
Beta Was this translation helpful? Give feedback.
-
Copying the below comment from #6374 (comment) to keep it in this discussion.
|
Beta Was this translation helpful? Give feedback.
-
Issue
I wonder how do we prevent #6638 (fixed with #6924) from happening in the future? None of us thought of it as obvious as it is in hindsight. Fundamentally, we have a duplication of themes/default styles issue. For
DropDownButton
itself there are two default styleshttps://github.com/unoplatform/uno/blob/master/src/Uno.UI.FluentTheme/Resources/PriorityDefault/DropDownButton.xaml
and
https://github.com/unoplatform/uno/blob/master/src/Uno.UI/UI/Xaml/Controls/DropDownButton/DropDownButton.xaml
Not to mention other controls likely have a Microsoft.UI.Xaml/Windows.UI.Xaml version of XAML as well -- a total of three places. But wait! We have 2.6 styles incoming meaning a potential of 4 variations in no consistent folders or organizational structure!
More Details
In a little more detail I note the following variations of XAML themes:
a. For all controls ported from WinUI XAML is copy/pasted in the controls directory.
b. However, these default style are also located in the FluentTheme project. The logic for determining which to use is unknown.
While it makes sense how things got here, it almost certainly doesn't make sense in total for where we are today. Even worse, Uno does not document this at all. This all needs to be cleaned up and documented for contributors.
Code duplication is bad like this as it's very easy to miss updates in both -- not to mention developers will expect the XAML within the Microsoft.UI.Xaml.Controls folder to be what is actually used. Not another version in a FluentTheme Priority folder.
Possible Solution
Beta Was this translation helpful? Give feedback.
All reactions