Bonsoir,

Quelqu'un peut m'aider avec ce code svp:

*************

Ce namespace à ne pas toucher car il appartient à une api (.dll) que j'utilise.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
namespace Sipek.Common
{
    public delegate void DAccountStateChanged(int accountId, int accState);
}
*************

Le code à modifier:

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
26
27
28
 
namespace MaSolution
{
public partial class MainWindow : Window
{
public Constructeur()
{
        registrar.AccountStateChanged += new DAccountStateChanged(proxy_AccountStateChanged);
}
 
void proxy_AccountStateChanged(int accountId, int accState)
    {
      if (this.InvokeRequired)
      {
        Invoke(new DAccountStateChanged(proxy_AccountStateChanged), new object[] {accountId, accState});
      }
      else 
      {
        sync_AccountStateChanged(accountId, accState);
      }
    }
 
private void sync_AccountStateChanged(int accId, int accState)
    {
          this.textBoxStatus.Text = accState.ToString();
    }
}
}
je veux le transformer de windows forms à WPF mais je suis bloqué avec les delegates en wpf.

Quelqu'un peut m'aider svp.

Merci d'avance!