Default Styles and Generic.xaml in Unity
Posted: 06 May 2021, 21:41
In standard WPF, when I create a new custom control, a few things happen:
[*]DefaultStyleKeyProperty metadata is overriden
[*]A style is added in Themes/Generic.xaml
[*]ThemeInfoAttribute is set on assembly level
In Unity this probably has to work differently? Unless AssemblyDefinitions are provided, basically everything will end up in the same assembly. And such an assemblyattribute could therefore be potentially specified multiple times, which would be bad.
What's the workflow for providing a control library in this way in Unity? Does it have to end up defining an AssemblyDefitinion or is there a way to make that also work along with other assets?
Come to think of it, what happens in Unity with XAML files that are inside an assembly definition scope anyway? Do the assets end up in that assembly or do they stay outside of it, or is the compiled class inside the assembly but the asset is outside of it or how does that work?
[*]DefaultStyleKeyProperty metadata is overriden
[*]A style is added in Themes/Generic.xaml
[*]ThemeInfoAttribute is set on assembly level
In Unity this probably has to work differently? Unless AssemblyDefinitions are provided, basically everything will end up in the same assembly. And such an assemblyattribute could therefore be potentially specified multiple times, which would be bad.
What's the workflow for providing a control library in this way in Unity? Does it have to end up defining an AssemblyDefitinion or is there a way to make that also work along with other assets?
Come to think of it, what happens in Unity with XAML files that are inside an assembly definition scope anyway? Do the assets end up in that assembly or do they stay outside of it, or is the compiled class inside the assembly but the asset is outside of it or how does that work?