From d93ec5c672ec5d04f340988591cdfde921f38388 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Thu, 10 Sep 2020 14:05:03 -0500 Subject: [PATCH] Name/Number edit does not work, notes to editor --- .../Classes/UI/QSelectedCueGrid.cs | 81 +++---------------- 1 file changed, 10 insertions(+), 71 deletions(-) diff --git a/qController.Standard/Classes/UI/QSelectedCueGrid.cs b/qController.Standard/Classes/UI/QSelectedCueGrid.cs index 6b3bb6d..819b165 100644 --- a/qController.Standard/Classes/UI/QSelectedCueGrid.cs +++ b/qController.Standard/Classes/UI/QSelectedCueGrid.cs @@ -41,7 +41,7 @@ namespace qController.UI Padding = 0, FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)) }; - number.SetBinding(Label.TextProperty, "number", BindingMode.TwoWay); + number.SetBinding(Label.TextProperty, "number", BindingMode.OneWay); Children.Add(number,0,0); Label type = new Label @@ -65,84 +65,23 @@ namespace qController.UI HorizontalOptions = LayoutOptions.CenterAndExpand, FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)) }; - name.SetBinding(Label.TextProperty, "name", BindingMode.TwoWay); + name.SetBinding(Label.TextProperty, "name", BindingMode.OneWay); Children.Add(name, 0, 1); SetColumnSpan(name, 5); - - Label notes = new Label + Editor notes = new Editor { - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)) + VerticalOptions = LayoutOptions.FillAndExpand, + HorizontalOptions = LayoutOptions.FillAndExpand, + Margin = 5, + BackgroundColor = Color.Transparent, + FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Editor)) }; - notes.SetBinding(Label.TextProperty, "notes", BindingMode.TwoWay); + notes.SetBinding(Editor.TextProperty, "notes", BindingMode.TwoWay); + Children.Add(notes, 0, 2); SetColumnSpan(notes, 5); - - //Double Tap to Edit - var notesDoubleTap = new TapGestureRecognizer(); - var nameDoubleTap = new TapGestureRecognizer(); - var numberDoubleTap = new TapGestureRecognizer(); - - notesDoubleTap.NumberOfTapsRequired = 2; - nameDoubleTap.NumberOfTapsRequired = 2; - numberDoubleTap.NumberOfTapsRequired = 2; - - notesDoubleTap.Tapped += (s, e) => - { - UserDialogs.Instance.Prompt(new PromptConfig - { - Title = "Update Notes", - Message = "Changes notes to update", - OkText = "Update", - Text = notes.Text, - OnAction = (qNotes) => - { - if (!qNotes.Ok) - return; - notes.Text = qNotes.Text; - } - }); - }; - - nameDoubleTap.Tapped += (s, e) => - { - UserDialogs.Instance.Prompt(new PromptConfig - { - Title = "Update Name", - Message = "Change name to update", - OkText = "Update", - Text = name.Text, - OnAction = (qName) => - { - if (!qName.Ok) - return; - name.Text = qName.Text; - } - }); - }; - - numberDoubleTap.Tapped += (s, e) => - { - UserDialogs.Instance.Prompt(new PromptConfig - { - Title = "Update Number", - Message = "Change number to update", - OkText = "Update", - Text = number.Text, - OnAction = (qNumber) => - { - if (!qNumber.Ok) - return; - number.Text = qNumber.Text; - } - }); - }; - notes.GestureRecognizers.Add(notesDoubleTap); - name.GestureRecognizers.Add(nameDoubleTap); - number.GestureRecognizers.Add(numberDoubleTap); } } }