Add Cue type/notes to selectedCueGrid

This commit is contained in:
2020-09-10 12:24:54 -05:00
parent c66a5384c3
commit 27fb706d36
6 changed files with 125 additions and 9 deletions
@@ -1,4 +1,5 @@
using System;
//NEEDS migrated to QSelectedCueGrid
using System;
using Acr.UserDialogs;
using qController.QItems;
using Xamarin.Forms;
@@ -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);
}
}
}
@@ -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">
<Grid RowSpacing="0">
@@ -12,10 +13,11 @@
</Grid.RowDefinitions>
<qui:QSelectedCueGrid x:Name="selectedCueGrid"
Grid.Row="0"/>
<Grid x:Name="selectedCueGrid"
<!--<Grid x:Name="selectedCueGrid2"
Grid.Row="0"
RowSpacing="0"
BackgroundColor="#D8D8D8">
@@ -34,7 +36,6 @@
</Grid.ColumnDefinitions>
<Frame Grid.RowSpan="3" Grid.ColumnSpan="5" BorderColor="Black" BackgroundColor="Transparent"/>
<ActivityIndicator x:Name="workspaceLoadingIndicator" Grid.Row="1" HeightRequest="20"/>
<Label Grid.Row ="0"
Grid.Column="0"
@@ -52,7 +53,7 @@
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"
FontSize="Large"/>
</Grid>
</Grid>-->
<ScrollView x:Name="cueListScrollView"
Grid.Row="1">
@@ -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
@@ -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
+1
View File
@@ -91,6 +91,7 @@
<Folder Include="Classes\Settings\" />
<Folder Include="Classes\Dialogs\" />
<Folder Include="Classes\Buttons\" />
<Folder Include="Classes\UI\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Remove="Pages\RootPageMaster.xaml" />