1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.Linq; |
---|
4 | using System.Text; |
---|
5 | using System.Windows; |
---|
6 | using System.Windows.Controls; |
---|
7 | using System.Windows.Data; |
---|
8 | using System.Windows.Documents; |
---|
9 | using System.Windows.Input; |
---|
10 | using System.Windows.Media; |
---|
11 | using System.Windows.Media.Imaging; |
---|
12 | using System.Windows.Navigation; |
---|
13 | using System.Windows.Shapes; |
---|
14 | using Com.Piwigo.Wpf.Helper; |
---|
15 | using Com.Piwigo.Wpf.Command; |
---|
16 | using Com.Piwigo.Wpf.DTO; |
---|
17 | |
---|
18 | namespace Com.Piwigo.Wpf |
---|
19 | { |
---|
20 | /// <summary> |
---|
21 | /// Interaction logic for MainWindow.xaml |
---|
22 | /// </summary> |
---|
23 | public partial class MainWindow : Window |
---|
24 | { |
---|
25 | public MainWindow() |
---|
26 | { |
---|
27 | InitializeComponent(); |
---|
28 | PwgCmdEvents.CmdRunningChanged += new PwgCmdEvents.CmdRunningChangedHandler(PwgCmdEventsConsumer.PwgCmdEvents_CmdRunningChanged); |
---|
29 | PwgCmdEvents.CmdSendUiInfo += new PwgCmdEvents.CmdSendUiInfoHandler(PwgCmdEventsConsumer.PwgCmdEvents_CmdSendUiInfo); |
---|
30 | } |
---|
31 | |
---|
32 | private void listViewAlbum_MouseDoubleClick(object sender, MouseButtonEventArgs e) |
---|
33 | { |
---|
34 | AppHelper.ExecuteCommand<PwgCmdGetImageforAlbum>(listViewAlbum.SelectedValue); |
---|
35 | } |
---|
36 | |
---|
37 | private void listViewImage_SelectionChanged(object sender, SelectionChangedEventArgs e) |
---|
38 | { |
---|
39 | if (PwgCmdSelectImageInAlbum.Command.CanExecute(sender)) |
---|
40 | { |
---|
41 | PwgCmdSelectImageInAlbum.Command.Execute(sender); |
---|
42 | } |
---|
43 | } |
---|
44 | |
---|
45 | private void listViewAlbum_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 PwgAlbumWPF) |
---|
56 | { |
---|
57 | PwgAlbumWPF aCat = (PwgAlbumWPF)((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<PwgCmdGetSubAlbumforAlbum>(aCat); |
---|
65 | } |
---|
66 | } |
---|
67 | } |
---|
68 | } |
---|
69 | } |
---|
70 | |
---|
71 | private void listViewTag_MouseDoubleClick(object sender, MouseButtonEventArgs e) |
---|
72 | { |
---|
73 | AppHelper.ExecuteCommand<PwgCmdGetImageforTag>(listViewTag.SelectedValue); |
---|
74 | } |
---|
75 | |
---|
76 | |
---|
77 | } |
---|
78 | } |
---|