Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
                }
            }
        }
Ejemplo n.º 3
0
 public void SetLibrary(ImageLibrary library)
 {
     CurrentLibrary = library;
     ImageIndex     = 0;
     OnPropertyChanged("ValidSorts");
 }