-
- adambuchweitz
- Posts: 5
- Joined:
Unity: Xaml.Dependencies throws errors after updating to 3.2.9
I'm attempting to update from version from 3.2.6 to 3.2.9, and I'm getting errors now with declaring dependencies. Here is what I've had, and has worked as expected:
After updating, I'm given the following errors:
Cannot create 'System.Collections.Generic.List`1[[NoesisGUIExtensions.Dependency, Noesis.NoesisGUI, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]', component not registered
Cannot set value for 'noesis:Preloader.Dependencies', invalid value '' for property type 'System.Collections.Generic.List`1[[NoesisGUIExtensions.Dependency, Noesis.NoesisGUI, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]'
As you can probably guess, I use them to instantiate dialogs at runtime. I'm hoping the dependencies haven't been deprecated. Did the syntax change?
Thanks!
Code: Select all
<noesis:Xaml.Dependencies>
<noesis:Dependency Source="/Assets/Dialogs/Alert/Alert.xaml"/>
</noesis:Xaml.Dependencies>
Cannot create 'System.Collections.Generic.List`1[[NoesisGUIExtensions.Dependency, Noesis.NoesisGUI, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]', component not registered
Cannot set value for 'noesis:Preloader.Dependencies', invalid value '' for property type 'System.Collections.Generic.List`1[[NoesisGUIExtensions.Dependency, Noesis.NoesisGUI, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]'
As you can probably guess, I use them to instantiate dialogs at runtime. I'm hoping the dependencies haven't been deprecated. Did the syntax change?
Thanks!
Re: Unity: Xaml.Dependencies throws errors after updating to 3.2.9
It seems we broke something related to this in version 3.2.9. A ticket has been created for it: #4411.
We’ll fix that, but indeed, Xaml.Dependencies isn’t needed at all. You can simply have strong references to the required XAML inside a ScriptableObject and load them from there.
We’ll fix that, but indeed, Xaml.Dependencies isn’t needed at all. You can simply have strong references to the required XAML inside a ScriptableObject and load them from there.
-
- adambuchweitz
- Posts: 5
- Joined:
Re: Unity: Xaml.Dependencies throws errors after updating to 3.2.9
Thanks for the info. Does the ScriptableObject need to be instantiated to hold the strong reference? Most of my codebase is pure C# and avoids GameObjects everywhere possible, so the way
I have been opening dialogs looks something like this:
Where Alert is a Xaml + code-behind combo:
I have been opening dialogs looks something like this:
Code: Select all
public class DialogCoordinator
{
private Grid _grid;
public DialogCoordinator(Grid grid) => _grid = grid;
public OpenPopup() =>
_grid.Children.Add(new Alert());
}
Code: Select all
public partial class Alert : UserControl
{
public Alert() => InitializeComponent();
private void InitializeComponent() => NoesisUnity.LoadComponent(this);
}
Re: Unity: Xaml.Dependencies throws errors after updating to 3.2.9
How are you handling other resources in Unity, such as meshes and textures? Unity typically requires hard references to these assets.
No, that’s not necessary. You can also use the Preloaded Assets section in the project settings for this purpose.Does the ScriptableObject need to be instantiated to hold the strong reference?
-
- adambuchweitz
- Posts: 5
- Joined:
Re: Unity: Xaml.Dependencies throws errors after updating to 3.2.9
A couple hard references in XAML files, a few prefabs instantiated through Resources, and a whole lot of downloaded content loaded in at runtime, generated by users.How are you handling other resources in Unity, such as meshes and textures? Unity typically requires hard references to these assets.
I have put MainWindow.xaml in the Preloaded Assets section, but instantiation (via `NoesisUnity.LoadComponent(this)` fails with:No, that’s not necessary. You can also use the Preloaded Assets section in the project settings for this purpose.
[NOESIS] Xaml not found 'Assets/Menu/Noesis/MainWindow.xaml'
I tried variations of loading by keys "MainWindow" with and without extension, with and without full pathing, with and without "assets"
How exactly should a Xaml be instantiated after it's preloaded in this way? I don't believe that's in the docs.
Re: Unity: Xaml.Dependencies throws errors after updating to 3.2.9
You can use the Load method of NoesisXaml for this purpose:
Code: Select all
public class NoesisXaml: ScriptableObject
{
public object Load()
{
RegisterDependencies();
NoesisUnity.Init();
return Noesis.GUI.LoadXaml(new MemoryStream(content), uri);
}
Re: Unity: Xaml.Dependencies throws errors after updating to 3.2.9
Hi there! Will there be a patch release for this fix?
Re: Unity: Xaml.Dependencies throws errors after updating to 3.2.9
Yes, 3.2.10 is coming next week.
-
- adambuchweitz
- Posts: 5
- Joined:
Re: Unity: Xaml.Dependencies throws errors after updating to 3.2.9
Thank you so much! I spent some time trying to load manually, and it works fine for individual dependencies, but becomes convoluted when a xaml contains deps which contain deps, etc.Yes, 3.2.10 is coming next week.
Re: Unity: Xaml.Dependencies throws errors after updating to 3.2.9
We already released 3.2.10.
Thanks everyone for the feedback!
Thanks everyone for the feedback!
Who is online
Users browsing this forum: No registered users and 7 guests