下载并安装扩展 WPF 工具包 - 2.1.0
添加了引用
我可以看到它对象资源管理器
我收到以下关于未找到 AutoSelectTextBox 的错误。
<Window x:Class="ComboBoxDynamic.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
Title="MainWindow" Height="350" Width="525">
<Grid>
<StackPanel>
<StackPanel.Resources>
<Style TargetType="{x:Type xctk:AutoSelectTextBox}">
<Setter Property="Margin" Value="5"/>
<Setter Property="AutoSelectBehavior" Value="{Binding SelectedItem, ElementName=_autoSelectBehavior}"/>
<Setter Property="AutoMoveFocus" Value="{Binding IsChecked, ElementName=_autoMoveFocus}"/>
</Style>
</StackPanel.Resources>
</StackPanel>
</Grid>
</Window>
但是在后面的代码中我可以访问。
Xceed.Wpf.Toolkit.AutoSelectTextBox astb = new AutoSelectTextBox();
最佳答案
我以前见过这个错误,因为 Windows 阻止了 DLL,因为它们被下载了。请参阅 https://wpftoolkit.codeplex.com/releases/view/106016 中的说明中的步骤 3。
- 在 Windows 资源管理器中右键单击 -> 属性 -> 取消阻止。对您需要的所有 DLL 执行此操作,或者删除它们并解锁 zip 并再次解压。
或者
- 在 VS 中删除对 DLL 的引用并改用 nuget 包。
关于.net - WPF 扩展工具包入门,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22000028/