private void RefreshLeftList(string path, string sortType = null) { try { if (this.backStackLeft.Count == 0) { backLeft.IsEnabled = false; } else { backLeft.IsEnabled = true; } MyDirectory myDirectory = new MyDirectory(path); this.currentDirectoryLeft = myDirectory; leftList.Children.Clear(); List <DiscElement> discElementsList = myDirectory.ListDiscElements(sortType); foreach (DiscElement discElement in discElementsList) { DiscElementView discElementView = new DiscElementView(discElement); leftList.Children.Add(discElementView); discElementView.openDirectory += OpenLeftDirectory; discElementView.deleteDiscElement += DeleteDiscElementLeft; } } catch (Exception e) { MessageBox.Show(e.Message); } }