private void BarRemoved(Core.Model.Bar bar) { var ui = BarGrid.GetChildren <UI.Bar>().Single(b => b.Model == bar); BarGrid.Children.Remove(ui); AddLog("Bar removed"); }
private void OnTrackRemoved(Core.Model.Track track) { Stop(); var index = TrackHeaders.GetChildren <UI.Track>().Select(x => x.Model).ToList().IndexOf(track); TrackHeaders.Children.RemoveAt(index); BarGrid.RowDefinitions.RemoveAt(0); TrackHeaders.GetChildren <UI.Track>(t => Grid.GetRow(t) > index).ForEach(t => Grid.SetRow(t, Grid.GetRow(t) - 1)); BarGrid.GetChildren <UI.Bar>(b => Grid.GetRow(b) > index).ForEach(b => Grid.SetRow(b, Grid.GetRow(b) - 1)); AddLog("Track removed"); }