Skip to content

Commit 1d884e6

Browse files
committed
修复依赖库列表有时未加载的问题
1 parent 6b4fbb8 commit 1d884e6

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Firefly/Views/AboutWindow.xaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@
1515
IsDesignTimeCreatable=True}"
1616
Background="{DynamicResource RegionBrush}"
1717
Icon="/Resources/firefly.ico"
18+
Loaded="Window_Loaded"
1819
ResizeMode="NoResize"
1920
SizeToContent="Width"
2021
UseLayoutRounding="True"
2122
WindowStartupLocation="CenterScreen"
2223
mc:Ignorable="d">
23-
<i:Interaction.Triggers>
24+
<!-- 添加 Loaded InvokeCommandAction 行为有时无效,可能是手动创建/打开窗口的原因? -->
25+
<!--<i:Interaction.Triggers>
2426
<i:EventTrigger EventName="Loaded">
2527
<i:InvokeCommandAction Command="{Binding LoadedCommand}" />
2628
</i:EventTrigger>
27-
</i:Interaction.Triggers>
29+
</i:Interaction.Triggers>-->
2830

2931
<Grid Margin="12">
3032
<Grid.RowDefinitions>

Firefly/Views/AboutWindow.xaml.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ namespace Firefly.Views;
1414
/// </summary>
1515
public partial class AboutWindow : HcWindow
1616
{
17+
public AboutViewModel ViewModel { get; }
18+
1719
public AboutWindow(AboutViewModel vm)
1820
{
1921
InitializeComponent();
22+
ViewModel = vm;
2023

2124
if (App.IsInDesignMode)
2225
{
@@ -35,4 +38,9 @@ private void LbAppDependencies_Item_MouseDoubleClick(object sender, MouseButtonE
3538
UriHelper.OpenUri($"https://www.nuget.org/packages/{dep.Name}");
3639
}
3740
}
41+
42+
private async void Window_Loaded(object sender, System.Windows.RoutedEventArgs e)
43+
{
44+
await ViewModel.LoadedCommand.ExecuteAsync(null);
45+
}
3846
}

0 commit comments

Comments
 (0)