source: extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdSelectImageInAlbum.cs @ 14974

Last change on this file since 14974 was 12336, checked in by bayral, 13 years ago

rename category to Albums

File size: 1.1 KB
Line 
1using System;
2using System.Collections.Generic;
3using Com.Piwigo.Lib.IService;
4using Com.Piwigo.Wpf.DTO;
5using Com.Piwigo.Lib.DTO;
6using Com.Piwigo.Wpf.DTO.Helper;
7using Com.Piwigo.Wpf.Helper;
8using Com.Piwigo.Wpf.Service;
9using System.Windows.Input;
10
11namespace Com.Piwigo.Wpf.Command
12{
13    public static class PwgCmdSelectImageInAlbum
14    {
15        public static DelegateCommand Command = new DelegateCommand(Execute, CanExecute);
16
17        private static void Execute(object obj)
18        {
19            foreach (PwgImageWPF imgWpf in PwgModelManager.Instance.ImageList)
20            {
21                if (imgWpf.IsSelected)
22                {
23                    PwgModelManager.Instance.ImageShown = imgWpf;
24                }               
25            }
26        }
27
28        private static bool CanExecute(object obj)
29        {
30            bool ret = false;
31
32            if (PwgModelManager.Instance.ImageList != null)
33            {
34                ret = (PwgModelManager.Instance.ImageList.Count >= 0);
35            }
36            return ret;   
37        }
38    }
39}
Note: See TracBrowser for help on using the repository browser.