public MainWindow() { InitializeComponent(); cs = new CurrentSynchro(); DataContext = this; if (string.IsNullOrEmpty(Properties.Settings.Default.rootFolder)) { if (System.IO.Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))) { txtRootFolder.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); Properties.Settings.Default.rootFolder = txtRootFolder.Text; Properties.Settings.Default.Save(); } } else { txtRootFolder.Text = Properties.Settings.Default.rootFolder; } _rootFolder = txtRootFolder.Text; itemProvider = new ItemProvider(); items = itemProvider.GetItems(txtRootFolder.Text); //tvFilesFolders.DataContext = items; //lstFiles.DataContext = items; txtRootFolder.TextChanged += txtRootFolder_TextChanged; GetGoogleAccountSettings(); AdaptGoogleAccountList(); SetColorsOfItemList(items); //cmb_GoogleAccount.ItemsSource = GoogleAccounts; lstFiles.ItemsSource = items; }