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
{
get {
No account is selected. Please select an account or add a new one.
</TextBlock>
</GroupBox>
- <GroupBox Header="Account" Padding="5" Margin="5,5,5,0" Height="266" HorizontalAlignment="Stretch" VerticalAlignment="Top" Grid.Column="1" Visibility="{Binding Path=CurrentAccount, Converter={StaticResource NullToVisible}}">
+ <GroupBox Header="Account" Padding="5" Margin="5,5,5,0" Height="286" HorizontalAlignment="Stretch" VerticalAlignment="Top" Grid.Column="1" Visibility="{Binding Path=CurrentAccount, Converter={StaticResource NullToVisible}}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox Name="CurrentAccount_RootPath" Margin="5" HorizontalAlignment="Stretch" IsReadOnly="True" ToolTip="{Binding CurrentAccount.RootPath}" Height="61" TextWrapping="WrapWithOverflow" />
</Grid>
- <StackPanel Orientation="Horizontal" Grid.Row="6" Grid.Column="1">
- <Button Name="SelectiveSyncFolders" Content="Selective Sync" Width="100" Style="{StaticResource ButtonStyle}" />
- <Button Name="MoveAccountFolder" Content="Move ..." Width="100" Style="{StaticResource ButtonStyle}"/>
+ <CheckBox Name="CurrentAccount_IsActive" Content="Account is Active" Grid.Row="6" Grid.Column="1" />
+ <CheckBox Name="CurrentAccount_SelectiveSyncEnabled" Content="Selective Sync Enabled" Grid.Row="7" Grid.Column="1"/>
+ <StackPanel Orientation="Horizontal" Grid.Row="8" Grid.Column="1">
+ <Button Name="SelectiveSyncFolders" Width="100" Style="{StaticResource ButtonStyle}" Content="Selective Sync" />
+ <Button Name="MoveAccountFolder" Content="Move ..." Width="100" Style="{StaticResource ButtonStyle}" Margin="20,5,5,5"/>
<Button Name="ClearAccountCache" Content="Clear Cache" Width="100" Style="{StaticResource ButtonStyle}"/>
</StackPanel>
- <CheckBox Name="CurrentAccount_IsActive" Content="Account is Active" Grid.Row="7" Grid.Column="1" />
</Grid>
</GroupBox>
\r
public bool CanSelectiveSyncFolders\r
{\r
- get { return CurrentAccount != null; }\r
+ get { return CurrentAccount != null && CurrentAccount.SelectiveSyncEnabled; }\r
}\r
\r
public void SelectiveSyncFolders()\r
set\r
{\r
_currentAccount = value;\r
- NotifyOfPropertyChange(()=>CurrentAccount);\r
+\r
+ _currentAccount.PropertyChanged += (o, e) => NotifyOfPropertyChange(() => CanSelectiveSyncFolders);\r
+\r
+ NotifyOfPropertyChange(() => CurrentAccount);\r
NotifyOfPropertyChange(() => CanRemoveAccount);\r
NotifyOfPropertyChange(() => CanSelectiveSyncFolders);\r
NotifyOfPropertyChange(() => CanMoveAccountFolder);\r
<extToolkit:BusyIndicator Name="IsBusy" BusyContent="Retrieving folders ..." DisplayAfter="0">
<Grid>
<Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
- <CheckBox x:Name="IsEnabled" Content="Enable Selective Syncing" Margin="5" Grid.Row="0"/>
- <TreeView Name="RootNodes" Margin="5" Grid.Row="1"
+ <TreeView Name="RootNodes" Margin="5" Grid.Row="0"
ItemContainerStyle="{StaticResource TreeItemStyle}"
ItemTemplate="{StaticResource CheckboxStyle}"
IsEnabled="{Binding IsEnabled}" >
</TreeView>
- <StackPanel Grid.Row="2">
+ <StackPanel Grid.Row="1">
<StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Right">
<Button Name="SaveChanges" Content="OK" Margin="5,5,10,5" Style="{StaticResource ButtonStyle}"/>
<Button Name="RejectChanges" Content="Cancel" Margin="5,5,10,5" Style="{StaticResource ButtonStyle}"/>
//_monitor = monitor;\r
_events = events;\r
_apiKey = apiKey;\r
- IsEnabled = account.SelectiveSyncEnabled;\r
+ //IsEnabled = account.SelectiveSyncEnabled;\r
TaskEx.Run(LoadRootNode);\r
}\r
\r
where record.Removed && record.Uri != null\r
select record.Uri).ToArray();\r
//TODO: Include Uris for the containers as well\r
- _events.Publish(new SelectiveSynchChanges{Enabled=IsEnabled, Account=Account,Uris=uris,Added=added,Removed=removed});\r
+ _events.Publish(new SelectiveSynchChanges{Enabled=true, Account=Account,Uris=uris,Added=added,Removed=removed});\r
\r
\r
\r
TryClose(true);\r
}\r
\r
+/*\r
private bool _isEnabled;\r
public bool IsEnabled\r
{\r
NotifyOfPropertyChange(()=>IsEnabled);\r
}\r
}\r
+*/\r
\r
private void SaveSettings(IEnumerable<Uri> uris)\r
{\r
var selections = uris.Select(uri => uri.ToString()).ToArray();\r
- Account.SelectiveSyncEnabled = IsEnabled;\r
+ //Account.SelectiveSyncEnabled = IsEnabled;\r
Account.SelectiveFolders.Clear();\r
Account.SelectiveFolders.AddRange(selections);\r
Settings.Default.Save(); \r