diff --git a/qController.Standard/Classes/Cell/QSelectedCueCell.cs b/qController.Standard/Classes/Cell/QSelectedCueCell.cs index c1a4f5d..91d5fbe 100644 --- a/qController.Standard/Classes/Cell/QSelectedCueCell.cs +++ b/qController.Standard/Classes/Cell/QSelectedCueCell.cs @@ -1,4 +1,5 @@ -using System; +//NEEDS migrated to QSelectedCueGrid +using System; using Acr.UserDialogs; using qController.QItems; using Xamarin.Forms; diff --git a/qController.Standard/Classes/UI/QSelectedCueGrid.cs b/qController.Standard/Classes/UI/QSelectedCueGrid.cs new file mode 100644 index 0000000..6139c96 --- /dev/null +++ b/qController.Standard/Classes/UI/QSelectedCueGrid.cs @@ -0,0 +1,84 @@ +using Xamarin.Forms; + +namespace qController.UI +{ + public class QSelectedCueGrid : Grid + { + public QSelectedCueGrid() + { + RowSpacing = 0; + ColumnSpacing = 0; + BackgroundColor = Color.FromHex("#D8D8D8"); + + RowDefinitions.Add(new RowDefinition { Height = GridLength.Star }); + RowDefinitions.Add(new RowDefinition { Height = GridLength.Star }); + RowDefinitions.Add(new RowDefinition { Height = GridLength.Star }); + + ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Star }); + ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Star }); + ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Star }); + ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Star }); + ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Star }); + + Frame border = new Frame + { + BorderColor = Color.Black, + BackgroundColor = Color.Transparent + }; + + Children.Add(border); + + SetRowSpan(border, 3); + SetColumnSpan(border, 5); + + Label number = new Label + { + VerticalOptions = LayoutOptions.CenterAndExpand, + HorizontalOptions = LayoutOptions.CenterAndExpand, + HorizontalTextAlignment = TextAlignment.Center, + Margin = 0, + Padding = 0, + FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)) + }; + number.SetBinding(Label.TextProperty, "number", BindingMode.OneWay); + Children.Add(number,0,0); + + Label type = new Label + { + VerticalOptions = LayoutOptions.CenterAndExpand, + HorizontalOptions = LayoutOptions.CenterAndExpand, + VerticalTextAlignment = TextAlignment.Center, + HorizontalTextAlignment = TextAlignment.Center, + Margin = 0, + Padding = 0, + FontSize = App.HeightUnit * 4, + FontFamily = App.QFont + }; + type.SetBinding(Label.TextProperty, "type", BindingMode.OneWay); + Children.Add(type, 4, 0); + + + Label name = new Label + { + VerticalOptions = LayoutOptions.CenterAndExpand, + HorizontalOptions = LayoutOptions.CenterAndExpand, + FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)) + }; + name.SetBinding(Label.TextProperty, "name", BindingMode.OneWay); + Children.Add(name, 0, 1); + SetColumnSpan(name, 5); + + + Label notes = new Label + { + VerticalOptions = LayoutOptions.CenterAndExpand, + HorizontalOptions = LayoutOptions.CenterAndExpand, + FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)) + }; + notes.SetBinding(Label.TextProperty, "notes", BindingMode.OneWay); + Children.Add(notes, 0, 2); + SetColumnSpan(notes, 5); + + } + } +} diff --git a/qController.Standard/Pages/WorkspacePage.xaml b/qController.Standard/Pages/WorkspacePage.xaml index 8c69d73..6b2fd13 100644 --- a/qController.Standard/Pages/WorkspacePage.xaml +++ b/qController.Standard/Pages/WorkspacePage.xaml @@ -3,6 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:d="http://xamarin.com/schemas/2014/forms/design" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:qui="clr-namespace:qController.UI" mc:Ignorable="d" x:Class="qController.WorkspacePage"> @@ -12,10 +13,11 @@ + - - @@ -34,7 +36,6 @@ - + --> diff --git a/qController.Standard/Pages/WorkspacePage.xaml.cs b/qController.Standard/Pages/WorkspacePage.xaml.cs index a47b4cd..76d0c62 100644 --- a/qController.Standard/Pages/WorkspacePage.xaml.cs +++ b/qController.Standard/Pages/WorkspacePage.xaml.cs @@ -61,8 +61,9 @@ namespace qController { Device.BeginInvokeOnMainThread(() => { - selectedCueGrid.BindingContext = new QCueViewModel(connectedWorkspace.cueWithID(args.cueID), false); - + QCue selectedCue = connectedWorkspace.cueWithID(args.cueID); + connectedWorkspace.fetchDefaultPropertiesForCue(selectedCue); + selectedCueGrid.BindingContext = new QCueViewModel(selectedCue, false); if (cueGridDict.ContainsKey(args.cueID)) { var cueGrid = cueGridDict[args.cueID]; //element to scroll to diff --git a/qController.Standard/ViewModels/QCueViewModel.cs b/qController.Standard/ViewModels/QCueViewModel.cs index 195ffcc..d194b17 100644 --- a/qController.Standard/ViewModels/QCueViewModel.cs +++ b/qController.Standard/ViewModels/QCueViewModel.cs @@ -27,11 +27,18 @@ namespace qController.ViewModels { foreach (var property in args.properties) { - Log.Debug($"[cueviewmodel] property <{property}> has been updated."); if (property.Equals(QOSCKey.Name)) { OnPropertyChanged("name"); } + else if (property.Equals(QOSCKey.Number)) + { + OnPropertyChanged("number"); + } + else if (property.Equals(QOSCKey.Notes)) + { + OnPropertyChanged("notes"); + } else if (property.Equals(QOSCKey.ColorName)) { OnPropertyChanged("color"); @@ -53,7 +60,7 @@ namespace qController.ViewModels { get { - return cue.displayName; + return cue.listName; } set @@ -62,6 +69,14 @@ namespace qController.ViewModels } } + public string type + { + get + { + return QIcon.GetIconFromType(cue.type); + } + } + public string number { get @@ -75,6 +90,19 @@ namespace qController.ViewModels } } + public string notes + { + get + { + return cue.notes; + } + + set + { + cue.notes = value; + } + } + public Color color { get diff --git a/qController.Standard/qController.csproj b/qController.Standard/qController.csproj index 3f742b9..4943e6b 100644 --- a/qController.Standard/qController.csproj +++ b/qController.Standard/qController.csproj @@ -91,6 +91,7 @@ +