LoginSignup
0
0

More than 5 years have passed since last update.

Visual Studio | WPF > はまりポイント > OnPropertyChanged() > INotifyPropertyChangedをクラス定義に付けないと効果がない

Last updated at Posted at 2017-11-15
動作環境
Windows 8.1 Pro (64bit)
Microsoft Visual Studio 2017 Community
Sublime Text 2

LiveCharts のサンプルコード。
https://lvcharts.net/App/examples/v1/wpf/Data%20Pagination

OnPropertyChanged()を使っている。

このコードのprivate double _to;以降をコピーして動かしてもボタン押下時の処理が実行されない。

[C# WPF]Bindingソースの更新を表示に反映する -NotifyPropertyChanged-

赤字の部分を見てください。
更新を表示に反映させたいBindingソースを持つクラスに
INotifyPropertyChangedインターフェースを実装します。

動作しない例
    public partial class MainWindow : Window
    {
動作する例
    public partial class MainWindow : Window, INotifyPropertyChanged
    {
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0