Bonjour,
J'essaie de mettre en place un Busyindicator lors de l'appel de méthodes de services WCF.
Voici mon code coté xml :
et voici mon code coté .cs
Code : Sélectionner tout - Visualiser dans une fenêtre à part <toolkit:BusyIndicator x:Name="BusyWindow" Content="" BusyContent="Tentative de connection..." IsBusy="{Binding IsLoading}" />
Ma classe étant de
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 private void AppelWCF() { IsLoading = true; ServiceRequest req = new ServiceRequest(); MonService.ConnecterCompleted += new EventHandler<ServiceCompletedEventArgs>(AppelWCFEvent); try { MonService.ServiceAsync(req); } catch (Exception ex){} } private void AppelWCFEvent(object sender, ServiceCompletedEventArgs e) { if (e.Error == null) { ServiceResponse rep = e.Result; //Traitement IsLoading = false; } }
avec le code suivant : INotifyPropertyChanged
Lorsque je lance l'application, rien ne se passe, une idée de ce que j'ai pu oublié?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 private bool _isLoading = true; public bool IsLoading { get { return this._isLoading; } private set { if (this._isLoading != value) { this._isLoading = value; this.RaisePropertyChanged("IsLoading"); } } } public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected void RaisePropertyChanged(string propertyName) { System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; if ((propertyChanged != null)) { propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); } }
Merci d'avance
Partager