private void InitWindows() { ChatWindows.Clear(); App.Settings.ChatWindowsSettings.ToList().ForEach(s => { if (s.Tabs.Count == 0) { return; } var m = new ChatViewModel(s); var w = new ChatWindow(m); ChatWindows.Add(w); m.LoadTabs(s.Tabs); }); if (ChatWindows.Count != 0) { return; } { Log.CW("No chat windows found, initializing default one."); var ws = new ChatWindowSettings(0, 1, 200, 500, true, ClickThruMode.Never, 1, false, 1, false, true, false) { HideTimeout = 10, FadeOut = true, LfgOn = false }; var m = new ChatViewModel(ws); var w = new ChatWindow(m); App.BaseDispatcher.InvokeAsync(() => { App.Settings.ChatWindowsSettings.Add((ChatWindowSettings)w.WindowSettings); }); ChatWindows.Add(w); m.LoadTabs(); if (App.Settings.ChatEnabled) { w.Show(); } } }
public void InitWindows() { ChatWindows.Clear(); SettingsHolder.ChatWindowsSettings.ToList().ForEach(s => { if (s.Tabs.Count == 0) { return; } var m = new ChatViewModel(); var w = new ChatWindow(s, m); ChatWindows.Add(w); m.LoadTabs(s.Tabs); }); if (ChatWindows.Count != 0) { return; } { Log.CW("No chat windows found, initializing default one."); var ws = new ChatWindowSettings(0, 1, 200, 500, true, ClickThruMode.Never, 1, false, 1, false, true, false) { HideTimeout = 10, FadeOut = true, LfgOn = false }; var m = new ChatViewModel(); var w = new ChatWindow(ws, m); SettingsHolder.ChatWindowsSettings.Add(w.WindowSettings as ChatWindowSettings); ChatWindows.Add(w); m.LoadTabs(); if (SettingsHolder.ChatEnabled) { w.Show(); } } }