public void RegisterMessages() { MessagingCenter.Subscribe <MainPage>(this, "GetTitle", (sender) => { sender.Title = _applicationPropertiesService.GetTitle(); }); MessagingCenter.Subscribe <UpdateTitlePage>(this, "GetTitle", (sender) => { sender.Title = _applicationPropertiesService.GetTitle(); }); }
public MainViewModel() { _applicationPropertiesService = DependencyService.Get <IApplicationPropertiesService>(); //MessagingCenter.Subscribe<MainPage>(this, "GetTitle", (sender) => //{ // this.Title = _applicationPropertiesService.GetTitle(); //}); this.Title = _applicationPropertiesService.GetTitle(); }
//public ICommand UpdateTitleCommand { get; private set; } public UpdateTitleViewModel() { _applicationPropertiesService = DependencyService.Get <IApplicationPropertiesService>(); //UpdateTitleCommand = new Command(UpdateTitle); this.Title = _applicationPropertiesService.GetTitle(); }