Click here to Skip to main content
15,894,896 members

Silverlight Busy indicator Busy Content is not Changing

Smrutiranjan Parida asked:

Open original thread
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)
{

}
}
Tags: C#, Silverlight

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900