Created
October 22, 2017 17:33
-
-
Save tomwis/d554d74dc5079202e5d5b7052cff95da to your computer and use it in GitHub Desktop.
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 partial class MainPage : ContentPage, IViewFor<MainViewModel> | |
{ | |
public MainPage() | |
{ | |
InitializeComponent(); | |
ViewModel = new MainViewModel(new MovieService()); | |
this.Bind(ViewModel, vm => vm.SearchTerm, v => v.entryField.Text); | |
this.OneWayBind(ViewModel, vm => vm.Results, v => v.resultList.ItemsSource); | |
this.OneWayBind(ViewModel, vm => vm.IsSearching, v => v.loadingBar.IsVisible); | |
} | |
public MainViewModel ViewModel { get; set; } | |
object IViewFor.ViewModel | |
{ | |
get => ViewModel; | |
set => ViewModel = (MainViewModel)value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment