File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -128,9 +128,14 @@ public sealed class RecycleBinLocationItem : LocationItem
128
128
129
129
public async void RefreshSpaceUsed ( object ? sender , FileSystemEventArgs e )
130
130
{
131
- await MainWindow . Instance . DispatcherQueue . EnqueueOrInvokeAsync ( ( ) =>
131
+ await RefreshSpaceUsedAsync ( ) ;
132
+ }
133
+
134
+ private Task RefreshSpaceUsedAsync ( )
135
+ {
136
+ return MainWindow . Instance . DispatcherQueue . EnqueueOrInvokeAsync ( async ( ) =>
132
137
{
133
- SpaceUsed = StorageTrashBinService . GetSize ( ) ;
138
+ SpaceUsed = await Task . Run ( ( ) => StorageTrashBinService . GetSize ( ) ) ;
134
139
} ) ;
135
140
}
136
141
@@ -152,10 +157,10 @@ public override object ToolTip
152
157
153
158
public RecycleBinLocationItem ( )
154
159
{
155
- SpaceUsed = StorageTrashBinService . GetSize ( ) ;
156
-
157
160
StorageTrashBinService . Watcher . ItemAdded += RefreshSpaceUsed ;
158
161
StorageTrashBinService . Watcher . ItemDeleted += RefreshSpaceUsed ;
162
+
163
+ _ = RefreshSpaceUsedAsync ( ) ;
159
164
}
160
165
}
161
166
}
You can’t perform that action at this time.
0 commit comments