[NUI]Add xFactory method to Widget view
authorFang Xiaohui <xiaohui.fang@samsung.com>
Fri, 9 Jul 2021 07:35:10 +0000 (15:35 +0800)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Fri, 9 Jul 2021 10:39:50 +0000 (19:39 +0900)
src/Tizen.NUI/src/public/Widget/WidgetView.cs

index 3270b99..941164e 100755 (executable)
@@ -41,6 +41,22 @@ namespace Tizen.NUI
         private WidgetUpdatePeriodChangedEventCallbackType widgetUpdatePeriodChangedEventCallback;
         private EventHandler<WidgetViewEventArgs> widgetFaultedEventHandler;
         private WidgetFaultedEventCallbackType widgetFaultedEventCallback;
+
+        /// <summary>
+        /// Used in xaml as factory method to create WidgetView.
+        /// </summary>
+        /// <param name="widgetId"></param>
+        /// <param name="contentInfo"></param>
+        /// <param name="width"></param>
+        /// <param name="height"></param>
+        /// <param name="updatePeriod"></param>
+        /// <returns></returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static WidgetView CreateWidgetView(string widgetId, string contentInfo, int width, int height, float updatePeriod)
+        {
+            return WidgetViewManager.Instance.AddWidget(widgetId, contentInfo, width, height, updatePeriod);
+        }
+
         /// <summary>
         /// Creates a new WidgetView.
         /// </summary>