Inheritance User Control not loaded in metod GUI.LoadXaml
Hi.
I have load views in Run Time
this is Working:
"VbGridContainer" is a ViewBox
this - not working in Unity
(*in WPF - working):
Console: XAML not found 'Assets/Grids/Name.xaml'
Base grid is inheritance UserControl
In xaml dependencies attached:
there is a way do not duplicate class code and use inheritance ?
it should just work because is typical case.
Notes for 2.2.3
Unity 2019.1.5f1
I have load views in Run Time
this is Working:
Code: Select all
#if NOESIS
UserControl control;
control = (UserControl)GUI.LoadXaml("Assets/GridsPreview/" + LayoutManager.CreateStringGridName(layoutType, layoutSizeType) + ".xaml");
VbGridContainer.Child = control;
#else
//WPF load
VbGridContainer.Child = LayoutManager.CreatePreview(layoutType, layoutSizeType);
#endif
this - not working in Unity
(*in WPF - working):
Code: Select all
private BaseGrid _grid;
#if NOESIS
_grid = (BaseGrid)GUI.LoadXaml("Assets/Grids/" + LayoutManager.CreateStringGridName(layoutType, layoutSizeType) + ".xaml");
#else
//WPF load
_grid = LayoutManager.Create(layoutType, layoutSizeType);
#endif
VbGridContainer.Child = _grid;
Base grid is inheritance UserControl
Code: Select all
public abstract class BaseGrid: UserControl
{ … }
Code: Select all
<noesis:Xaml.Dependencies>
<noesis:Dependency Source="GridsPreview/Name1.xaml"/>
<noesis:Dependency Source="GridsPreview/name2.xaml"/>
...and 30
<noesis:Dependency Source="Grids/Name1.xaml"/>
<noesis:Dependency Source="Grids/Name2.xaml"/>
...
</noesis:Xaml.Dependencies>
it should just work because is typical case.
Notes for 2.2.3
Unity 2019.1.5f1
Re: Inheritance User Control not loaded in metod GUI.LoadXaml
Sorry all samples woks
I wrote the wrong sourse in NoesisGUIExtensions
resolve:
The start XAML file was in a separate folder branch
I wrote the wrong sourse in NoesisGUIExtensions
resolve:
Code: Select all
<NoesisGUIExtensions:Xaml.Dependencies>
<NoesisGUIExtensions:Dependency Source="../../Grids/Name1.xaml"/>
<NoesisGUIExtensions:Dependency Source="../../Grids/Name2.xaml"/>
<NoesisGUIExtensions:Dependency Source="../../Grids/Name3.xaml"/>
...
</NoesisGUIExtensions:Xaml.Dependencies>
Re: Inheritance User Control not loaded in metod GUI.LoadXaml
Great to know you solved it. Closing this.
Who is online
Users browsing this forum: Kate_ferris and 1 guest