Bonjour, j'ai un fichier xml qui me sert a blinder une datagrid , se fichier est updater tout les 2 secondes, pouriez vous m'aider a gérer le refresh de mon xml data provider
car j'utilise un dispatchertimer mais parfoix la datagrid clignote de manière aléatoire.
merci de votre aide.

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
  public partial class Window1 : UserControl
    {
        DispatcherTimer timer1 ;
        XmlDataProvider vuze = new XmlDataProvider();
        Uri xml = new Uri("C:/Users/Vinzzz/Documents/Azureus_Stats.xml");
 
        public Window1()
        {
            timer1 = new DispatcherTimer(TimeSpan.FromSeconds(2.0), DispatcherPriority.Render,Timer1_Tick,Dispatcher.CurrentDispatcher);
 
            InitializeComponent();
            vuze.Source = xml;
            dataGrid1.DataContext = vuze;
            statusBar1.DataContext = vuze;
 
        }
       private void Timer1_Tick(object sender, EventArgs e)
       {
 
            vuze.Refresh();
 
        }