Modifier un contrôle depuis un autre thread en WPF

Dans une application WPF, l’utilisation de plusieurs **threads **pour la modification de contrôles est plus compliquée qu’il n’y parait. Un contrôle ne peut être modifier que par le thread à qui il appartient. Par exemple: MainWindow.xaml <Window x:Class="Threads.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded"> <Grid> <Label Content="Label" Height="28" HorizontalAlignment="Left" Name="label1" /> </Grid> </Window> MainWindow.xaml.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System. [Voir plus]
WPF