Modify main() to use static registrar in UA app (#169)
author안주원/Common Platform Lab(SR)/Principal Engineer/삼성전자 <juwon.ahn@samsung.com>
Thu, 26 Mar 2020 22:30:21 +0000 (07:30 +0900)
committer윤정현/Common Platform Lab(SR)/Staff Engineer/삼성전자 <jh0506.yun@samsung.com>
Thu, 26 Mar 2020 22:30:21 +0000 (07:30 +0900)
test/UnderArmour/MapMyRun/MapMyRun.Tizen/MapMyRun.cs

index d25940017b6b6ac92648f25be1aa5c65650904a2..5088bc20e84b86272ed7aafc8281c0d59b9c7f8b 100755 (executable)
@@ -1,23 +1,37 @@
-using System;
-using Xamarin.Forms;
-
 namespace MapMyRun.Tizen
 {
-    class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication
+    class Program : global::Xamarin.Forms.Platform.Tizen.ApplicationLifecycle
     {
         protected override void OnCreate()
         {
             base.OnCreate();
 
-            LoadApplication(new App());
+            FormsApplication.LoadApplication(new App());
         }
 
         static void Main(string[] args)
         {
             var app = new Program();
-            Forms.Init(app);
+           var customRenderers = new Dictionary<Type, Func<IRegisterable>>()
+           {
+                   { typeof(CirclePage), ()=> new CirclePageRenderer() },
+                    { typeof(global:: Tizen.Wearable.CircularUI.Forms.CircleListView), () => new CircleListViewRenderer() },
+                    { typeof(global:: Tizen.Wearable.CircularUI.Forms.CircleScrollView), () => new global::Tizen.Wearable.CircularUI.Forms.Renderer.CircleScrollViewRenderer() }
+            };
+           
+           var option = new InitializationOptions(app)
+           {
+                   UseMessagingCenter = false,
+                   UseStyle = true,
+                    UseShell = false,
+                   UseVisual = false,
+                   StaticRegistarStrategy = StaticRegistrarStrategy.StaticRegistrarOnly,
+                   CustomHandlers = customRenderers,
+                   Flags = InitializationFlags.DisableCss
+           };
+            Forms.Init(option);
             global::Tizen.Wearable.CircularUI.Forms.Renderer.FormsCircularUI.Init();
-            app.Run(args);
+            app.FormsApplication.Run(args);
         }
     }
 }