protected override void OnNavigatedTo(NavigationEventArgs e) { userViewModel = new UserViewModel(); userViewModel.GetLoginAccount(); this.DataContext = userViewModel; Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed; }
private async void Init() { userViewModel = new UserViewModel(); this.DataContext = userViewModel; if (_localSettings.Values.ContainsKey("isRemember")) { if(_localSettings.Values["isRemember"].ToString() == "true"){ await userViewModel.AutoLogin(); NameShow.Text = userViewModel.User.nickname; } } activityViewModel = new ActivityViewModel(); this.DataContext = activityViewModel; }
public void Init(){ userViewModel = new UserViewModel(); userViewModel.GetLoginUser(); this.DataContext = userViewModel; }