当我在 uwp 应用程序中使用 TextBlock 样式 BodyTextBlockStyle 和 BodyStrongTextBlockStyle 时应用程序崩溃

App is crashing when I use TextBlock styles BodyTextBlockStyle and BodyStrongTextBlockStyle in uwp app

您好,我正在开发 UWP 应用程序并尝试使用样式 BodyTextBlockStyle 和 BodyStrongTextBlockStyle。但是,一旦我在 TextBlock 上使用这些样式,应用程序就会因以下调用堆栈而崩溃。我看到这些样式是标准样式 (https://docs.microsoft.com/en-us/windows/apps/design/style/xaml-theme-resources),所以我假设我不需要向项目添加任何引用。但如果是这样的话,你能指导我添加哪一个以及如何添加吗?

请帮忙。

    KernelBase.dll!00007ff86c1efe7c()   Unknown No symbols loaded.
    vcruntime140d_app.dll!00007ff85608b460()    Unknown No symbols loaded.
>   FamilyValueProp.dll!winrt::throw_hresult({...}) Line 4781   C++ Symbols loaded.
    FamilyValueProp.dll!winrt::check_hresult({...}) Line 4827   C++ Symbols loaded.
    FamilyValueProp.dll!winrt::impl::consume_Windows_UI_Xaml_IApplicationStatics<winrt::Windows::UI::Xaml::IApplicationStatics>::LoadComponent({...}, {...}, Nested) Line 266   C++ Symbols loaded.
    FamilyValueProp.dll!winrt::Windows::UI::Xaml::Application::LoadComponent::__l2::<lambda>({...}) Line 12248  C++ Symbols loaded.
    FamilyValueProp.dll!winrt::impl::factory_cache_entry<winrt::Windows::UI::Xaml::Application,winrt::Windows::UI::Xaml::IApplicationStatics>::call<void <lambda>(const winrt::Windows::UI::Xaml::IApplicationStatics &) &>(void <lambda>(const winrt::Windows::UI::Xaml::IApplicationStatics & f){...}) Line 6084  C++ Symbols loaded.
    FamilyValueProp.dll!winrt::impl::call_factory<winrt::Windows::UI::Xaml::Application,winrt::Windows::UI::Xaml::IApplicationStatics,void <lambda>(const winrt::Windows::UI::Xaml::IApplicationStatics &)>(void <lambda>(const winrt::Windows::UI::Xaml::IApplicationStatics & f){...}) Line 6107  C++ Symbols loaded.
    FamilyValueProp.dll!winrt::Windows::UI::Xaml::Application::LoadComponent({...}, {...}, Nested) Line 12249   C++ Symbols loaded.
    FamilyValueProp.dll!winrt::FamilyValueProp::implementation::FamilyValuePropControlT<winrt::FamilyValueProp::implementation::FamilyValuePropControl>::InitializeComponent() Line 31  C++ Symbols loaded.
    FamilyValueProp.dll!winrt::FamilyValueProp::implementation::FamilyValuePropControl::FamilyValuePropControl() Line 16    C++ Symbols loaded.
    FamilyValueProp.dll!winrt::impl::heap_implements<winrt::FamilyValueProp::implementation::FamilyValuePropControl>::heap_implements<winrt::FamilyValueProp::implementation::FamilyValuePropControl>() C++ Symbols loaded.
    FamilyValueProp.dll!winrt::make<winrt::FamilyValueProp::implementation::FamilyValuePropControl>() Line 7552 C++ Symbols loaded.
    FamilyValueProp.dll!winrt::FamilyValueProp::factory_implementation::FamilyValuePropControlT<winrt::FamilyValueProp::factory_implementation::FamilyValuePropControl,winrt::FamilyValueProp::implementation::FamilyValuePropControl>::ActivateInstance() Line 44  C++ Symbols loaded.
    FamilyValueProp.dll!winrt::impl::produce<winrt::FamilyValueProp::factory_implementation::FamilyValuePropControl,winrt::Windows::Foundation::IActivationFactory>::ActivateInstance(0x000000784f3fc3e0) Line 6153 C++ Symbols loaded.
    combase.dll!00007ff86d7d5f9d()  Unknown No symbols loaded.
    combase.dll!00007ff86d7d59f1()  Unknown No symbols loaded.
    windowsudk.shellcommon.dll!00007ff8542cc280()   Unknown No symbols loaded.
    windowsudk.shellcommon.dll!00007ff8542cc075()   Unknown No symbols loaded.
    FamilyValuePropTestApp.exe!winrt::impl::consume_WindowsUdk_ApplicationModel_AppExtensions_IXamlExtensions<winrt::WindowsUdk::ApplicationModel::AppExtensions::IXamlExtensions>::GetInstanceFromExtension({...}, {...}) Line 180 C++ Symbols loaded.
    FamilyValuePropTestApp.exe!winrt::FamilyValuePropTestApp::implementation::MainPage::MainPage() Line 32  C++ Symbols loaded.
    FamilyValuePropTestApp.exe!winrt::impl::heap_implements<winrt::FamilyValuePropTestApp::implementation::MainPage>::heap_implements<winrt::FamilyValuePropTestApp::implementation::MainPage>()    C++ Symbols loaded.
    FamilyValuePropTestApp.exe!winrt::make<winrt::FamilyValuePropTestApp::implementation::MainPage>() Line 7552 C++ Symbols loaded.
    FamilyValuePropTestApp.exe!winrt::FamilyValuePropTestApp::implementation::ActivateLocalType<winrt::FamilyValuePropTestApp::implementation::MainPage>() Line 35  C++ Symbols loaded.
    FamilyValuePropTestApp.exe!winrt::FamilyValuePropTestApp::implementation::XamlUserType::ActivateInstance() Line 452 C++ Symbols loaded.
    FamilyValuePropTestApp.exe!winrt::impl::produce<winrt::FamilyValuePropTestApp::implementation::XamlUserType,winrt::Windows::UI::Xaml::Markup::IXamlType>::ActivateInstance(0x000000784f3fcfe0) Line 863 C++ Symbols loaded.
    Windows.UI.Xaml.dll!00007ff8591f5592()  Unknown No symbols loaded.
    Windows.UI.Xaml.dll!00007ff859167afc()  Unknown No symbols loaded.
    Windows.UI.Xaml.dll!00007ff859166eae()  Unknown No symbols loaded.
    Windows.UI.Xaml.dll!00007ff859166d25()  Unknown No symbols loaded.
    Windows.UI.Xaml.dll!00007ff859166c39()  Unknown No symbols loaded.
    Windows.UI.Xaml.dll!00007ff859166baf()  Unknown No symbols loaded.
    Windows.UI.Xaml.dll!00007ff859166a38()  Unknown No symbols loaded.
    Windows.UI.Xaml.dll!00007ff85916690f()  Unknown No symbols loaded.
    FamilyValuePropTestApp.exe!winrt::impl::consume_Windows_UI_Xaml_Controls_IFrame<winrt::Windows::UI::Xaml::Controls::IFrame>::Navigate({...}, {...}) Line 6167   C++ Symbols loaded.
    FamilyValuePropTestApp.exe!winrt::FamilyValuePropTestApp::implementation::App::OnLaunched({...}) Line 83    C++ Symbols loaded.
    FamilyValuePropTestApp.exe!winrt::impl::produce<winrt::FamilyValuePropTestApp::implementation::App,winrt::Windows::UI::Xaml::IApplicationOverrides>::OnLaunched(0x000001b502c44130) Line 5047   C++ Symbols loaded.
    Windows.UI.Xaml.dll!00007ff85917e679()  Unknown No symbols loaded.
    Windows.UI.Xaml.dll!00007ff85917e2e8()  Unknown No symbols loaded.
    Windows.UI.Xaml.dll!00007ff85936c6b5()  Unknown No symbols loaded.
    twinapi.appcore.dll!00007ff8657d2b70()  Unknown No symbols loaded.
    twinapi.appcore.dll!00007ff8657d2ac3()  Unknown No symbols loaded.
    twinapi.appcore.dll!00007ff8657d2667()  Unknown No symbols loaded.
    rpcrt4.dll!00007ff86ea12713()   Unknown No symbols loaded.
    rpcrt4.dll!00007ff86ea7af0d()   Unknown No symbols loaded.
    rpcrt4.dll!00007ff86e9f3b92()   Unknown No symbols loaded.
    combase.dll!00007ff86d80b460()  Unknown No symbols loaded.
    rpcrt4.dll!00007ff86e9a9375()   Unknown No symbols loaded.
    combase.dll!00007ff86d7b6f5d()  Unknown No symbols loaded.
    combase.dll!00007ff86d7b6cf7()  Unknown No symbols loaded.
    combase.dll!00007ff86d81b6d8()  Unknown No symbols loaded.
    combase.dll!00007ff86d80578b()  Unknown No symbols loaded.
    combase.dll!00007ff86d8097c1()  Unknown No symbols loaded.
    combase.dll!00007ff86d8096bd()  Unknown No symbols loaded.
    combase.dll!00007ff86d7f14f1()  Unknown No symbols loaded.
    combase.dll!00007ff86d7ebaec()  Unknown No symbols loaded.
    combase.dll!00007ff86d78aab1()  Unknown No symbols loaded.
    combase.dll!00007ff86d78f97d()  Unknown No symbols loaded.
    combase.dll!00007ff86d78f360()  Unknown No symbols loaded.
    Windows.UI.dll!00007ff85bee7989()   Unknown No symbols loaded.
    Windows.UI.dll!00007ff85bee77e7()   Unknown No symbols loaded.
    twinapi.appcore.dll!00007ff86580fad6()  Unknown No symbols loaded.
    twinapi.appcore.dll!00007ff86580f9fc()  Unknown No symbols loaded.
    twinapi.appcore.dll!00007ff865838941()  Unknown No symbols loaded.
    SHCore.dll!00007ff86e6bbcad()   Unknown No symbols loaded.
    kernel32.dll!00007ff86e056ab0() Unknown No symbols loaded.
    ntdll.dll!00007ff86ebf1dbb()    Unknown No symbols loaded.

崩溃是因为我使用的是 BodyStrongTextBlockStyle 而我的应用程序没有使用 WinUI。 BodyStrongTextBlockStyle 仅在应用程序使用 WinUI 2.6+ 时存在。