Ignore:
Timestamp:
Aug 12, 2011, 4:32:33 PM (13 years ago)
Author:
bayral
Message:

root category handled

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/PiwigoLib/PiwigoWpf/MainWindow.xaml.cs

    r11926 r11935  
    1414using Com.Piwigo.Wpf.Helper;
    1515using Com.Piwigo.Wpf.Command;
     16using Com.Piwigo.Wpf.DTO;
    1617
    1718namespace Com.Piwigo.Wpf
     
    4243        }
    4344
     45        private void listViewCategory_PreviewMouseDown(object sender, MouseButtonEventArgs e)
     46        {
     47            e.Handled = false;
     48            DependencyObject dep = (DependencyObject)e.OriginalSource;
     49            while ((dep != null) && !(dep is TreeViewItem))
     50            {
     51                dep = VisualTreeHelper.GetParent(dep);
     52            }
     53            if (dep != null)
     54            {
     55                if (((TreeViewItem)dep).DataContext is PwgCategoryWPF)
     56                {
     57                    PwgCategoryWPF aCat = (PwgCategoryWPF)((TreeViewItem)dep).DataContext;
     58
     59                    if ((e.ChangedButton == MouseButton.Left) && (e.ClickCount == 1))
     60                    {
     61                        // left single click event
     62                        if (aCat.Childrens == null)
     63                        {
     64                            AppHelper.ExecuteCommand<PwgCmdGetSubCategorieforCategory>(aCat);
     65                        }
     66                    }
     67                }
     68            }
     69        }
     70
    4471
    4572    }
Note: See TracChangeset for help on using the changeset viewer.