Synch fixes
[pithos-ms-client] / trunk / Pithos.Client.WPF / ShellViewModel.cs
1 using System.Windows;
2 using System.Windows.Controls;
3 using Caliburn.Micro;
4
5 namespace Pithos.Client.WPF {
6     using System.ComponentModel.Composition;
7
8     [Export(typeof(IShell))]
9     public class ShellViewModel : ViewAware, IShell
10     {
11        
12        
13         protected override void OnViewAttached(object view, object context)
14         {
15             var window = (Window)view;            
16             window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
17             window.ShowInTaskbar = false;
18             
19             base.OnViewAttached(view, context);
20         }
21
22       
23         protected override void OnViewLoaded(object view)
24         {
25             var window = (Window) view;
26             window.Hide();
27             
28             base.OnViewLoaded(view);
29         }
30
31
32         #region Status Properties
33         
34         private string _statusMessage;
35         public string StatusMessage
36         {
37             get { return _statusMessage; }
38             set
39             {
40                 _statusMessage = value;
41                 NotifyOfPropertyChange(()=>StatusMessage);
42             }
43         }
44
45         private string _usageMessage;
46         public string UsageMessage
47         {
48             get { return _usageMessage; }
49             set
50             {
51                 _usageMessage = value;
52                 NotifyOfPropertyChange(()=>UsageMessage);
53             }
54         }
55
56         private readonly IObservableCollection<FileEntry> _recentFiles=new BindableCollection<FileEntry>();
57         public IObservableCollection<FileEntry> RecentFiles
58         {
59             get { return _recentFiles; }            
60         }
61
62         #endregion
63
64
65         public void ShowPreferences()
66         {
67             var window = (Window) this.GetView();
68             window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
69             window.Show();            
70         }
71
72         public void OpenPithosFolder()
73         {
74             
75         }
76
77         public void GoToSite()
78         {
79
80         }
81
82         public void ToggleSynching()
83         {
84             
85         }
86
87         public void SaveChanges()
88         {
89             var window = (Window)GetView();
90             window.Hide();            
91         }
92
93         public void RejectChanges()
94         {
95             var window=(Window)GetView();            
96             window.Hide();
97         }
98
99     }
100 }