Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

Possible Duplicate:
Why does the binding update without implementing INotifyPropertyChanged?Why does the binding update without implementing INotifyPropertyChanged?

I have WPF:

 <TextBlock Grid.Row="0" Text="{Binding SomeProperty}" /> <TextBox Grid.Row="1" Text="{Binding SomeProperty, UpdateSourceTrigger=PropertyChanged}" /> 

Bound to

 class MyModel1 { string _someProperty = string.Empty; public string SomeProperty { get { return _someProperty; } set { _someProperty = value; } } } 

It allso works with:

 class MyModel { public string SomeProperty { get; set; } } 

As You see there is no Property Change notifications, but TextBlock is updated while i am typing to TextBox. I am using Visual C# express 2010, standard WPF app project template, standard contols, no snippets, nothing additional, with .NET 4 client profile.

  • Question 1: Why it works?
  • Question 2: Is that new feature of .NET 4?
  • Question 3: How I could get notifications about property changes from my code without implementing any events in my model?

Thank You

Possible Duplicate:
Why does the binding update without implementing INotifyPropertyChanged?

I have WPF:

 <TextBlock Grid.Row="0" Text="{Binding SomeProperty}" /> <TextBox Grid.Row="1" Text="{Binding SomeProperty, UpdateSourceTrigger=PropertyChanged}" /> 

Bound to

 class MyModel1 { string _someProperty = string.Empty; public string SomeProperty { get { return _someProperty; } set { _someProperty = value; } } } 

It allso works with:

 class MyModel { public string SomeProperty { get; set; } } 

As You see there is no Property Change notifications, but TextBlock is updated while i am typing to TextBox. I am using Visual C# express 2010, standard WPF app project template, standard contols, no snippets, nothing additional, with .NET 4 client profile.

  • Question 1: Why it works?
  • Question 2: Is that new feature of .NET 4?
  • Question 3: How I could get notifications about property changes from my code without implementing any events in my model?

Thank You

Possible Duplicate:
Why does the binding update without implementing INotifyPropertyChanged?

I have WPF:

 <TextBlock Grid.Row="0" Text="{Binding SomeProperty}" /> <TextBox Grid.Row="1" Text="{Binding SomeProperty, UpdateSourceTrigger=PropertyChanged}" /> 

Bound to

 class MyModel1 { string _someProperty = string.Empty; public string SomeProperty { get { return _someProperty; } set { _someProperty = value; } } } 

It allso works with:

 class MyModel { public string SomeProperty { get; set; } } 

As You see there is no Property Change notifications, but TextBlock is updated while i am typing to TextBox. I am using Visual C# express 2010, standard WPF app project template, standard contols, no snippets, nothing additional, with .NET 4 client profile.

  • Question 1: Why it works?
  • Question 2: Is that new feature of .NET 4?
  • Question 3: How I could get notifications about property changes from my code without implementing any events in my model?

Thank You

insert duplicate link
Source Link

Possible Duplicate:
Why does the binding update without implementing INotifyPropertyChanged?

I have WPF:

 <TextBlock Grid.Row="0" Text="{Binding SomeProperty}" /> <TextBox Grid.Row="1" Text="{Binding SomeProperty, UpdateSourceTrigger=PropertyChanged}" /> 

Bound to

 class MyModel1 { string _someProperty = string.Empty; public string SomeProperty { get { return _someProperty; } set { _someProperty = value; } } } 

It allso works with:

 class MyModel { public string SomeProperty { get; set; } } 

As You see there is no Property Change notifications, but TextBlock is updated while i am typing to TextBox. I am using Visual C# express 2010, standard WPF app project template, standard contols, no snippets, nothing additional, with .NET 4 client profile.

  • Question 1: Why it works?
  • Question 2: Is that new feature of .NET 4?
  • Question 3: How I could get notifications about property changes from my code without implementing any events in my model?

Thank You

I have WPF:

 <TextBlock Grid.Row="0" Text="{Binding SomeProperty}" /> <TextBox Grid.Row="1" Text="{Binding SomeProperty, UpdateSourceTrigger=PropertyChanged}" /> 

Bound to

 class MyModel1 { string _someProperty = string.Empty; public string SomeProperty { get { return _someProperty; } set { _someProperty = value; } } } 

It allso works with:

 class MyModel { public string SomeProperty { get; set; } } 

As You see there is no Property Change notifications, but TextBlock is updated while i am typing to TextBox. I am using Visual C# express 2010, standard WPF app project template, standard contols, no snippets, nothing additional, with .NET 4 client profile.

  • Question 1: Why it works?
  • Question 2: Is that new feature of .NET 4?
  • Question 3: How I could get notifications about property changes from my code without implementing any events in my model?

Thank You

Possible Duplicate:
Why does the binding update without implementing INotifyPropertyChanged?

I have WPF:

 <TextBlock Grid.Row="0" Text="{Binding SomeProperty}" /> <TextBox Grid.Row="1" Text="{Binding SomeProperty, UpdateSourceTrigger=PropertyChanged}" /> 

Bound to

 class MyModel1 { string _someProperty = string.Empty; public string SomeProperty { get { return _someProperty; } set { _someProperty = value; } } } 

It allso works with:

 class MyModel { public string SomeProperty { get; set; } } 

As You see there is no Property Change notifications, but TextBlock is updated while i am typing to TextBox. I am using Visual C# express 2010, standard WPF app project template, standard contols, no snippets, nothing additional, with .NET 4 client profile.

  • Question 1: Why it works?
  • Question 2: Is that new feature of .NET 4?
  • Question 3: How I could get notifications about property changes from my code without implementing any events in my model?

Thank You

Post Closed as "exact duplicate" by nemesv, N_A, LPL, brunnerh, CommunityBot
edited title; edited tags
Link
brunnerh
  • 188k
  • 30
  • 362
  • 434

WPF Binding, Model property change notifications

Source Link
Dule
  • 13
  • 2
Loading