diff --git a/BookAStar/BookAStar/Pages/UserProfile/UserProfilePage.xaml.cs b/BookAStar/BookAStar/Pages/UserProfile/UserProfilePage.xaml.cs index f6738716..77a84aaa 100644 --- a/BookAStar/BookAStar/Pages/UserProfile/UserProfilePage.xaml.cs +++ b/BookAStar/BookAStar/Pages/UserProfile/UserProfilePage.xaml.cs @@ -15,26 +15,29 @@ namespace BookAStar.Pages.UserProfile InitializeComponent(); AvatarButton.Clicked += AvatarButton_Clicked; } - + public UserProfilePage(UserProfileViewModel model) + { + InitializeComponent(); + AvatarButton.Clicked += AvatarButton_Clicked; + BindingContext = model; + } private async void AvatarButton_Clicked (object sender, EventArgs e) { if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported) { - DisplayAlert("No Camera", ":( No camera avaialble.", "OK"); + await DisplayAlert("No Camera", ":( No camera avaialble.", "OK"); return; } var file = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions { - Directory = "Sample", - Name = "test.jpg" + Directory = "Avatars", + Name = "me.jpg" }); if (file == null) return; - - await DisplayAlert("File Location", file.Path, "OK"); - AvatarButton.Image.File = file.Path; + // ImageSource.FromFile(file.Path); /* ImageSource.FromStream(() => { var stream = file.GetStream(); diff --git a/BookAStar/BookAStar/ViewModels/UserProfile/UserProfileViewModel.cs b/BookAStar/BookAStar/ViewModels/UserProfile/UserProfileViewModel.cs index 2b5143a9..18ad70d7 100644 --- a/BookAStar/BookAStar/ViewModels/UserProfile/UserProfileViewModel.cs +++ b/BookAStar/BookAStar/ViewModels/UserProfile/UserProfileViewModel.cs @@ -14,7 +14,7 @@ namespace BookAStar.ViewModels.UserProfile using Model.Auth.Account; using Pages.UserProfile; - internal class UserProfileViewModel : ViewModel + public class UserProfileViewModel : ViewModel { public bool IsAPerformer {