Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 13 hours ago.
(Private feedback for you)
Unable to apply value for bind property if Object is used.
Void buttonClick(object sender){
chnageColor = Gray; // turns all label foreground to gray
Label l1 = sender as Label;
l1.foreground = blue;
MessageBox.show("Label 1 clicked");
chnageColor = Gray; // turns all label foreground to blue
}
when i try to set color to l1 label using chnageColor (foreground={Binding changecolor}) it is not working.
XAML:-
</Label>
<Label x:Name="Label2" Width="200" Height="40" Foreground="{Binding chnageColor}">
<Label.InputBindings>
<MouseBinding Command="{Binding buttonClick}" CommandParameter="{x:Reference Label2}" MouseAction="LeftClick" />
</Label.InputBindings>
</Label>/
</Label>
<Label x:Name="Label3" Width="200" Height="40" Foreground="{Binding chnageColor}">
<Label.InputBindings>
<MouseBinding Command="{Binding buttonClick}" CommandParameter="{x:Reference Label3}" MouseAction="LeftClick" />
</Label.InputBindings>
</Label>/
