Get profile image import working
This commit is contained in:
@@ -65,7 +65,8 @@
|
|||||||
<PersonPicture
|
<PersonPicture
|
||||||
Width="{StaticResource PersonPictureSize}"
|
Width="{StaticResource PersonPictureSize}"
|
||||||
Height="{StaticResource PersonPictureSize}"
|
Height="{StaticResource PersonPictureSize}"
|
||||||
DisplayName="{Binding Name}" />
|
DisplayName="{Binding Name}"
|
||||||
|
ProfilePicture="{Binding Image, Converter={ImageDescriptorToBitmapConverter}}" />
|
||||||
<DropDownButton
|
<DropDownButton
|
||||||
Width="{StaticResource ButtonSize}"
|
Width="{StaticResource ButtonSize}"
|
||||||
Height="{StaticResource ButtonSize}"
|
Height="{StaticResource ButtonSize}"
|
||||||
|
|||||||
@@ -10,6 +10,12 @@ public partial class CreateWalletViewModel :
|
|||||||
Observable,
|
Observable,
|
||||||
IPrimaryConfirmation
|
IPrimaryConfirmation
|
||||||
{
|
{
|
||||||
|
[ObservableProperty]
|
||||||
|
private IImageDescriptor? image;
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private bool isConfirmed;
|
||||||
|
|
||||||
[MaybeNull]
|
[MaybeNull]
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private string name;
|
private string name;
|
||||||
@@ -25,15 +31,6 @@ public partial class CreateWalletViewModel :
|
|||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private IValidation validation;
|
private IValidation validation;
|
||||||
|
|
||||||
[ObservableProperty]
|
|
||||||
private bool isConfirmed;
|
|
||||||
|
|
||||||
[RelayCommand]
|
|
||||||
public async Task Import()
|
|
||||||
{
|
|
||||||
await Mediator.Handle<RequestEventArgs<ProfileImage>, IImageDescriptor>(Request.As<ProfileImage>());
|
|
||||||
}
|
|
||||||
|
|
||||||
public CreateWalletViewModel(IValidation validation,
|
public CreateWalletViewModel(IValidation validation,
|
||||||
IServiceProvider provider,
|
IServiceProvider provider,
|
||||||
IServiceFactory factory,
|
IServiceFactory factory,
|
||||||
@@ -64,6 +61,10 @@ public partial class CreateWalletViewModel :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[RelayCommand]
|
||||||
|
public async Task Import() => Image = await Mediator.Handle<RequestEventArgs<ProfileImage>,
|
||||||
|
IImageDescriptor>(Request.As<ProfileImage>());
|
||||||
|
|
||||||
protected override void OnPropertyChanged(PropertyChangedEventArgs args)
|
protected override void OnPropertyChanged(PropertyChangedEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.PropertyName is string name)
|
if (args.PropertyName is string name)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ public class ProfileImageHandler(IFileProvider fileProvider,
|
|||||||
{
|
{
|
||||||
if (files.FirstOrDefault() is string file)
|
if (files.FirstOrDefault() is string file)
|
||||||
{
|
{
|
||||||
return await imageProvider.Get(file, 100, 100, true);
|
return await imageProvider.Get(file, 200, 200, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user