From a84194f4ea7f0754578d262b23c95f8c4fd35b04 Mon Sep 17 00:00:00 2001 From: darkleem Date: Mon, 17 Jul 2017 16:24:17 +0900 Subject: Fixed an issue where event occurs when Date&TimePicker is disabled - This is a patch that should be removed when the efl issue is resolved Change-Id: I76dc59476594ef774212cfcf5948d02f7fa959e1 Signed-off-by: darkleem --- .../Renderers/DatePickerRenderer.cs | 19 ++++++++++++------- .../Renderers/TimePickerRenderer.cs | 19 ++++++++++++------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/DatePickerRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/DatePickerRenderer.cs index 39a25295..73f8eab3 100644 --- a/Xamarin.Forms.Platform.Tizen/Renderers/DatePickerRenderer.cs +++ b/Xamarin.Forms.Platform.Tizen/Renderers/DatePickerRenderer.cs @@ -51,15 +51,20 @@ namespace Xamarin.Forms.Platform.Tizen void OnEntryClicked(object sender, EventArgs e) { - Native.DateTimePickerDialog dialog = new Native.DateTimePickerDialog(Forms.Context.MainWindow) + // For EFL Entry, the event will occur even if it is currently disabled. + // If the problem is resolved, no conditional statement is required. + if (Element.IsEnabled) { - Title = DialogTitle - }; + Native.DateTimePickerDialog dialog = new Native.DateTimePickerDialog(Forms.Context.MainWindow) + { + Title = DialogTitle + }; - dialog.InitializeDatePicker(Element.Date, Element.MinimumDate, Element.MaximumDate); - dialog.DateTimeChanged += OnDateTimeChanged; - dialog.Dismissed += OnDialogDismissed; - dialog.Show(); + dialog.InitializeDatePicker(Element.Date, Element.MinimumDate, Element.MaximumDate); + dialog.DateTimeChanged += OnDateTimeChanged; + dialog.Dismissed += OnDialogDismissed; + dialog.Show(); + } } void OnDateTimeChanged(object sender, Native.DateChangedEventArgs dcea) diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/TimePickerRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/TimePickerRenderer.cs index 211ccf38..bdad8a9f 100644 --- a/Xamarin.Forms.Platform.Tizen/Renderers/TimePickerRenderer.cs +++ b/Xamarin.Forms.Platform.Tizen/Renderers/TimePickerRenderer.cs @@ -56,15 +56,20 @@ namespace Xamarin.Forms.Platform.Tizen void OnClicked(object o, EventArgs e) { - Native.DateTimePickerDialog dialog = new Native.DateTimePickerDialog(Forms.Context.MainWindow) + // For EFL Entry, the event will occur even if it is currently disabled. + // If the problem is resolved, no conditional statement is required. + if (Element.IsEnabled) { - Title = DialogTitle - }; + Native.DateTimePickerDialog dialog = new Native.DateTimePickerDialog(Forms.Context.MainWindow) + { + Title = DialogTitle + }; - dialog.InitializeTimePicker(_time, null); - dialog.DateTimeChanged += OnDialogTimeChanged; - dialog.Dismissed += OnDialogDismissed; - dialog.Show(); + dialog.InitializeTimePicker(_time, null); + dialog.DateTimeChanged += OnDialogTimeChanged; + dialog.Dismissed += OnDialogDismissed; + dialog.Show(); + } } void OnDialogTimeChanged(object sender, Native.DateChangedEventArgs dcea) -- cgit v1.2.3