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 Reactive.Bindings; | |
using Reactive.Bindings.Binding; | |
using Reactive.Bindings.Extensions; | |
using System; | |
using System.Data; | |
using System.Linq; | |
using System.Reactive.Disposables; | |
using System.Reactive.Linq; | |
using System.Windows.Forms; |
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
/* 出力 | |
now loading | |
now loading | |
now loading | |
done { index: 1, result: filter2: src image } | |
done { index: 0, result: filter1: src image } | |
done { index: 2, result: filter3: src image } | |
filter1: src image | |
filter2: src image | |
filter3: src image |
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
class BindableBase : INotifyPropertyChanged | |
{ | |
public event PropertyChangedEventHandler PropertyChanged; | |
protected bool SetProperty<T>(ref T field, T value, [CallerMemberName]string propertyName = null) | |
{ | |
Debug.WriteLine("PropertyChangedが {GetType().Name} で呼ばれました。"); | |
field = value; | |
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); | |
} | |
} |
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
[ | |
{ | |
"Index": "0", | |
"Label": "tench, Tinca tinca" | |
}, | |
{ | |
"Index": "1", | |
"Label": "goldfish, Carassius auratus" | |
}, | |
{ |
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
// Model | |
public interface IData | |
{ | |
IReadOnlyList<IDatum> DatumList { get; } | |
} | |
public interface IDatum | |
{ | |
IReadOnlyList<int> Numbers { get; } | |
} |
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
namespace TechSummit2018.ServerlessSmartSpeaker | |
{ | |
public class SmartSpeakerEndpoints | |
{ | |
private IAssistant Assistant { get; } | |
private IPlatformService PlatformService { get; } | |
public SmartSpeakerEndpoints(IAssistant assistant, IPlatformService platformService) | |
{ | |
Assistant = assistant; |
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
class ViewModel | |
{ | |
public ReactiveProperty<string> Input { get; } | |
public ReactiveProperty<string> Output { get; } | |
public ViewModel() | |
{ | |
Input = new ReactiveProperty(""); | |
Output = Input | |
.Delay(TimeSpan.FromSecond(1)) // Using a Rx method. |
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
<TextBlock Text="{Binding Message.Value}" /> |
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
var viewModel = new SomeViewModel(); | |
viewModel.Message.Value = "Hello world"; // set a value | |
Console.WriteLine(viewModel.Message.Value); // get a value |
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
public interface IReactiveProperty<T> : IObservable<T>, INotifyPropertyChanged | |
{ | |
T Value { get; set; } | |
} | |
public class ReactiveProperty<T> : IReactiveProperty<T> | |
{ | |
public event PropertyChangedEventHandler PropertyChanged; | |
private T _value; |