From: Jaehyun Cho Date: Mon, 19 Dec 2022 07:59:52 +0000 (+0900) Subject: [NUI] Add ActionsProperty to AlertDialog to support xaml X-Git-Tag: accepted/tizen/unified/20231205.024657~531 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2d6bc096d890e45c9742c01ea6216256128c0293;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Add ActionsProperty to AlertDialog to support xaml To support Actions property of AlertDialog in xaml, the bindable property ActionsProperty has been added to AlertDialog. The AlertDialog example with xaml has been added to NUITizenGallery. --- diff --git a/src/Tizen.NUI.Components/Controls/AlertDialog.cs b/src/Tizen.NUI.Components/Controls/AlertDialog.cs index 642bfaf..5a4334d 100755 --- a/src/Tizen.NUI.Components/Controls/AlertDialog.cs +++ b/src/Tizen.NUI.Components/Controls/AlertDialog.cs @@ -346,6 +346,19 @@ namespace Tizen.NUI.Components { get { + return GetValue(ActionsProperty) as IEnumerable; + } + set + { + SetValue(ActionsProperty, value); + NotifyPropertyChanged(); + } + } + + private IEnumerable InternalActions + { + get + { return actionContentViews; } set diff --git a/src/Tizen.NUI.Components/Controls/AlertDialogBindableProperty.cs b/src/Tizen.NUI.Components/Controls/AlertDialogBindableProperty.cs index d25c68d..21dc5c1 100755 --- a/src/Tizen.NUI.Components/Controls/AlertDialogBindableProperty.cs +++ b/src/Tizen.NUI.Components/Controls/AlertDialogBindableProperty.cs @@ -1,4 +1,5 @@ using System.ComponentModel; +using System.Collections.Generic; using Tizen.NUI.BaseComponents; using Tizen.NUI.Binding; @@ -79,6 +80,24 @@ namespace Tizen.NUI.Components }); /// + /// ActionsProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ActionsProperty = BindableProperty.Create(nameof(Actions), typeof(IEnumerable), typeof(AlertDialog), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (AlertDialog)bindable; + if (newValue != null) + { + instance.InternalActions = newValue as IEnumerable; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (AlertDialog)bindable; + return instance.InternalActions; + }); + + /// /// ActionContentProperty /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/test/NUITizenGallery/Examples/AlertDialogTest/AlertDialogTestDialogPage.xaml b/test/NUITizenGallery/Examples/AlertDialogTest/AlertDialogTestDialogPage.xaml new file mode 100755 index 0000000..f64f702 --- /dev/null +++ b/test/NUITizenGallery/Examples/AlertDialogTest/AlertDialogTestDialogPage.xaml @@ -0,0 +1,19 @@ + + + + + + + + +