public MissingBase58ViewModel() { // Don't move this line, service must be instantiated here InputService inServ = new InputService(); b58Service = new Base58Sevice(Result); IObservable <bool> isFindEnabled = this.WhenAnyValue( x => x.Input, x => x.MissingChar, x => x.Result.CurrentState, (b58, c, state) => !string.IsNullOrEmpty(b58) && inServ.IsMissingCharValid(c) && state != State.Working); FindCommand = ReactiveCommand.Create(Find, isFindEnabled); InputTypeList = ListHelper.GetAllEnumValues <Base58Sevice.InputType>(); ExtraInputTypeList = ListHelper.GetEnumDescItems(InputType.PrivateKey).ToArray(); SelectedExtraInputType = ExtraInputTypeList.First(); HasExample = true; IObservable <bool> isExampleVisible = this.WhenAnyValue( x => x.Result.CurrentState, (state) => state != State.Working); ExampleCommand = ReactiveCommand.Create(Example, isExampleVisible); }
public MissingBase58ViewModel() { // Don't move this line, service must be instantiated here InputService inServ = new InputService(); b58Service = new Base58Sevice(Result); IObservable <bool> isFindEnabled = this.WhenAnyValue( x => x.Input, x => x.MissingChar, x => x.Result.CurrentState, (b58, c, state) => !string.IsNullOrEmpty(b58) && inServ.IsMissingCharValid(c) && state != Models.State.Working); FindCommand = ReactiveCommand.Create(Find, isFindEnabled); InputTypeList = Enum.GetValues(typeof(Base58Sevice.InputType)).Cast <Base58Sevice.InputType>(); }