User avatar
Topic Author
Posts: 139
Joined: 06 Jun 2016, 18:14
Location: Lesser Magellanic Cloud

Error Defining Thickness in Resource Dictionary?

18 Sep 2019, 19:24

Should I be able to define a thickness in a resource dictionary ( ... -resources)?

Here are the errors that I get from Noesis. Maybe I'm doing it wrong?
<Thickness x:Key="ScreenMargin">20, 75, 20, 0</Thickness>
<Thickness x:Key="ScreenMargin" Left="20" Top="75" Right="20" Bottom="0"/>
[noesis] Assets/User Interface/ResourcesCommon.xaml(8): Can't assign property to abstract class 'Thickness'.
NoesisUnity:UnityLog(Int32, String) (at Assets/NoesisGUI/Plugins/NoesisUnity.cs:116)
Noesis.GUI:LoadXaml(String) (at Assets/NoesisGUI/Plugins/API/Core/NoesisGUI.cs:192)
NoesisXaml:Load() (at Assets/NoesisGUI/Plugins/NoesisXaml.cs:30)
NoesisUnity:LoadApplicationResources() (at Assets/NoesisGUI/Plugins/NoesisUnity.cs:44)
NoesisUnity:Init() (at Assets/NoesisGUI/Plugins/NoesisUnity.cs:24)
NoesisXaml:RegisterDependencies() (at Assets/NoesisGUI/Plugins/NoesisXaml.cs:48)
NoesisXaml:OnEnable() (at Assets/NoesisGUI/Plugins/NoesisXaml.cs:9)

User avatar
Site Admin
Posts: 2255
Joined: 22 Dec 2011, 19:20

Re: Error Defining Thickness in Resource Dictionary?

18 Sep 2019, 23:18

This should work, I just verified it in our XamlPlayer and Unity:
<Thickness x:Key="ScreenMargin">20, 75, 20, 0</Thickness>
The other construct (specifying struct values as attributes) is not supported in Noesis.

Who is online

Users browsing this forum: Google [Bot] and 2 guests