I have tabbed page in XAML document and I want to bind a CurrentPage property to my view model.
Upon compiling, I get an error in my XAML document on column 1, line 1.
When I delete binding, the error is gone.
XAML:
<?xml version="1.0" encoding="utf-8" ?><TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms" xmlns:views="clr-namespace:GitRemote.Views;assembly=GitRemote" prism:ViewModelLocator.AutowireViewModel="True" x:Class="GitRemote.Views.PublicRepositoryPage" CurrentPage="{Binding CurrentTabPage, Mode=OneWayToSource}"><views:RepositoryNewsPage Title="News"/><views:FileExplorerPage Title="Code"/><!--<views:CommitsPage/><views:PublicIssuesPage/>--></TabbedPage>
ViewModel property:
private Page _currentTabPage;public Page CurrentTabPage{ get { return _currentTabPage; } set { SetProperty(ref _currentTabPage, value); MessagingCenter.Send(_currentTabPage, PublicReposCurrentTabChanged); }}
When I bind the Title, it compiles without error.