public MainWindow() { TaskbarItemInfo = new System.Windows.Shell.TaskbarItemInfo(); TaskbarItemInfo.ProgressState = System.Windows.Shell.TaskbarItemProgressState.None; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException; InitializeComponent(); viewModel = new MainScreenVM(); DataContext = viewModel; viewModel.SearchBoxChanged += viewModel_SearchBoxChanged; viewModel.ProviderChanged += viewModel_ProviderChanged; ImageList.SelectedItem = null; if (GlobalSettings.Instance.MainScreenWidth > 0) { this.Width = GlobalSettings.Instance.MainScreenWidth; this.Height = GlobalSettings.Instance.MainScreenHeight; } }