View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001664 | NoesisGUI | C# SDK | public | 2020-04-23 20:09 | 2020-05-01 21:49 |
| Reporter | stonstad | Assigned To | sfernandez | ||
| Priority | normal | Severity | block | ||
| Status | assigned | Resolution | open | ||
| Product Version | 3.0 | ||||
| Summary | 0001664: Theming and Resource Dictionary Behavior | ||||
| Description | What are the breaking changes? I am running into a large number of issues related to theming and UI. Many static resources and naming has changed. The behavior of controls and containers also appear changed. What should a developer be looking for when upgrading from 2.x to 3.x? Enclosed Screenshot 1) Unexpected purple backgrounds | ||||
| Attached Files | |||||
| Platform | Any | ||||
|
For reference, here is how this screen appears before upgrading to v3. https://stellarconquest.com/images/screenshots/08.png |
|
|
The purple areas are ScrollViewers. Not sure why they are purple, however. |
|
|
OK, this was caused by not including any reference to NoesisTheme.Styles.xaml in my XAML resource hierarchy. Previously, I used the built-in Noesis style. Not sure if things should be purple and broken without a style, but at least it makes sense and works now. This ticket is a candidate for closure. Thank you. -- Update -- issues remain with purple backgrounds on comboboxes and togglebutton. Both controls are broken. I'm still investigating, though. |
|
|
When you see a purple background it means that Template property is falling back to our internal default style. <Style x:Key="CBStyle" TargetType="ComboBox" BasedOn="{StaticResource {x:Type ComboBox}}">You can read more about this in our Themes documentation: https://www.noesisengine.com/docs/3.0/Gui.Core.StylingTutorial.html#default-styles Please read 3.0 changelog for breaking changes: https://www.noesisengine.com/docs/3.0/Gui.Core.Changelog.html#version-3-0-0b1 |
|
|
Thanks, Sergio. I had styles from 2.x that did not have a key defined. When I defined keys, this fixed up many of the remaining issues. |
|
|
My apologies -- didn't realize that. I made sure I did it right this time. Thank you. |
|
|
Don't need to apology, there are many new things in this version and is easy to get lost with the changes :) |
|
|
Sorry about this change stonstad but it was necessary. :) Many users of Noesis don't create a new theme, they use our default theme. Our default theme in 2.2 is a fallback theme, it is ugly in many aspects and it is using a very small font that is also ugly. Even although everything is ugly, our users use it and they show screenshots of NoesisGUI in internet that are ugly. So, we need to provide a better theme by default. But a better theme implies a bigger one, better fonts, more complex XAMLs, etc. This increases binary size of Noesis and also time for initialization, so we are penalizing the users that care about this. So, we decided to move our theme from Core to App Framework. In the App framework we don't have restrictions so we created a nice theme with dark/light and accent variations. From the point of view of new users, it is almost the same as before, because all samples work and provide a default theme. The theme is now available to inspect, it is no hidden in a DLL, so no obscure behaviors or things happening behind the scenes. Our binary size and performance improved. |
|
|
I appreciate the background and I appreciate the added performance. I am going through and finding places where I incorrectly defined XAML, such as not specifying a key or not used based on. In most cases I have it working now -- but there are a few styles that I'm struggling with. Here is an example of one -- a TextBox. It is pink if I reference the style, below. <TextBox x:Name="_InputTextBox" Grid.Row="1" Style="{StaticResource Heading3PrimaryTextBox}" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Margin="2, 15, 2, 2"/> ... <Style x:Key="Heading3PrimaryTextBox" BasedOn="{StaticResource {x:Type TextBox}}" TargetType="{x:Type TextBox}"> I was missing BasedOn. I added it but it remains pink. Removing "Style="{StaticResource Heading3PrimaryTextBox}"" allows it to work. |
|
|
Are you defining the styles in your application resources with a key or just the TargetType? In case you have them with a key, you need to use that in the BasedOn StaticResource. Application.Resources.xaml: <ResourceDictionary ...> MainWindow.xaml: <UserControl ...> |
|
|
My XAML hierarchy is as follows: Resources.xaml: <ResourceDictionary Source="/Assets/NoesisGUI/Theme/NoesisTheme.Brushes.DarkBlue.xaml" /> I am defining the style in ResourcesCommon.xaml: And then using it in a UserControl like this: <UserControl> I understand I have nesting -- but is there something wrong with this hierarchy? I am thinking it is pretty standard for WPF/UWP... |
|
|
Just to clarify, in the example above (posted on 4/24) the TextBox in question is uninitialized pink. It shouldn't be based on the XAML shared, right? I think my next step is to share a repo project. |
|
|
If you could share a repro project it would help, maybe there is a bug and you have nothing wrong on your side. |
|
|
Yes, I need to get you a repro project. I wonder if what I am seeing here is related to 0001678. |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2020-04-23 20:09 | stonstad | New Issue | |
| 2020-04-23 20:09 | stonstad | File Added: Odd Behavior.PNG | |
| 2020-04-23 20:10 | stonstad | Note Added: 0006246 | |
| 2020-04-23 21:11 | stonstad | Note Added: 0006256 | |
| 2020-04-23 21:22 | stonstad | Note Added: 0006259 | |
| 2020-04-23 21:25 | stonstad | Note Edited: 0006259 | |
| 2020-04-23 21:26 | stonstad | Note Edited: 0006259 | |
| 2020-04-23 21:37 | sfernandez | Assigned To | => sfernandez |
| 2020-04-23 21:37 | sfernandez | Status | new => feedback |
| 2020-04-23 21:37 | sfernandez | Note Added: 0006261 | |
| 2020-04-23 21:38 | sfernandez | Note Edited: 0006261 | |
| 2020-04-24 16:05 | stonstad | Note Added: 0006262 | |
| 2020-04-24 16:05 | stonstad | Status | feedback => assigned |
| 2020-04-24 16:08 | stonstad | Note Added: 0006263 | |
| 2020-04-24 16:13 | sfernandez | Note Added: 0006264 | |
| 2020-04-24 16:13 | sfernandez | Note Edited: 0006264 | |
| 2020-04-24 17:55 | jsantos | Note Added: 0006267 | |
| 2020-04-24 18:27 | stonstad | Note Added: 0006269 | |
| 2020-04-24 18:28 | stonstad | Note Edited: 0006269 | |
| 2020-04-24 19:53 | sfernandez | Status | assigned => feedback |
| 2020-04-24 19:53 | sfernandez | Note Added: 0006270 | |
| 2020-04-24 20:51 | stonstad | Note Added: 0006271 | |
| 2020-04-24 20:51 | stonstad | Status | feedback => assigned |
| 2020-04-28 17:11 | stonstad | Note Added: 0006293 | |
| 2020-04-28 17:15 | sfernandez | Note Added: 0006295 | |
| 2020-05-01 21:49 | stonstad | Note Added: 0006308 | |
| 2020-05-01 21:49 | stonstad | Summary | Noesis 3.0 Beta Breaking Changes => Theming and Resource Dictionary Behavior |
| 2020-05-01 21:49 | stonstad | Description Updated |