private static void ProvideReplay(EncounterDetection encounterdetection) { //Set new Datacontext for AnalyseTab and switch to this tab var startview = Application.Current.Windows.Cast <Window>().FirstOrDefault(window => window is StartView) as StartView; TabItem tabView = startview.MainTabControl.Items[1] as TabItem; Application.Current.Dispatcher.BeginInvoke((Action)(() => startview.MainTabControl.SelectedIndex = 1)); Application.Current.Dispatcher.BeginInvoke((Action)(() => tabView.DataContext = new AnalyseTabModel(encounterdetection))); }
public AnalyseTabModel(EncounterDetection EncounterDetection) { // Update mapname and tickrate property of the view MapName = EncounterDetection.Data.Mapmeta.Mapname; TickRate = EncounterDetection.Data.Tickrate.ToString(); // Analyse the replay and create data for visual representation Replay = EncounterDetection.DetectEncounters(); //Initalize the renderer for the created replay data Renderer = new GameRenderer(EncounterDetection.Data.Mapmeta); }