* QCueGrid.cs: Rebuild cue grid when children cue change

* QCueGridListHelper.cs: Helper class for linking cue id with cue grid

* QCueViewModel.cs: Revoe unused import

* QBrowserPage.xaml.cs:
* ControlPage.xaml.cs:
* QWorkspaceViewModel.cs:
* qConnectionPage.xaml.cs: Remove unused import

* QWorkspacePage.xaml.cs: Fix scrolling to select cue and handle no
  selected cue
This commit is contained in:
2021-02-12 22:55:01 -05:00
parent c0c027d334
commit 6818a14940
8 changed files with 134 additions and 31 deletions
@@ -1,10 +1,45 @@
using System;
namespace qController
// Allows the "storage" of links between cue ids and QCueGrids
// a little hacky but works with the recursive nature of QCueGrids
// used mainly for scrolling to the appropriate QCueGrid when selected cue changes
using System.Collections.Generic;
namespace qController.UI
{
public class QCueGridListHelper
{
public QCueGridListHelper()
private static Dictionary<string, QCueGrid> cueGridDict;
static QCueGridListHelper()
{
cueGridDict = new Dictionary<string, QCueGrid>();
}
public static void reset()
{
cueGridDict.Clear();
}
public static void insert(string cueID, QCueGrid cueGrid)
{
if (cueGridDict.ContainsKey(cueID))
{
cueGridDict[cueID] = cueGrid;
}
else
{
cueGridDict.Add(cueID, cueGrid);
}
}
public static QCueGrid get(string cueID)
{
if (cueGridDict.ContainsKey(cueID))
{
return cueGridDict[cueID];
}
else {
return null;
}
}
}
}