mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-18 05:34:16 +00:00
Address some formatting things and update Packages
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
using Xamarin.Forms;
|
||||
using qController.ViewModels;
|
||||
using QControlKit;
|
||||
using Serilog;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace qController.UI
|
||||
{
|
||||
@@ -38,18 +38,18 @@ namespace qController.UI
|
||||
//Group List "Frame" added early so other children or "on top"
|
||||
if (cue.cues.Count > 0)
|
||||
{
|
||||
var cueFrame = new Frame
|
||||
Frame cueFrame = new Frame
|
||||
{
|
||||
BackgroundColor = Color.Transparent,
|
||||
BorderColor = Color.Black,
|
||||
Margin = qCueViewModel.nestPadding
|
||||
};
|
||||
Children.Add(cueFrame, 1, 0);
|
||||
Grid.SetRowSpan(cueFrame, cue.cues.Count + 1);
|
||||
Grid.SetColumnSpan(cueFrame, ColumnDefinitions.Count - 1);
|
||||
SetRowSpan(cueFrame, cue.cues.Count + 1);
|
||||
SetColumnSpan(cueFrame, ColumnDefinitions.Count - 1);
|
||||
}
|
||||
|
||||
var cueLabel = new Label
|
||||
Label cueLabel = new Label
|
||||
{
|
||||
BindingContext = qCueViewModel,
|
||||
HorizontalOptions = LayoutOptions.FillAndExpand,
|
||||
@@ -61,7 +61,7 @@ namespace qController.UI
|
||||
cueLabel.SetDynamicResource(Label.TextColorProperty, "PrimaryTextColor");
|
||||
cueLabel.SetBinding(Label.MarginProperty, "nestPadding", BindingMode.OneWay);
|
||||
|
||||
var cueTypeLabel = new Label
|
||||
Label cueTypeLabel = new Label
|
||||
{
|
||||
FontFamily = (OnPlatform<string>)Application.Current.Resources["QFontFamily"],
|
||||
BindingContext = qCueViewModel,
|
||||
@@ -91,7 +91,7 @@ namespace qController.UI
|
||||
if (!cue.IsCueList)
|
||||
{
|
||||
//Section for selecting a cue by tapping the name Label
|
||||
var selectCueGesture = new TapGestureRecognizer();
|
||||
TapGestureRecognizer selectCueGesture = new TapGestureRecognizer();
|
||||
selectCueGesture.Tapped += (sender, e) =>
|
||||
{
|
||||
//TODO: need to make this work regardless of the cue list a cue is in
|
||||
@@ -103,13 +103,13 @@ namespace qController.UI
|
||||
//Add collapse gesture to the cue type icon if it is a group cue
|
||||
if (cue.IsGroup)
|
||||
{
|
||||
var CollapseGroupCueGesture = new TapGestureRecognizer();
|
||||
TapGestureRecognizer CollapseGroupCueGesture = new TapGestureRecognizer();
|
||||
CollapseGroupCueGesture.Tapped += (sender, e) =>
|
||||
{
|
||||
if (cue.IsGroup)
|
||||
{
|
||||
qCueViewModel.IsCollapsed = !qCueViewModel.IsCollapsed;
|
||||
for (var i = 1; i < RowDefinitions.Count; i++)
|
||||
for (int i = 1; i < RowDefinitions.Count; i++)
|
||||
{
|
||||
RowDefinitions[i].Height = qCueViewModel.IsCollapsed ? 0 : GridLength.Auto;
|
||||
|
||||
@@ -117,9 +117,9 @@ namespace qController.UI
|
||||
|
||||
if (Device.RuntimePlatform.Equals(Device.Android))
|
||||
{
|
||||
foreach (var child in Children)
|
||||
foreach (View child in Children)
|
||||
{
|
||||
if (Grid.GetRow(child) > 0)
|
||||
if (GetRow(child) > 0)
|
||||
{
|
||||
child.IsVisible = !qCueViewModel.IsCollapsed;
|
||||
}
|
||||
@@ -130,7 +130,7 @@ namespace qController.UI
|
||||
cueTypeLabel.GestureRecognizers.Add(CollapseGroupCueGesture);
|
||||
}
|
||||
|
||||
var cueBackground = new Frame
|
||||
Frame cueBackground = new Frame
|
||||
{
|
||||
BindingContext = qCueViewModel,
|
||||
Opacity = 0.50,
|
||||
@@ -142,7 +142,7 @@ namespace qController.UI
|
||||
cueBackground.SetBinding(BackgroundColorProperty, "color", BindingMode.OneWay);
|
||||
|
||||
//TODO: find a solution so the selected cue indicator is under the frame
|
||||
var cueSelectedIndicator = new Frame
|
||||
Frame cueSelectedIndicator = new Frame
|
||||
{
|
||||
BindingContext = qCueViewModel,
|
||||
BackgroundColor = Color.Blue,
|
||||
@@ -152,30 +152,32 @@ namespace qController.UI
|
||||
cueSelectedIndicator.SetBinding(IsVisibleProperty, "IsSelected");
|
||||
|
||||
Children.Add(cueSelectedIndicator, 0, 0);
|
||||
Grid.SetColumnSpan(cueSelectedIndicator, ColumnDefinitions.Count);
|
||||
SetColumnSpan(cueSelectedIndicator, ColumnDefinitions.Count);
|
||||
Children.Add(cueBackground, 0, 0);
|
||||
Grid.SetColumnSpan(cueBackground, ColumnDefinitions.Count);
|
||||
SetColumnSpan(cueBackground, ColumnDefinitions.Count);
|
||||
|
||||
Children.Add(cueTypeLabel, 0, 0);
|
||||
Children.Add(cueLabel, 1, 0);
|
||||
|
||||
if (cue.cues.Count > 0)
|
||||
{
|
||||
foreach (var aCue in cue.cues)
|
||||
foreach (QCue aCue in cue.cues)
|
||||
{
|
||||
this.RowDefinitions.Add(
|
||||
RowDefinitions.Add(
|
||||
new RowDefinition
|
||||
{
|
||||
Height = GridLength.Auto,
|
||||
BindingContext = new QCueViewModel(aCue, false)
|
||||
}
|
||||
);
|
||||
var aCueGrid = new QCueGrid(aCue);
|
||||
//cueGridDict.Add(aCue.uid, aCueGrid);
|
||||
aCueGrid.Margin = new Thickness(0, 0, 0, 0);
|
||||
QCueGrid aCueGrid = new QCueGrid(aCue)
|
||||
{
|
||||
//cueGridDict.Add(aCue.uid, aCueGrid);
|
||||
Margin = new Thickness(0, 0, 0, 0)
|
||||
};
|
||||
QCueGridListHelper.insert(aCue.uid, aCueGrid);
|
||||
Children.Add(aCueGrid, 0, aCue.sortIndex + 1);
|
||||
Grid.SetColumnSpan(aCueGrid, this.ColumnDefinitions.Count);
|
||||
SetColumnSpan(aCueGrid, ColumnDefinitions.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -185,10 +187,10 @@ namespace qController.UI
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
//Nuke current grid
|
||||
var children = this.Children.ToList();
|
||||
foreach (var child in children)
|
||||
List<View> children = Children.ToList();
|
||||
foreach (View child in children)
|
||||
{
|
||||
this.Children.Remove(child);
|
||||
Children.Remove(child);
|
||||
}
|
||||
|
||||
RowDefinitions = new RowDefinitionCollection();
|
||||
|
||||
Reference in New Issue
Block a user