protected override async void OnNavigatedTo(NavigationEventArgs e) { if (!App.ViewModel.IsDataLoaded) { App.ViewModel.LoadData(); } friend = NavigationService.GetNavigationData().ElementAt(1) as LFCUser; auth = NavigationService.GetNavigationData().ElementAt(0) as LFCAuth; client = new Client.Client(auth); NameBlock.Text = friend.Name; RealNameBlock.Text = friend.RealName; UserImg.Source = new BitmapImage(new Uri(friend.ImgMedium, UriKind.RelativeOrAbsolute)); profileProgress.IsIndeterminate = true; friends = await client.userGetFriends(friend.Name); FriendBlock.Content = "Друзей: " + friends.Count; var score = await client.userMusicCompare(auth.UserName, friend.Name); profileProgress.IsIndeterminate = false; Music_Slider.Value = (int)(double.Parse(score) * 100); MusciBlock.Text = "Музыкальная совместимость " + (int)(double.Parse(score) * 100) + "%"; }
// Load data for the ViewModel Items protected override void OnNavigatedTo(NavigationEventArgs e) { if (!App.ViewModel.IsDataLoaded) { App.ViewModel.LoadData(); } auth = NavigationService.GetNavigationData().ElementAt(0) as LFCAuth; client = new Client.Client(auth); }
protected override void OnNavigatedTo(NavigationEventArgs e) { if (!App.ViewModel.IsDataLoaded) { App.ViewModel.LoadData(); } auth = NavigationService.GetNavigationData().ElementAt(0) as LFCAuth; client = new Client.Client(auth); Main.SetValue(Panorama.SelectedItemProperty, Main.Items[0]); }
protected override async void OnNavigatedTo(NavigationEventArgs e) { if (!App.ViewModel.IsDataLoaded) { App.ViewModel.LoadData(); } ar = NavigationService.GetNavigationData().ElementAt(1) as LFCArtist; auth = NavigationService.GetNavigationData().ElementAt(0) as LFCAuth; client = new Client.Client(auth); // понадобится позже EventInfoGrid.ItemsSource = new List <LFCArtist>() { ar }; }
private async void Enter_Click(object sender, RoutedEventArgs e) { authProgress.IsIndeterminate = true; LFCAuth auth = new LFCAuth(UserName.Text, Password.Password); var msg = await auth.getAuth(); //MessageBox.Show(msg); if (auth.Sk != null) { authProgress.IsIndeterminate = false; NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative), auth); } else { authProgress.IsIndeterminate = false; MessageBox.Show(msg); } }