//Tile has requested to be removed public void deleteTile(object sender, TileArgs ta) { Tile t = (Tile)sender; t.animateTerminate(); if (t.b_isPinned == false && t.lst_hwID.Count < 1) { deleteQueue.Add(t); t.beginCloseAnimation(); ShiftTiles(DockTiles.IndexOf(t)); try { //Zach is credit to team! Timer removeTileTimer = new Timer(); removeTileTimer.Interval = 200; removeTileTimer.Enabled = true; removeTileTimer.Elapsed += (sender2, e2) => { this.Dispatcher.BeginInvoke(new Action(() => { DockTiles.Remove(t); CanvasMain.Children.Remove(t); resizeMainBar(); })); }; } catch { } } }
static void sh_WindowDestroyed(ShellHook sender, IntPtr hWnd) { foreach (UserControl t in Globals.MainDock.DockTiles) { if (t is Tile) { Tile t2 = (Tile)t; if (Helpers.GetProcessName(hWnd).Equals(t2.s_AppPath) == true || (t2.hwID == hWnd)) { TileArgs ta = new TileArgs(""); t2.lst_hwID.Remove(hWnd); Globals.MainDock.deleteTile(t2, ta); } } } }