public MainPageViewModel(IScheduler scheduler) { _scheduler = scheduler; _max = new MVx.Observable.Property <long>(TimeSpan.FromSeconds(30).Ticks, nameof(MaxTicks), args => PropertyChanged?.Invoke(this, args)); _elapsed = new MVx.Observable.Property <long>(0, nameof(ElapsedTicks), args => PropertyChanged?.Invoke(this, args)); _reset = new MVx.Observable.Command(true); }
public MainPageViewModel() { _circles = new MVx.Observable.Property <IEnumerable <Circle> >(nameof(Circles), args => PropertyChanged?.Invoke(this, args)); _selected = new MVx.Observable.Property <Circle>(nameof(Selected), args => PropertyChanged?.Invoke(this, args)); _adjustDiameter = new MVx.Observable.Command(); _undo = new MVx.Observable.Command(); _redo = new MVx.Observable.Command(); }
public ViewModel(Lensman.Event.IBus eventBus) { _eventBus = eventBus; _ian = new MVx.Observable.Command(true); _rachel = new MVx.Observable.Command(true); _mia = new MVx.Observable.Command(true); _max = new MVx.Observable.Command(true); }
public ViewModel(Store.Client.IStoreClient storeClient, Platform.ISchedulers schedulers) { _storeClient = storeClient; _schedulers = schedulers; _logger = global::Uno.Extensions.LogExtensionPoint.AmbientLoggerFactory.CreateLogger <ViewModel>(); _loadCheese = new MVx.Observable.Command(true); _cheeses = new MVx.Observable.Property <IEnumerable <Store.Client.Cheese> >(Enumerable.Empty <Store.Client.Cheese>(), nameof(Cheeses), args => PropertyChanged?.Invoke(this, args)); }
public MainPageViewModel(IScheduler scheduler) { _scheduler = scheduler; _flightType = new MVx.Observable.Property <FlightType>(FlightType.OneWay, nameof(FlightType), args => PropertyChanged?.Invoke(this, args)); _outboundText = new MVx.Observable.Property <string>(DateTime.Now.ToString("d"), nameof(OutboundText), args => PropertyChanged?.Invoke(this, args)); _outboundValid = new MVx.Observable.Property <bool>(nameof(OutboundValid), args => PropertyChanged?.Invoke(this, args)); _returnText = new MVx.Observable.Property <string>(DateTime.Now.ToString("d"), nameof(ReturnText), args => PropertyChanged?.Invoke(this, args)); _returnValid = new MVx.Observable.Property <bool>(nameof(ReturnValid), args => PropertyChanged?.Invoke(this, args)); _returnAvailable = new MVx.Observable.Property <bool>(false, nameof(ReturnAvailable), args => PropertyChanged?.Invoke(this, args)); _message = new MVx.Observable.Property <string>(string.Empty, nameof(Message), args => PropertyChanged?.Invoke(this, args)); _book = new MVx.Observable.Command(); _outboundDate = _outboundText.Select(text => DateTime.TryParseExact(text, "d", Thread.CurrentThread.CurrentUICulture, System.Globalization.DateTimeStyles.None, out DateTime date) ? (DateTime?)date : null); _returnDate = _returnText.Select(text => DateTime.TryParseExact(text, "d", Thread.CurrentThread.CurrentUICulture, System.Globalization.DateTimeStyles.None, out DateTime date) ? (DateTime?)date : null); }
public ViewModel(Data.IProvider dataProvider, Lensman.Event.IBus eventBus, Platform.ISchedulers schedulers, Guid userId) { _dataProvider = dataProvider; _eventBus = eventBus; _userId = userId; _schedulers = schedulers; _logger = global::Uno.Extensions.LogExtensionPoint.AmbientLoggerFactory.CreateLogger <ViewModel>(); _recognised = new BehaviorSubject <Director.Client.Recognition>(null); _face = new MVx.Observable.Property <Director.Client.Face>(nameof(Face), args => PropertyChanged?.Invoke(this, args)); _ian = new MVx.Observable.Command(); _rachel = new MVx.Observable.Command(); _mia = new MVx.Observable.Command(); _max = new MVx.Observable.Command(); _alan = new MVx.Observable.Command(); _notAFace = new MVx.Observable.Command(); }
public MainPageViewModel() { _filter = new MVx.Observable.Property <string>(nameof(Filter), args => PropertyChanged?.Invoke(this, args)); _name = new MVx.Observable.Property <string>(nameof(Name), args => PropertyChanged?.Invoke(this, args)); _surname = new MVx.Observable.Property <string>(nameof(Surname), args => PropertyChanged?.Invoke(this, args)); _names = new MVx.Observable.Property <IEnumerable <FullName> >(nameof(Names), args => PropertyChanged?.Invoke(this, args)); _selected = new MVx.Observable.Property <FullName?>(null, nameof(Selected), args => PropertyChanged?.Invoke(this, args)); _create = new MVx.Observable.Command(); _update = new MVx.Observable.Command(); _delete = new MVx.Observable.Command(); _allNames = new BehaviorSubject <IEnumerable <FullName> >(Enumerable.Empty <FullName>()); _fullName = Observable .CombineLatest(_name, _surname) .Select(parts => parts.Any(part => string.IsNullOrEmpty(part)) ? (FullName?)null : new FullName { Name = parts[0], Surname = parts[1] }) .Publish() .RefCount(); }
public ViewModel() { _state = new MVx.Observable.Property <State>(State.SignIn, nameof(State), args => PropertyChanged?.Invoke(this, args)); _name = new MVx.Observable.Property <string>(DefaultName, nameof(Name), args => PropertyChanged?.Invoke(this, args)); _hubState = new MVx.Observable.Property <HubConnectionState>(HubConnectionState.Disconnected, nameof(HubState), args => PropertyChanged?.Invoke(this, args)); _connect = new MVx.Observable.Command(); _lastMessageReceived = new MVx.Observable.Property <Message.Model>(nameof(LastMessageReceived), args => PropertyChanged?.Invoke(this, args)); _messageToSend = new MVx.Observable.Property <string>(nameof(MessageToSend), args => PropertyChanged?.Invoke(this, args)); _messageToSendIsEnabled = new MVx.Observable.Property <bool>(false, nameof(MessageToSendIsEnabled), args => PropertyChanged?.Invoke(this, args)); _currentTheme = new MVx.Observable.Property <string>("Light", nameof(CurrentTheme), args => PropertyChanged?.Invoke(this, args)); _toggleTheme = new MVx.Observable.Command(true); _sendMessage = new MVx.Observable.Command(); _allMessages = new ObservableCollection <Message.Model>(); _connection = new HubConnectionBuilder() .WithUrl("https://unochatservice20200716114254.azurewebsites.net/ChatHub") //.WithUrl("http://localhost:61877") .WithAutomaticReconnect() .Build(); }
public MainPageViewModel() { _counter = new MVx.Observable.Property <int>(nameof(Counter), args => PropertyChanged?.Invoke(this, args)); _increment = new MVx.Observable.Command(true); }