Statistics
| Branch: | Revision:

root / trunk / Pithos.Client.WPF / FileProperties / NewContainerViewModel.cs @ b12f73e8

History | View | Annotate | Download (1.3 kB)

1
´╗┐using System;
2
using System.Collections.Generic;
3
using System.ComponentModel.Composition;
4
using System.Linq;
5
using System.Text;
6
using Caliburn.Micro;
7
using Pithos.Core;
8

    
9
namespace Pithos.Client.WPF.FileProperties
10
{
11
    [Export(typeof(NewContainerViewModel))]
12
    public class NewContainerViewModel:Screen
13
    {
14
        public IEnumerable<string> Accounts { get; set; }
15

    
16
        private string _currentAccount;
17
        public string CurrentAccount
18
        {
19
            get { return _currentAccount; }
20
            set
21
            {
22
                _currentAccount = value;
23
                NotifyOfPropertyChange(()=>CurrentAccount);
24
            }
25
        }
26

    
27
        private string _containerName;
28
        public string ContainerName
29
        {
30
            get { return _containerName; }
31
            set
32
            {
33
                _containerName = value;
34
                NotifyOfPropertyChange(()=>ContainerName);
35
            }
36
        }
37

    
38
        public NewContainerViewModel(ShellViewModel shell)
39
        {
40
            Accounts=shell.Monitors.Select(pair => pair.Value.UserName);
41

    
42
        }
43

    
44
        public bool CanCreateContainer
45
        {
46
            get { return !String.IsNullOrWhiteSpace(CurrentAccount) && !String.IsNullOrWhiteSpace(ContainerName); }
47
        }
48

    
49
        public void CreateContainer()
50
        {
51
            
52
        }
53

    
54
    }
55
}