I have silverlight project in which the busy indicator busy content has to be changed for 3 cases like before service call it should show "started" just before service call "Inprocess" and after the service is completed it should show "Completed".
I have implemented the following code in viewmodel but only "inprocess" is showing and "started" and "Completed" are not.The public property BusyIndicatorText is binded to
busy indicator busy content and also the all the three values are getted and setted.
So pls suggest some ans:
XAML
<toolkit:BusyIndicator BusyContent="{Binding BusyIndicatorText}" IsBusy="{Binding IsBusy, Mode=TwoWay}"><br />
<grid....../><br />
</toolkit:BusyIndicator>
ViewModel
private void GetdailyExpertData()
{
try
{
if (SelectedDate != null && SelectedSite != null && !string.IsNullOrWhiteSpace(NoofWeeksBack))
{
if (SelectedDate < DateTime.Now)
{
if (Convert.ToInt32(NoofWeeksBack) >= 0)
{
int selectedSiteId = SelectedSite.Id;
previousitem = null;
IsBusy = true;
BusyIndicatorText = Convert.ToString(DataRequestStatus.Started);
//calculates the date for monday of the N weeks back the date selccted
DateTime weeksBackDate = SelectedDate.AddDays(-7 * Convert.ToInt32(noofWeeksBack));
StartDate = GetDateForSelectedWeekMonday(weeksBackDate);
//gets the date for the sunday greater or equal to the date selected
EndDate = GetDateForSundayOfweek(SelectedDate);
EventHandler<webexpertsystem.getdailyviewdatacompletedeventargs> GetDailyViewdataCompletedObject = null;
GetDailyViewdataCompletedObject += (s, e) =>
{
BusyIndicatorText = Convert.ToString(DataRequestStatus.Completed);
IsBusy = false;
IsHourlyRevertButtonVisible = false;
IsHourlyApproveButtonVisible = false;
rrProxy.ExpertSystemProxy.GetDailyViewdataCompleted -= GetDailyViewdataCompletedObject;
};
BusyIndicatorText = Convert.ToString(DataRequestStatus.InProgress);
rrProxy.ExpertSystemProxy.GetDailyViewdataCompleted += GetDailyViewdataCompletedObject;
rrProxy.ExpertSystemProxy.GetDailyViewdataAsync(RrState.TnsName, selectedSiteId, StartDate, EndDate);
}
else
{
MessageBox.Show(Resource.ExpertSystemPositiveWeekConfirm, Resource.ExpertSystemTitle, MessageBoxButton.OK);
}
}
else
{
MessageBox.Show(Resource.ExpertSystemAdvanceDateConfirm, Resource.ExpertSystemTitle, MessageBoxButton.OK);
}
}
else
{
if (SelectedDate == null)
{
MessageBox.Show(Resource.ExpertSystemDateConfirm, Resource.ExpertSystemTitle, MessageBoxButton.OK);
}
else if (SelectedSite == null)
{
MessageBox.Show(Resource.ExpertSystemSiteConfirm, Resource.ExpertSystemTitle, MessageBoxButton.OK);
}
else if (string.IsNullOrWhiteSpace(NoofWeeksBack))
{
MessageBox.Show(Resource.ExpertSystemWeeksConfirm, Resource.ExpertSystemTitle, MessageBoxButton.OK);
}
}
}
catch (Exception ex)
{
}
}