public SearchQueryViewModel(MainPageViewModel parent, SearchQuery model)
        {
            this.Parent = new ReactiveProperty<MainPageViewModel>(parent);
            this.Model = new ReactiveProperty<SearchQuery>(model);

            this.Title = this.Model.Value
                .ObserveProperty(o => o.Title)
                .ToReactiveProperty(this.Model.Value.Title);

            this.Query = this.Model.Value
                .ObserveProperty(o => o.Query)
                .ToReactiveProperty(this.Model.Value.Query);

            this.SearchCommand = new ReactiveCommand();
            this.SearchCommand.Subscribe(_ =>
            {
                var vm = new SearchViewViewModel(this.Model.Value);
                vm.QueryCommand.Execute(null);
                this.Parent.Value.SelectedQuery.Value = vm;
                this.Parent.Value.NavigateRequest.Raise(
                    new NavigateNotification(new Uri("/SearchViewPage.xaml", UriKind.Relative)));
            });
        }
Beispiel #2
0
 public SearchNextViewModel(SearchViewViewModel parent)
     : base(null)
 {
     this._parent = parent;
 }