private void LibraryTreeList_OnMouseDoubleClick(object sender, MouseButtonEventArgs e) { var value = LibraryTreeList.SelectedItem as ImageLibrary; if (value != null) { Process.Start(value.SourceUrl); } else { var newValue = LibraryTreeList.SelectedItem as ImageData; if (newValue == null) { return; } ImageLibrary subLibrary = Browser.CurrentLibrary.CreateSubLibrary(newValue); if (subLibrary == null) { return; } Libraries.Add(subLibrary); Browser.SetLibrary(subLibrary); } }
private void LibraryTreeList_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { var value = e.NewValue as ImageLibrary; if (value != null && value != Browser.CurrentLibrary) { LibraryIndex = Libraries.IndexOf(value); } else { var newValue = e.NewValue as ImageData; if (newValue != null && Browser.CurrentImage != newValue) { var foundLibrary = ImageLibrary.FindImageInLibraries(Libraries, newValue); if (Browser.CurrentLibrary != foundLibrary) { LibraryIndex = Libraries.IndexOf(ImageLibrary.FindImageInLibraries(Libraries, newValue)); } Browser.SetIndexToImage(newValue); } } }
public void SetLibrary(ImageLibrary library) { CurrentLibrary = library; ImageIndex = 0; OnPropertyChanged("ValidSorts"); }