[EditorBrowsable(EditorBrowsableState.Never)]
public static TXaml LoadFromEXamlPath<TXaml>(this TXaml view, string path)
{
+ MainAssembly = view.GetType().Assembly;
//This EXaml file will be converted by Tizen.NUI.XamlBuild from the .xaml
string xamlScript = GetXamlFromPath(path);
LoadEXaml.Load(view, xamlScript);
/// Internal used, will never be opened.
[EditorBrowsable(EditorBrowsableState.Never)]
- public static TXaml LoadFromEXamlPath<TXaml>(this TXaml view, Type callingType)
+ public static T LoadFromEXamlPath<T>(this T view, Type callingType)
{
if (null == callingType)
{
/// Internal used, will never be opened.
[EditorBrowsable(EditorBrowsableState.Never)]
+ public static T LoadFromEXamlByRelativePath<T>(this T view, string eXamlPath)
+ {
+ if (null == eXamlPath)
+ {
+ return view;
+ }
+
+ MainAssembly = view.GetType().Assembly;
+
+ string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
+
+ Tizen.Log.Fatal("NUI", "the resource path: " + resource);
+ int windowWidth = NUIApplication.GetDefaultWindow().Size.Width;
+ int windowHeight = NUIApplication.GetDefaultWindow().Size.Height;
+
+ string likelyResourcePath = resource + eXamlPath;
+
+ //Find the xaml file in the layout folder
+ if (File.Exists(likelyResourcePath))
+ {
+ StreamReader reader = new StreamReader(likelyResourcePath);
+ var xaml = reader.ReadToEnd();
+ reader.Close();
+ reader.Dispose();
+
+ LoadEXaml.Load(view, xaml);
+ }
+ else
+ {
+ throw new Exception($"Can't find examl file {eXamlPath}");
+ }
+
+ return view;
+ }
+
+ /// Used for TCT and TC coverage, will never be opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static T LoadFromEXaml<T>(this T view, string eXamlStr)
+ {
+ if (null == eXamlStr)
+ {
+ return view;
+ }
+
+ MainAssembly = view.GetType().Assembly;
+
+ LoadEXaml.Load(view, eXamlStr);
+
+ return view;
+ }
+
+ /// Internal used, will never be opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static Assembly MainAssembly
{
get;