Skip to content

Commit

Permalink
以低优先级清除集合,避免COM错误 (#938)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richasy authored Dec 7, 2024
1 parent 1e5f764 commit 4ee00b6
Show file tree
Hide file tree
Showing 51 changed files with 391 additions and 583 deletions.
1 change: 0 additions & 1 deletion src/Desktop/BiliCopilot.UI/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<ResourceDictionary Source="ms-appx:///Richasy.WinUI.Share/Base/CustomNavigationViewResources.xaml" />
<ResourceDictionary Source="ms-appx:///Styles/Overrides.xaml" />
<ResourceDictionary Source="ms-appx:///Styles/TrayResources.xaml" />
<ResourceDictionary Source="ms-appx:///Controls/Components/CardControl/CardControl.xaml" />
<ResourceDictionary Source="ms-appx:///Controls/Components/VideoCardControl/VideoCardControl.xaml" />
<ResourceDictionary Source="ms-appx:///Controls/Components/SeasonCardControl/SeasonCardControl.xaml" />
<ResourceDictionary Source="ms-appx:///Controls/Components/LiveCardControl/LiveCardControl.xaml" />
Expand Down
28 changes: 12 additions & 16 deletions src/Desktop/BiliCopilot.UI/BiliCopilot.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,17 @@
<OutputType>WinExe</OutputType>
<TargetFramework>net9.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.22621.38</WindowsSdkPackageVersion>
<RootNamespace>BiliCopilot.UI</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &gt;= 8">win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &lt; 8">win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
<Nullable>enable</Nullable>
<DefaultLanguage>zh-CN</DefaultLanguage>
<NoWarn>$(NoWarn);CS1591;NU1903;NU1902;IL2059;NU1900;MVVMTK0046;MVVMTK0045;MVVMTK0047;MVVMTK0048</NoWarn>
<Configurations>Debug;Release;Publish</Configurations>
<ApplicationIcon>Assets\logo.ico</ApplicationIcon>
<MvvmToolkitEnableINotifyPropertyChangingSupport>false</MvvmToolkitEnableINotifyPropertyChangingSupport>
<PublishAot>False</PublishAot>
</PropertyGroup>
<ItemGroup>
Expand Down Expand Up @@ -219,9 +216,7 @@
<None Remove="Controls\Pgc\AnimeTimelineSideControl.xaml" />
<None Remove="Controls\Components\AccountCard.xaml" />
<None Remove="Controls\Components\AppSearchBox.xaml" />
<None Remove="Controls\Components\CardControl\CardControl.xaml" />
<None Remove="Controls\Components\HeaderAccountControl.xaml" />
<None Remove="Controls\Components\CardControl\CardControl.xaml" />
<None Remove="Controls\Components\SeasonCardControl\SeasonCardControl.xaml" />
<None Remove="Controls\Components\SideBottomLoadingWidget.xaml" />
<None Remove="Controls\Components\TimelineControl.xaml" />
Expand Down Expand Up @@ -396,6 +391,7 @@
<PackageReference Include="Microsoft.Graphics.Win2D" />
<PackageReference Include="Roman-Numerals" />
<PackageReference Include="System.Management" />
<PackageReference Include="System.Private.Uri" />
<PackageReference Include="System.Runtime.InteropServices.WindowsRuntime" />
</ItemGroup>
<ItemGroup>
Expand All @@ -419,10 +415,6 @@
<ProjectReference Include="..\BiliCopilot.UI.Models\BiliCopilot.UI.Models.csproj" />
</ItemGroup>
<ItemGroup>
<Page Update="Controls\Components\CardControl\CardControl.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
<SubType>Designer</SubType>
</Page>
<Page Update="Controls\RootLayout.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
Expand Down Expand Up @@ -632,11 +624,6 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="Controls\Components\CardControl\CardControl.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="Controls\Popular\PopularSideHeader.xaml">
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -1572,4 +1559,13 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>

<!-- Publish Properties -->
<PropertyGroup>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">False</PublishTrimmed>
<ApplicationIcon>Assets\logo.ico</ApplicationIcon>
</PropertyGroup>
</Project>
3 changes: 0 additions & 3 deletions src/Desktop/BiliCopilot.UI/BiliCopilot.UI.csproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -633,9 +633,6 @@
<Page Update="Controls\Components\AccountCard.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Controls\Components\CardControl\CardControl.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Controls\Components\HeaderAccountControl.xaml">
<SubType>Designer</SubType>
</Page>
Expand Down
4 changes: 2 additions & 2 deletions src/Desktop/BiliCopilot.UI/Controls/AI/AIBody.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<UserControl.Resources>
<DataTemplate x:Key="QuickItemTemplate" x:DataType="items:AIQuickItemViewModel">
<components:CardControl HorizontalAlignment="Stretch" Command="{x:Bind ExecuteCommand}">
<base:CardControl HorizontalAlignment="Stretch" Command="{x:Bind ExecuteCommand}">
<Grid Padding="16,12" ColumnSpacing="12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
Expand All @@ -40,7 +40,7 @@
TextWrapping="Wrap" />
</StackPanel>
</Grid>
</components:CardControl>
</base:CardControl>
</DataTemplate>
</UserControl.Resources>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private void OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmitte
}

ViewModel.TryCancelSuggestCommand.Execute(default);
ViewModel.Suggestion.Clear();
DispatcherQueue.TryEnqueue(Microsoft.UI.Dispatching.DispatcherQueuePriority.Low, ViewModel.Suggestion.Clear);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:ArticleCardControl">
<local:CardControl x:Name="RootCard" BorderThickness="0">
<base:CardControl x:Name="RootCard" BorderThickness="0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
Expand Down Expand Up @@ -75,7 +75,7 @@
Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=ViewModel.Title}" />
</Grid>
</Grid>
</local:CardControl>
</base:CardControl>
</ControlTemplate>
</Setter.Value>
</Setter>
Expand All @@ -85,7 +85,7 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:ArticleCardControl">
<local:CardControl x:Name="RootCard" BorderThickness="0">
<base:CardControl x:Name="RootCard" BorderThickness="0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
Expand Down Expand Up @@ -138,7 +138,7 @@
Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=ViewModel.Title}" />
</Grid>
</Grid>
</local:CardControl>
</base:CardControl>
</ControlTemplate>
</Setter.Value>
</Setter>
Expand All @@ -148,7 +148,7 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:ArticleCardControl">
<local:CardControl x:Name="RootCard" BorderThickness="0">
<base:CardControl x:Name="RootCard" BorderThickness="0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
Expand Down Expand Up @@ -181,7 +181,7 @@
</TextBlock>
</Grid>
</Grid>
</local:CardControl>
</base:CardControl>
</ControlTemplate>
</Setter.Value>
</Setter>
Expand Down

This file was deleted.

Loading

0 comments on commit 4ee00b6

Please sign in to comment.