From 6779ac042be05adc259d5801411102dc3ea83a80 Mon Sep 17 00:00:00 2001 From: TheXamlGuy Date: Wed, 24 Jul 2024 22:21:27 +0100 Subject: [PATCH] Wire up file size --- Wallet.Avalonia/AttachmentEntryView.axaml | 7 ++++--- Wallet/AttachmentEntryCollectionViewModel.cs | 2 +- Wallet/LocalAttachmentEntryViewModel.cs | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Wallet.Avalonia/AttachmentEntryView.axaml b/Wallet.Avalonia/AttachmentEntryView.axaml index a8b3315..af6e988 100644 --- a/Wallet.Avalonia/AttachmentEntryView.axaml +++ b/Wallet.Avalonia/AttachmentEntryView.axaml @@ -1,6 +1,7 @@ - Welcome to Avalonia! - + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:vm="using:Wallet" + x:DataType="vm:LocalAttachmentEntryViewModel" + Description="{Binding Size, Converter={FileSizeNameConverter}}" /> diff --git a/Wallet/AttachmentEntryCollectionViewModel.cs b/Wallet/AttachmentEntryCollectionViewModel.cs index 2e09a4d..f9b128e 100644 --- a/Wallet/AttachmentEntryCollectionViewModel.cs +++ b/Wallet/AttachmentEntryCollectionViewModel.cs @@ -31,7 +31,7 @@ public partial class AttachmentEntryCollectionViewModel(IServiceProvider provide string path = file.Path; DateTimeOffset created = DateTimeOffset.Now; string name = file.Name; - int size = file.Size; + long size = file.Size; Attachment attachment = new() { diff --git a/Wallet/LocalAttachmentEntryViewModel.cs b/Wallet/LocalAttachmentEntryViewModel.cs index 4f8cd88..9edaab8 100644 --- a/Wallet/LocalAttachmentEntryViewModel.cs +++ b/Wallet/LocalAttachmentEntryViewModel.cs @@ -11,7 +11,7 @@ public partial class LocalAttachmentEntryViewModel(IServiceProvider provider, IDisposer disposer, string path, DateTimeOffset created, - int size, + long size, string name) : Observable(provider, factory, mediator, publisher, subscriber, disposer), IAttachmentEntryViewModel { @@ -22,7 +22,7 @@ public partial class LocalAttachmentEntryViewModel(IServiceProvider provider, private string path = path; [ObservableProperty] - private int size = size; + private long size = size; [ObservableProperty] private string name = name;