inedi
Topic Author
Posts: 8
Joined: 06 Jan 2019, 18:16

Inheritance User Control not loaded in metod GUI.LoadXaml

19 Jun 2019, 17:36

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

Tags:
 
inedi
Topic Author
Posts: 8
Joined: 06 Jan 2019, 18:16

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

20 Jun 2019, 09:41

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
 
User avatar
jsantos
Site Admin
Posts: 3201
Joined: 20 Jan 2012, 17:18
Contact:

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

20 Jun 2019, 11:35

Great to know you solved it. Closing this.

Who is online

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