private async void redrawGrid(object call) { var e = (AutoResetEvent)call; e.Dispose(); e = null; await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { if (!waitingGameOver) { testing1.DrawArray(Gamedraw); } }); }
public MainPage() { this.InitializeComponent(); testing1 = new TetrisGridArray(); bagging = new TetrisBag(); shapeCreate = new TetrisShapes(bagging.GetCurrent(), testing1, false); testing1.DrawArray(Gamedraw); var autoEvent = new AutoResetEvent(false); gravityTimer2 = new Timer(gravityCallBack, autoEvent, 1000, 500); redrawTimer = new Timer(redrawGrid, autoEvent, 150, 100); Window.Current.CoreWindow.KeyDown += CoreWindow_KeyDown; }