Changing a Label Content of Page 2 from Page in WPF

Posted by Vuyiswamb under WPF on 2/17/2015 | Points: 10 | Views : 655 | Status : [Member] [MVP] [Administrator] | Replies : 1
Good Day All

I have two WPF Pages Page 1 and Page 2. i want to change the a Label of Page 2 from Page 1.

tried to create an Instance of Page 2 in Page 1 and access the label and Change the content property before i explore the Property Solution if there is anyone who has a different solution. please help

Thanks

Thank you for posting at Dotnetfunda
[Administrator]



Responses

Posted by: Jitendrasoft09 on: 2/20/2015 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi,

Using property, we can change the label of Page 1 from Page 2, please have a look below code snippet where label could be changed by referring binding name in XAML of WPF.

private string _labelname;

public string labelname
{
get
{
return _labelname;
}

set
{
_labelname=value;
OnPropertyChanged("labelname");


Please refer below link for more details.
stackoverflow.com/questions/21729886/how-to-change-labels-content-in-an-user-control-from-void-in-a-class-wpf

Jitendra Kumar
If my post helps you, plz mark as an answer.

Vuyiswamb, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response