Such a moment, I am writing an application for Windows Phone, I need to transfer data from one page to another, Frame and OnNavigateonTO use no features, I need to through PropertyChanged. My own problem is that PropertyChanged does not notice the change in Enter and does not update the data in the MainPage; I actually need to transfer them to this page ... when the change occurs on the Enter page, they go to the MenuItem class, but the value does not change MainPage page
!!!!!!!! MainPage.xaml.cs
...<TextBlock x:Name="NameWorker" Text="{x:Bind demomenuViewModel.Welcom, Mode=OneWay}" />.... public sealed partial class MainPage : Page { demomenuViewModel demomenuViewModel = new demomenuViewModel(); .... !!!!!! Enter.xaml.cs
public sealed partial class Enter : Page { private demomenuViewModel VM = new demomenuViewModel(); private void enter_Click(object sender, RoutedEventArgs e) { VM.Welcom = login.nameuser.ToString(); } ... } !!! MenuItem.cs
public class demomenuViewModel : asyncViewModel { ... public string Welcom { get { return welcom; } set { welcom = value; INotifyPropertyChanged(); } } ... }
demomenuViewModel, it is clear that the data in them is in no way connected. - VladDstatik', it also did not work out, because the function 'INotifyPropertyChanged' does not work as static .... Perhaps you can suggest some ideas? - Denis KrovyakovMainPageandEnter) the samedemomenuViewModelinstance in the constructor? - VladD