Inheritance User Control not loaded in metod GUI.LoadXaml
Posted: 19 Jun 2019, 17:36
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