Created
August 28, 2015 11:42
-
-
Save Grabacr07/99a05f0c4c9631bbbb89 to your computer and use it in GitHub Desktop.
.NET Framework 4.5 だと動く。4.5.1 だと例外スローされる。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window x:Class="WpfApplication38.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Width="200" | |
Height="100"> | |
<TextBox Text="{Binding SampleText}" /> | |
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.ComponentModel; | |
namespace WpfApplication38 | |
{ | |
partial class MainWindow | |
{ | |
public MainWindow() | |
{ | |
this.InitializeComponent(); | |
this.DataContext = new ViewModel(); | |
} | |
} | |
public class ViewModel : INotifyPropertyChanged | |
{ | |
public string SampleText { get; private set; } = "なぜか動く"; | |
public event PropertyChangedEventHandler PropertyChanged; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ViewModel が INotifyPropertyChanged を実装していない場合、.NET Frameowrk 4.5 でも動かなくなる。っぽい。