首页 > 解决方案 > “FrameworkAppContextSwitches”类型不可访问

问题描述

我正在开发一个 WPF 应用程序。我正在尝试调整TextBox. 我使用“Style Snooper”来获取该控件的默认样式并将其粘贴到我项目的 App.xaml 文件中(我也为CheckBoxandButton样式完成了此操作)。

我收到以下错误:

“FrameworkAppContextSwitches”类型不可访问。

在以下代码行:

<DataTrigger Binding="{Binding Path=(msi:FrameworkAppContextSwitches.UseAdornerForTextboxSelectionRendering)}" Value="false" xmlns:msi="clr-namespace:MS.Internal;assembly=PresentationFramework">

如果您需要,我可以发布其余的样式代码,但它有 150 行长,所以我不想弄乱我的问题。

App.xaml 文件的开头如下所示(未引用msi:):

<Application x:Class="PartsBookAssembler.App"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:local="clr-namespace:PartsBookAssembler"
         xmlns:s="clr-namespace:System;assembly=mscorlib"
         Startup="Application_Startup">

我需要什么命名空间引用?有谁知道如何解决这一问题?

标签: wpfxaml

解决方案


推荐阅读