Bonjour suite à un post laisser chez les windowsformiens je viens vers vous essayer de trouver de l'aide.
Je ne développe pas du tout en Wpf et n'aurais besoin que d'infos pour pouvoir controler les images qui apparaissent dans le wpf via ma windowsForm
en exemple basique je voudrais obtenir
if blabla = truc
then image1 de wpfcontrol= invisible
Sachant que j'ai créer l'usercontrol j'arrive à l'insérer via hostedcontent mais je ne comprends pas comment intéragir avec?
Merci d'avance
edit :
suite à mes recherches en ajoutant ceci dans le code c# du control
et
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 #region Label1Value public string Label1Value { get { return (string)GetValue(Label1ValueProperty); } set { SetValue(Label1ValueProperty, value); } } public static readonly DependencyProperty Label1ValueProperty = DependencyProperty.Register( "Label1Value", typeof(string), typeof(UserControl1), new FrameworkPropertyMetadata(null, new PropertyChangedCallback(Label1ValuePropertyChanged)) ); public static void Label1ValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { UserControl1 uc = d as UserControl1; if (uc != null) { uc.label1.Content = e.NewValue as string; } } #endregion
dans ma windowsform cela modifie bien le label donc j'aimerais reussir a faire "pareil" mais en passant image1 a hidden par exemple.
Code : Sélectionner tout - Visualiser dans une fenêtre à part monUC.Label1Value = "blabla";
J'y suis presque Help !
Partager