[NUI] fix exception when Theme.Resource is used in xaml file
authorYeongjong Lee <cleanlyj@naver.com>
Thu, 3 Dec 2020 05:50:45 +0000 (14:50 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 15 Dec 2020 06:33:59 +0000 (15:33 +0900)
Since local value `xamlFile` is set after `LoadFromXaml()`,
`xamlFile` is always null in `Reload()`.

To fix this exception, it sets `xamlFile` before `XamlLoader.Load()`.

src/Tizen.NUI/src/public/Theme/Theme.cs

index bd40598..436362c 100644 (file)
@@ -82,7 +82,6 @@ namespace Tizen.NUI
             }
 
             LoadFromXaml(xamlFile);
-            this.xamlFile = xamlFile;
         }
 
         /// <summary>
@@ -105,7 +104,6 @@ namespace Tizen.NUI
             XamlResources.SetAndLoadSource(new Uri(themeResource), themeResource, Assembly.GetAssembly(GetType()), null);
 
             LoadFromXaml(xamlFile);
-            this.xamlFile = xamlFile;
         }
 
         /// <summary>
@@ -329,6 +327,7 @@ namespace Tizen.NUI
             {
                 using (var reader = XmlReader.Create(xamlFile))
                 {
+                    this.xamlFile = xamlFile;
                     XamlLoader.Load(this, reader);
                 }
             }