diff --git a/qController.Standard/Classes/Cell/QSelectedCueCell.cs b/qController.Standard/Classes/Cell/QSelectedCueCell.cs index 91d5fbe..e7a9d0f 100644 --- a/qController.Standard/Classes/Cell/QSelectedCueCell.cs +++ b/qController.Standard/Classes/Cell/QSelectedCueCell.cs @@ -1,33 +1,17 @@ //NEEDS migrated to QSelectedCueGrid using System; using Acr.UserDialogs; -using qController.QItems; using Xamarin.Forms; +using qController.QItems; +using qController.Events; + namespace qController.Cell { - public class CueEditArgs : EventArgs - { - public string CueID - { - get; - set; - } - public string Property - { - get; - set; - } - public string NewValue - { - get; - set; - } - } + public class QSelectedCueCell : Frame { - public delegate void SelectedCueEditedHandler(object source, CueEditArgs args); public event SelectedCueEditedHandler SelectedCueEdited; Label name; diff --git a/qController.Standard/Classes/Events/QEventArgs.cs b/qController.Standard/Classes/Events/QEventArgs.cs new file mode 100644 index 0000000..1ebce08 --- /dev/null +++ b/qController.Standard/Classes/Events/QEventArgs.cs @@ -0,0 +1,22 @@ +using System; +namespace qController.Events +{ + public class CueEditArgs : EventArgs + { + public string CueID + { + get; + set; + } + public string Property + { + get; + set; + } + public string NewValue + { + get; + set; + } + } +} diff --git a/qController.Standard/Classes/Events/QEventHandlers.cs b/qController.Standard/Classes/Events/QEventHandlers.cs new file mode 100644 index 0000000..b7da456 --- /dev/null +++ b/qController.Standard/Classes/Events/QEventHandlers.cs @@ -0,0 +1,6 @@ +using System; +namespace qController.Events +{ + public delegate void SelectedCueEditedHandler(object source, CueEditArgs args); + +} diff --git a/qController.Standard/Classes/UI/QSelectedCueGrid.cs b/qController.Standard/Classes/UI/QSelectedCueGrid.cs index 6139c96..6b3bb6d 100644 --- a/qController.Standard/Classes/UI/QSelectedCueGrid.cs +++ b/qController.Standard/Classes/UI/QSelectedCueGrid.cs @@ -1,4 +1,5 @@ -using Xamarin.Forms; +using Acr.UserDialogs; +using Xamarin.Forms; namespace qController.UI { @@ -40,7 +41,7 @@ namespace qController.UI Padding = 0, FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)) }; - number.SetBinding(Label.TextProperty, "number", BindingMode.OneWay); + number.SetBinding(Label.TextProperty, "number", BindingMode.TwoWay); Children.Add(number,0,0); Label type = new Label @@ -64,7 +65,7 @@ namespace qController.UI HorizontalOptions = LayoutOptions.CenterAndExpand, FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)) }; - name.SetBinding(Label.TextProperty, "name", BindingMode.OneWay); + name.SetBinding(Label.TextProperty, "name", BindingMode.TwoWay); Children.Add(name, 0, 1); SetColumnSpan(name, 5); @@ -75,10 +76,73 @@ namespace qController.UI HorizontalOptions = LayoutOptions.CenterAndExpand, FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)) }; - notes.SetBinding(Label.TextProperty, "notes", BindingMode.OneWay); + notes.SetBinding(Label.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); } } } diff --git a/qController.Standard/Pages/ControlPage.xaml.cs b/qController.Standard/Pages/ControlPage.xaml.cs index 75e8ca7..9e34a50 100644 --- a/qController.Standard/Pages/ControlPage.xaml.cs +++ b/qController.Standard/Pages/ControlPage.xaml.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using Xamarin.Forms; using Serilog; using Acr.UserDialogs; + using qController.Dialogs; using qController.QItems; using qController.Cell; using qController.Communication; +using qController.Events; namespace qController { diff --git a/qController.Standard/ViewModels/QCueViewModel.cs b/qController.Standard/ViewModels/QCueViewModel.cs index d194b17..1ed68c3 100644 --- a/qController.Standard/ViewModels/QCueViewModel.cs +++ b/qController.Standard/ViewModels/QCueViewModel.cs @@ -77,6 +77,14 @@ namespace qController.ViewModels } } + public string uid + { + get + { + return cue.uid; + } + } + public string number { get diff --git a/qController.Standard/qController.csproj b/qController.Standard/qController.csproj index 4943e6b..cbfc2f2 100644 --- a/qController.Standard/qController.csproj +++ b/qController.Standard/qController.csproj @@ -92,6 +92,7 @@ +