-
- monstercho
- Posts: 20
- Joined:
Noesis 2 theme crash
Hi, something I noticed while adapting to Noesis 2.0 - the order of tags in the theme ResourceDictionary matter (doesn't in Noesis 1.2x).
So If you select in NoesisSettings default theme like this one (theme_crash.xaml):
and try to import xaml that uses it by dragging it into some folder in Unity editor (test_theme.xaml):
Unity editor will hang and crash if you try to interact with it (only the menu reacts).
If you restart Unity it will crash again each time you try.
No problem with theme like this (theme_ok.xaml):
Only difference is tag order - color is defined before the brush that uses it.
It is easy to avoid issue, but took me some time to realize why all the crashes.
So If you select in NoesisSettings default theme like this one (theme_crash.xaml):
Code: Select all
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<SolidColorBrush x:Key="PhoneTextBoxEditBorderBrush" Color="{StaticResource PhoneAccentColor}" />
<Color x:Key="PhoneAccentColor">#FFE51400</Color>
</ResourceDictionary>
and try to import xaml that uses it by dragging it into some folder in Unity editor (test_theme.xaml):
Code: Select all
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="PhoneAccentColor}"/>
</UserControl>
If you restart Unity it will crash again each time you try.
No problem with theme like this (theme_ok.xaml):
Code: Select all
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<Color x:Key="PhoneAccentColor">#FFE51400</Color>
<SolidColorBrush x:Key="PhoneTextBoxEditBorderBrush" Color="{StaticResource PhoneAccentColor}" />
</ResourceDictionary>
It is easy to avoid issue, but took me some time to realize why all the crashes.
-
-
sfernandez
Site Admin
- Posts: 2061
- Joined:
Re: Noesis 2 theme crash
Hi,
We were able to reproduce and fix the bug.
It will be solved in the next release.
Sorry for the inconvenience.
We were able to reproduce and fix the bug.
It will be solved in the next release.
Sorry for the inconvenience.
-
-
sfernandez
Site Admin
- Posts: 2061
- Joined:
Re: Noesis 2 theme crash
Just a clarification, the declaration order of resources is important.
A StaticResource can only be resolved if it refers to a previously defined resource.
This is the same behavior you would find in WPF.
A StaticResource can only be resolved if it refers to a previously defined resource.
This is the same behavior you would find in WPF.
Re: Noesis 2 theme crash
Extra clarification: This was incorrectly working in 1.X because our implementation of static resources was not very efficient (they were very similar to dynamic resources)
Who is online
Users browsing this forum: No registered users and 2 guests