private void Window_Loaded(object sender, RoutedEventArgs e) { Sentry.AddHandler(this.Dispatcher); WpfScreen screen = WpfScreen.FromWindow(this); if (!screen.WorkingArea.IntersectsWith(new Rect(this.Left, this.Top, this.Width, this.Height))) { this.Left = screen.WorkingArea.Left + 200; this.Top = screen.WorkingArea.Top + 200; } }
public MainWindow() { Settings.Load(); MainWindow.instance = this; this.m_buffList = new ObservableCollection <FStatus>(); this.m_buffListView = (CollectionView)CollectionViewSource.GetDefaultView(this.m_buffList); this.m_buffListView.Filter = this.BuffListView_Filter; ActiveLiveFiltering(this.m_buffListView, "IsChecked"); this.m_processListView = (CollectionView)CollectionViewSource.GetDefaultView(this.m_processList); this.DataContext = Settings.Instance; InitializeComponent(); var interop = new WindowInteropHelper(this); interop.EnsureHandle(); this.Handle = interop.Handle; Sentry.AddHandler(this.Dispatcher); this.ctlContent.IsEnabled = false; }