Skip to content

Instantly share code, notes, and snippets.

@runceel
Last active January 21, 2019 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save runceel/a91e5324f06fbddd0d53caf41f063756 to your computer and use it in GitHub Desktop.
Save runceel/a91e5324f06fbddd0d53caf41f063756 to your computer and use it in GitHub Desktop.
// 定義
class Poco
{
public string Name { get; set; }
}
// ViewModel
class MyVM
{
private Poco Poco { get; }
public ReadOnlyReactiveProperty<string> Name { get; }
public MyVM()
{
Poco = new Poco();
// 内部では https://docs.microsoft.com/ja-jp/dotnet/api/system.windows.media.compositiontarget.rendering?view=netframework-4.7.2 のイベントで監視してる
Name = Poco.ObserveEveryValueChanged(x => x.Name).ToReadOnlyReactiveProperty();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment