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); //w.DataContext = m; ChatWindows.Add(w); m.LoadTabs(s.Tabs); //m.LfgOn = s.LfgOn; //m.BackgroundOpacity = s.BackgroundOpacity; }); if (ChatWindows.Count == 0) { var ws = new ChatWindowSettings(0, 1, 200, 500, true, ClickThruMode.Never, 1, false, 1, false, true, false); var m = new ChatViewModel(); var w = new ChatWindow(ws, m); SettingsHolder.ChatWindowsSettings.Add(w.WindowSettings as ChatWindowSettings); ChatWindows.Add(w); m.LoadTabs(); //m.LfgOn = ws.LfgOn; //m.BackgroundOpacity = ws.BackgroundOpacity; if (SettingsHolder.ChatEnabled) { w.Show(); } } }
private ChatWindow(ChatWindowSettings ws) { InitializeComponent(); MainContent = ChatContent; Init(ws, ignoreSize: false, undimOnFlyingGuardian: true, perClassPosition: false); AddHandler(DragablzItem.IsDraggingChangedEvent, new RoutedPropertyChangedEventHandler <bool>(OnIsDraggingChanged)); }
private ChatWindow(ChatWindowSettings ws) { InitializeComponent(); //ButtonsRef = buttons; MainContent = content; Init(ws, false, true, false); _opacityUp = new DoubleAnimation(1, TimeSpan.FromMilliseconds(120)); _opacityDown = new DoubleAnimation(0.01, TimeSpan.FromMilliseconds(120)); AddHandler(DragablzItem.IsDraggingChangedEvent, new RoutedPropertyChangedEventHandler <bool>(OnDragCompleted)); }
public ChatWindow(ChatWindowSettings ws) { InitializeComponent(); //ButtonsRef = buttons; MainContent = content; Init(ws, false, true, false); _opacityUp = new DoubleAnimation(0.01, 1, TimeSpan.FromMilliseconds(300)); _opacityDown = new DoubleAnimation(1, 0.01, TimeSpan.FromMilliseconds(300)); ChatWindowManager.Instance.PropertyChanged += Instance_PropertyChanged; //TODO: use DataContext as ChatWindowVM? AddHandler(DragablzItem.IsDraggingChangedEvent, new RoutedPropertyChangedEventHandler <bool>(OnDragCompleted)); }
public ChatWindow(ChatWindowSettings ws, ChatViewModel vm) : this(ws) { DataContext = vm; VM.WindowSettings = ws; //UpdateSettings(); (WindowSettings as ChatWindowSettings).FadeoutChanged += () => VM.RefreshHideTimer(); //(WindowSettings as ChatWindowSettings).OpacityChanged += () => VM.NotifyOpacityChanged(); VM.VisibilityChanged += OnVisibilityChanged; VM.RefreshHideTimer(); }
public ChatWindow(ChatWindowSettings ws, ChatViewModel vm) : this(ws) { DataContext = vm; VM = DataContext as ChatViewModel; if (VM == null) { return; } VM.WindowSettings = ws; ((ChatWindowSettings)WindowSettings).FadeoutChanged += () => VM.RefreshHideTimer(); VM.RefreshHideTimer(); }
public INewTabHost <Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source) { var ws = new ChatWindowSettings(0, 0, 200, 500, true, ClickThruMode.Never, 1, false, 1, false, true, false) { HideTimeout = 10, BackgroundOpacity = .3, FadeOut = true, LfgOn = false }; var model = new ChatViewModel(ws); var view = new ChatWindow(model); ChatManager.Instance.ChatWindows.Add(view); return(new NewTabHost <Window>(view, view.TabControl)); }
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(); } } }
public ChatWindow(ChatWindowSettings ws, ChatViewModel vm) : this(ws) { DataContext = vm; UpdateSettings(); }