WIP Avatar
This commit is contained in:
parent
87f134e05b
commit
13a7a35b6d
2 changed files with 11 additions and 8 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue