fix: 扫描窗口不会出现的问题。
This commit is contained in:
@@ -25,10 +25,21 @@ public partial class ScanProgressViewModel : ViewModelBase
|
||||
Task.Run(() => ScanDirectoryInternal(directory));
|
||||
}
|
||||
|
||||
[ObservableProperty] private bool _hasError;
|
||||
|
||||
[RelayCommand]
|
||||
private void Dismiss()
|
||||
{
|
||||
IsScanning = false;
|
||||
HasError = false;
|
||||
StatusText = "准备扫描...";
|
||||
}
|
||||
|
||||
private void ScanDirectoryInternal(string directory)
|
||||
{
|
||||
try
|
||||
{
|
||||
HasError = false;
|
||||
IsScanning = true;
|
||||
StatusText = "正在发现文件...";
|
||||
|
||||
@@ -93,11 +104,13 @@ public partial class ScanProgressViewModel : ViewModelBase
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HasError = true;
|
||||
StatusText = $"扫描出错:{ex.Message}";
|
||||
}
|
||||
finally
|
||||
{
|
||||
IsScanning = false;
|
||||
if (!HasError)
|
||||
IsScanning = false;
|
||||
ScanCompleted?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,15 @@
|
||||
BorderThickness="1,0,0,0">
|
||||
<views:MetadataPanelView DataContext="{Binding MetadataPanelVM}"/>
|
||||
</Border>
|
||||
|
||||
<!-- 扫描进度遮罩 -->
|
||||
<Border Grid.ColumnSpan="5"
|
||||
IsVisible="{Binding ScanProgressVM.IsScanning}"
|
||||
Background="#80000000">
|
||||
<views:ScanProgressView DataContext="{Binding ScanProgressVM}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<!-- 底部播放栏 -->
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding CurrentFile}" FontSize="11"
|
||||
TextTrimming="CharacterEllipsis" MaxWidth="368"/>
|
||||
<Button Content="关闭" Command="{Binding DismissCommand}"
|
||||
IsVisible="{Binding HasError}" HorizontalAlignment="Right"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</UserControl>
|
||||
|
||||
@@ -26,6 +26,11 @@
|
||||
<TestId>xUnit::24F92458-FB39-44BE-A32F-41275183AF1B::net10.0::Core.Tests.IntegratedTest.ScanReadWritePipeline_ShouldGenerateDatabase</TestId>
|
||||
<TestId>xUnit::24F92458-FB39-44BE-A32F-41275183AF1B::net10.0::Core.Tests.IntegratedTest</TestId>
|
||||
</TestAncestor>
|
||||
</SessionState></s:String>
|
||||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=7a0de69d_002D085d_002D444a_002D9fbe_002D33683c7b6cab/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" IsActive="True" Name="DatabaseTests" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||
<TestAncestor>
|
||||
<TestId>xUnit::24F92458-FB39-44BE-A32F-41275183AF1B::net10.0::Core.Tests.DatabaseTests</TestId>
|
||||
</TestAncestor>
|
||||
</SessionState></s:String>
|
||||
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=GUI_002FAssets_002FLocale/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=GUI_002FLocale/@EntryIndexedValue">False</s:Boolean>
|
||||
|
||||
Reference in New Issue
Block a user