NextPage="{Binding ElementName=AccountPathPage}"
CanSelectNextPage="{Binding HasValidCredentials}"
>
- <extToolkit:BusyIndicator x:Name="ManualBusyIndicator" IsBusy="{Binding IsValidating,NotifyOnSourceUpdated=true}" DisplayAfter="0" >
+ <extToolkit:BusyIndicator x:Name="ManualBusyIndicator" IsBusy="{Binding IsWorking,NotifyOnSourceUpdated=true}" DisplayAfter="0" >
<extToolkit:BusyIndicator.BusyContent>
- <TextBlock x:Name="ManualBusyMessage" Text="Validating credentials" />
+ <TextBlock x:Name="ManualBusyMessage" Text="{Binding BusyTitle}" HorizontalAlignment="Center" />
</extToolkit:BusyIndicator.BusyContent>
<extToolkit:BusyIndicator.Content>
<Grid>
Title="Add an account automatically"
Description="By clicking on the button below you will be taken to the Pithos web site where you can login with your username and password."
NextPage="{Binding ElementName=AutoConfirmedPage}"
- CanSelectNextPage="{Binding HasValidCredentials}"
- cal:Message.Attach="[Event GotFocus] = [Action RetrieveCredentials()]"
+ CanSelectNextPage="{Binding HasValidCredentials}"
>
- <extToolkit:BusyIndicator IsBusy="{Binding IsRetrieving}">
+ <extToolkit:BusyIndicator x:Name="AutoBusyIndicator" IsBusy="{Binding IsWorking,NotifyOnSourceUpdated=true}" DisplayAfter="0">
<extToolkit:BusyIndicator.BusyContent>
<TextBlock TextWrapping="Wrap">
- <TextBlock HorizontalAlignment="Center">Waiting for credentials. </TextBlock>
- <TextBlock HorizontalAlignment="Center" TextWrapping="Wrap">Please enter your credentials in the Pithos logon page</TextBlock>
+ <TextBlock HorizontalAlignment="Center" Text="{Binding BusyTitle}"/>
+ <TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="{Binding BusyDetail}"/>
</TextBlock>
</extToolkit:BusyIndicator.BusyContent>
<extToolkit:BusyIndicator.Content>
- <StackPanel VerticalAlignment="Center" >
+ <StackPanel x:Name="AutoPanel" VerticalAlignment="Center" >
<Button Margin="5" Name="RetrieveCredentials" Content="Retrieve Credentials" Width="150"/>
<TextBlock Text="Credentials Retrieved Succesfully" Visibility="{Binding Converter={StaticResource BoolToVisible}, Path=HasCredentials}" Margin="10" HorizontalAlignment="Center"/>
//When the busy indicator changes, force a focus change. Workaround for delayed change of the Next button's visibility
ManualBusyMessage.IsVisibleChanged += (sender, evt) => Token.Focus(); ;
+ AutoBusyIndicator.IsVisibleChanged += (sender, evt) => RetrieveCredentials.BringIntoView();
}
}
- private bool _isRetrieving;
- public bool IsRetrieving
- {
- get { return _isRetrieving; }
- set
- {
- _isRetrieving = value;
- NotifyOfPropertyChange(() => IsRetrieving);
- }
- }
-
public async void RetrieveCredentials()
{
- IsRetrieving = true;
+ SetBusy("Waiting for credentials.", "Please enter your credentials in the Pithos logon page");
IsConfirmed = false;
try
MessageBox.Show(exc.ToString(), "Error");
throw;
}
- IsRetrieving = false;
+ finally
+ {
+ ClearBusy();
+
+ (this.GetView() as Window).Activate();
+ }
}
}
- private bool _isValidating;
- public bool IsValidating
+ private bool _isWorking;
+ public bool IsWorking
{
- get { return _isValidating; }
+ get { return _isWorking; }
set
{
- _isValidating = value;
- NotifyOfPropertyChange(()=>IsValidating);
+ _isWorking = value;
+ NotifyOfPropertyChange(()=>IsWorking);
}
}
+ private string _busyTitle;
+ public string BusyTitle
+ {
+ get { return _busyTitle; }
+ set
+ {
+ _busyTitle = value;
+ NotifyOfPropertyChange(()=>BusyTitle);
+ }
+ }
+
+ private string _busyDetail;
+ public string BusyDetail
+ {
+ get { return _busyDetail; }
+ set
+ {
+ _busyDetail = value;
+ NotifyOfPropertyChange(()=>BusyDetail);
+ }
+ }
+
+ private void SetBusy(string title,string detail)
+ {
+ IsWorking = true;
+ BusyTitle = title;
+ BusyDetail = detail;
+ }
+
+ private void ClearBusy()
+ {
+ IsWorking = false;
+ BusyTitle = "";
+ BusyDetail = "";
+
+ }
+
public async void TestAccount()
{
try
{
- IsValidating = true;
+ SetBusy("Validating Credentials","");
var client = new CloudFilesClient(AccountName, Token) {AuthenticationUrl = CurrentServer};
var containers = await TaskEx.Run(()=>
{
}
finally
{
- IsValidating = false;
+ ClearBusy();
}
}
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.26000")]
+[assembly: AssemblyVersion("1.0.0.26001")]