Page 1 of 1

Inheritance User Control not loaded in metod GUI.LoadXaml

Posted: 19 Jun 2019, 17:36
by inedi
Hi.
I have load views in Run Time

this is Working:
#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
"VbGridContainer" is a ViewBox

this - not working in Unity
(*in WPF - working):
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;
Console: XAML not found 'Assets/Grids/Name.xaml'

Base grid is inheritance UserControl
 public abstract class BaseGrid: UserControl
    { … }
In xaml dependencies attached:
<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>
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

Re: Inheritance User Control not loaded in metod GUI.LoadXaml

Posted: 20 Jun 2019, 09:41
by inedi
Sorry all samples woks
I wrote the wrong sourse in NoesisGUIExtensions

resolve:
 <NoesisGUIExtensions:Xaml.Dependencies>
       <NoesisGUIExtensions:Dependency Source="../../Grids/Name1.xaml"/>
        <NoesisGUIExtensions:Dependency Source="../../Grids/Name2.xaml"/>
        <NoesisGUIExtensions:Dependency Source="../../Grids/Name3.xaml"/>
...
 </NoesisGUIExtensions:Xaml.Dependencies>
The start XAML file was in a separate folder branch

Re: Inheritance User Control not loaded in metod GUI.LoadXaml

Posted: 20 Jun 2019, 11:35
by jsantos
Great to know you solved it. Closing this.