Skip to content

Commit

Permalink
Add a progression bar on Main View while downloading stations list
Browse files Browse the repository at this point in the history
  • Loading branch information
tallichet committed May 13, 2011
1 parent cb4fa69 commit 9dd3549
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
7 changes: 6 additions & 1 deletion WindMobile-WP7/View/MainPanoramaView.xaml
Expand Up @@ -129,7 +129,12 @@
</StackPanel>
</ScrollViewer>
</controls:PanoramaItem>
</controls:Panorama>
</controls:Panorama>

<toolkit:PerformanceProgressBar Visibility="{Binding ProgressVisibility}" IsIndeterminate="True"
VerticalAlignment="Top"/>


</Grid>

<!--Panorama-based applications should not show an ApplicationBar-->
Expand Down
16 changes: 15 additions & 1 deletion WindMobile-WP7/ViewModel/MainViewModel.cs
Expand Up @@ -29,10 +29,11 @@ public class MainViewModel : ApplicationViewModel
private ListStationInfoService listService;
private RelayCommand refreshCommand;

private Visibility progressVisibility;

public MainViewModel()
{

ProgressVisibility = Visibility.Collapsed;
}

public string PageName
Expand All @@ -54,6 +55,7 @@ protected ListStationInfoService ListService
{
RaisePropertyChanged("StationInfoList");
RefreshCommand.RaiseCanExecuteChanged();
ProgressVisibility = Visibility.Collapsed;
};
listService.ErrorOccured += (s, e) =>
{
Expand Down Expand Up @@ -95,6 +97,7 @@ public RelayCommand RefreshCommand
refreshCommand = new RelayCommand(
() =>
{
ProgressVisibility = Visibility.Visible;
ListService.Refresh(null);
refreshCommand.RaiseCanExecuteChanged();
},
Expand All @@ -104,5 +107,16 @@ public RelayCommand RefreshCommand
return refreshCommand;
}
}

public Visibility ProgressVisibility
{
get { return progressVisibility; }
set
{
progressVisibility = value;
RaisePropertyChanged("ProgressVisibility");
}
}

}
}

0 comments on commit 9dd3549

Please sign in to comment.