Moved the "Selective Sync Enabled" to the main preferences page
[pithos-ms-client] / trunk / Pithos.Client.WPF / Preferences / AccountViewModel.cs
index 24f02ec..7abeabd 100644 (file)
  * -----------------------------------------------------------------------
  */
 #endregion
+
+using System;
 using Caliburn.Micro;
 using Pithos.Interfaces;
 
 namespace Pithos.Client.WPF.Preferences
 {
     /// <summary>
-    /// ViewModel wrapper for an account
+    /// ViewModel wrapper for a settings Account object with change notifications
     /// </summary>
     public class AccountViewModel:PropertyChangedBase
     {
@@ -62,6 +64,20 @@ namespace Pithos.Client.WPF.Preferences
             _account = account;            
         }
 
+        public Uri AccountKey
+        {
+            get { return new Uri(new Uri(_account.ServerUrl) , _account.AccountName); }
+        }
+
+        public bool SelectiveSyncEnabled
+        {
+            get { return _account.SelectiveSyncEnabled; }
+            set
+            {
+                _account.SelectiveSyncEnabled = value;
+                NotifyOfPropertyChange(() => SelectiveSyncEnabled);
+            }
+        }
 
         public string AccountName
         {
@@ -120,6 +136,7 @@ namespace Pithos.Client.WPF.Preferences
             set 
             {
                 _account.ApiKey = value;
+                IsExpired = false;
                 NotifyOfPropertyChange(() => ApiKey);
             }
         }