mirror of
https://github.com/jwetzell/QControlKit.git
synced 2026-08-23 16:09:09 +00:00
Scroll to Selected Cue automatically
This commit is contained in:
@@ -436,7 +436,6 @@ namespace QSharp
|
|||||||
}
|
}
|
||||||
currentCueLists.Add(cueList);
|
currentCueLists.Add(cueList);
|
||||||
index++;
|
index++;
|
||||||
valueForKey(cueList,QOSCKey.PlaybackPositionId);
|
|
||||||
}
|
}
|
||||||
QCue activeCuesList = root.cueWithID(QIdentifiers.ActiveCues, false);
|
QCue activeCuesList = root.cueWithID(QIdentifiers.ActiveCues, false);
|
||||||
if(activeCuesList != null)
|
if(activeCuesList != null)
|
||||||
|
|||||||
@@ -10,7 +10,8 @@
|
|||||||
<RowDefinition Height="200"/>
|
<RowDefinition Height="200"/>
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<ScrollView Grid.Row="1">
|
<ScrollView x:Name="cueListScrollView"
|
||||||
|
Grid.Row="1">
|
||||||
<Grid x:Name="cueListsGrid"
|
<Grid x:Name="cueListsGrid"
|
||||||
RowSpacing="0"
|
RowSpacing="0"
|
||||||
ColumnSpacing="0"
|
ColumnSpacing="0"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Security;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using QSharp;
|
using QSharp;
|
||||||
using QSharpXamDemo.ViewModels;
|
using QSharpXamDemo.ViewModels;
|
||||||
@@ -11,6 +12,7 @@ namespace QSharpXamDemo
|
|||||||
public partial class CueListPage : ContentPage
|
public partial class CueListPage : ContentPage
|
||||||
{
|
{
|
||||||
private QWorkspace connectedWorkspace;
|
private QWorkspace connectedWorkspace;
|
||||||
|
private Dictionary<string, Grid> cueGridDict = new Dictionary<string, Grid>();
|
||||||
public CueListPage(QWorkspace workspace)
|
public CueListPage(QWorkspace workspace)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@@ -27,6 +29,9 @@ namespace QSharpXamDemo
|
|||||||
Device.BeginInvokeOnMainThread(() =>
|
Device.BeginInvokeOnMainThread(() =>
|
||||||
{
|
{
|
||||||
selectedCueGrid.BindingContext = new SelectedQCueViewModel(connectedWorkspace.cueWithID(args.cueID));
|
selectedCueGrid.BindingContext = new SelectedQCueViewModel(connectedWorkspace.cueWithID(args.cueID));
|
||||||
|
|
||||||
|
if(cueGridDict.ContainsKey(args.cueID))
|
||||||
|
cueListScrollView.ScrollToAsync(cueGridDict[args.cueID].X, cueGridDict[args.cueID].Y, true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,6 +48,7 @@ namespace QSharpXamDemo
|
|||||||
var cueAddTask = new Task(() =>
|
var cueAddTask = new Task(() =>
|
||||||
{
|
{
|
||||||
Grid cueGrid = cueToGrid(aCue);
|
Grid cueGrid = cueToGrid(aCue);
|
||||||
|
cueGridDict.Add(aCue.uid, cueGrid);
|
||||||
Device.BeginInvokeOnMainThread(() =>
|
Device.BeginInvokeOnMainThread(() =>
|
||||||
{
|
{
|
||||||
cueListsGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
|
cueListsGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
|
||||||
@@ -53,6 +59,10 @@ namespace QSharpXamDemo
|
|||||||
cueAddTask.Start();
|
cueAddTask.Start();
|
||||||
cueAddTasks.Add(cueAddTask);
|
cueAddTasks.Add(cueAddTask);
|
||||||
}
|
}
|
||||||
|
Task.WhenAll(cueAddTasks).ContinueWith((task) =>
|
||||||
|
{
|
||||||
|
connectedWorkspace.valueForKey(cue, QOSCKey.PlaybackPositionId); //fetch playback position for cueList once all cue loading is done.
|
||||||
|
});
|
||||||
break; //only load first cue list with cues.
|
break; //only load first cue list with cues.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -100,6 +110,8 @@ namespace QSharpXamDemo
|
|||||||
{
|
{
|
||||||
cueGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
|
cueGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
|
||||||
var aCueGrid = cueToGrid(aCue);
|
var aCueGrid = cueToGrid(aCue);
|
||||||
|
cueGridDict.Add(aCue.uid, aCueGrid);
|
||||||
|
|
||||||
aCueGrid.Margin = new Thickness(10, 0, 0, 0);
|
aCueGrid.Margin = new Thickness(10, 0, 0, 0);
|
||||||
cueGrid.Children.Add(aCueGrid, 0, aCue.sortIndex + 1);
|
cueGrid.Children.Add(aCueGrid, 0, aCue.sortIndex + 1);
|
||||||
rows++;
|
rows++;
|
||||||
|
|||||||
Reference in New Issue
Block a user