I'm subscribing to a MessageCenter
message in a page constructor as I want it to change the page even before the page has appeared:
public PhrasesFrame()
{
InitializeComponent();
vm = new PhrasesFrameViewModel();
BindingContext = vm;
vm.Theme = Settings.th.ToString();
MessagingCenter.Subscribe<SettingsPage>(this, "ThemeChanged", (sender) => {
vm.Theme = Settings.th.ToString();
});
}
The PhrasesFrame
is only created one time in my application as it's one of the tabs.
Is there any issue with Subscribing here. The reason I ask is I would not have an UnSubscribe or at least I don't know where to put one.