Intended Project Structure (For Global Styling)
Posted: 21 Nov 2024, 14:44
Hey!
I am looking into how we can setup global styling and am wondering the intended studio project structure. Is it intended for you to have one studio project with all your UI inside or should we be creating multiple studio projects that then all use the same global styles (theme)?
Is the handling of global styles across multiple projects something supported in studio yet?
I have looked at 3 different approaches and would like to know if I'm on the right track or am completely missing the mark!
Approach 1:
The first approach I tried was to use a relative path to a different project:
This works in game and with the VSCode extension however doesn't work within studio (Elements aren't styles nor can I see any styles in the styles dropdowns)
Approach 2:
The second approach uses what I believe is the intended path for none studio projects which is to set the global styles up in the unreal project settings and in a blend project use the App.Xaml to point to that theme so you can see everything while creating the UI.
Is there a way to do this in studio? I have noticed that studio always includes the GlobalResources.Xaml file even if it isn't referenced in the Main Xaml. Is this Studios version of App.Xaml?
Approach 3:
The Third approach I tried was to use the new feature project references. This has allowed me to do what I wanted to do in Approach 1 however Studio isnt displaying any of the styles brought in from the referenced project.
The elements show as styled within studio but display as "None" in the style drop down and I am unable to see any of the styles from the referenced project in the style dropdown. Another issue I have noticed with the referenced projects is that they disappear from studio after you reopen the project This has no effect on the functionality but is confusing from a user POV
This approach only works in studio and not unreal
I am looking into how we can setup global styling and am wondering the intended studio project structure. Is it intended for you to have one studio project with all your UI inside or should we be creating multiple studio projects that then all use the same global styles (theme)?
Is the handling of global styles across multiple projects something supported in studio yet?
I have looked at 3 different approaches and would like to know if I'm on the right track or am completely missing the mark!
Approach 1:
The first approach I tried was to use a relative path to a different project:
Code: Select all
<ResourceDictionary Source="../MyProject/GlobalResources.xaml" />
Approach 2:
The second approach uses what I believe is the intended path for none studio projects which is to set the global styles up in the unreal project settings and in a blend project use the App.Xaml to point to that theme so you can see everything while creating the UI.
Is there a way to do this in studio? I have noticed that studio always includes the GlobalResources.Xaml file even if it isn't referenced in the Main Xaml. Is this Studios version of App.Xaml?
Approach 3:
The Third approach I tried was to use the new feature project references. This has allowed me to do what I wanted to do in Approach 1 however Studio isnt displaying any of the styles brought in from the referenced project.
The elements show as styled within studio but display as "None" in the style drop down and I am unable to see any of the styles from the referenced project in the style dropdown. Another issue I have noticed with the referenced projects is that they disappear from studio after you reopen the project This has no effect on the functionality but is confusing from a user POV
This approach only works in studio and not unreal