在 UserControl 中找不到附加属性资源
在为我的用户控件添加资源期间,出现上述错误。可能是什么问题?
<UserControl x:Class="PartitionManager.DocStorageView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:WpfToolkit="http://schemas.microsoft.com/wpf/2008/toolkit"
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="800">
<UserControl.Resources></UserControl.Resources>
<WpfToolkit:DataGrid
ItemsSource="{Binding Path=DocStorageInfos}"
HorizontalScrollBarVisibility="Auto" SelectionMode="Extended"
CanUserAddRows="False" CanUserDeleteRows="False"
CanUserResizeRows="False" CanUserSortColumns="False"
AutoGenerateColumns="False" MaxWidth="750">
<WpfToolkit:DataGrid.Columns>
<WpfToolkit:DataGridCheckBoxColumn
Header="Select"
Binding="{Binding Path=IsSelected}"/>
<WpfToolkit:DataGridTextColumn
Header="InterestingName"
Binding="{Binding Path=InterestingName}"/>
</WpfToolkit:DataGrid.Columns>
</WpfToolkit:DataGrid>
</UserControl>
During adding resources for my user control I get the error above. What may be the problem ?
<UserControl x:Class="PartitionManager.DocStorageView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:WpfToolkit="http://schemas.microsoft.com/wpf/2008/toolkit"
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="800">
<UserControl.Resources></UserControl.Resources>
<WpfToolkit:DataGrid
ItemsSource="{Binding Path=DocStorageInfos}"
HorizontalScrollBarVisibility="Auto" SelectionMode="Extended"
CanUserAddRows="False" CanUserDeleteRows="False"
CanUserResizeRows="False" CanUserSortColumns="False"
AutoGenerateColumns="False" MaxWidth="750">
<WpfToolkit:DataGrid.Columns>
<WpfToolkit:DataGridCheckBoxColumn
Header="Select"
Binding="{Binding Path=IsSelected}"/>
<WpfToolkit:DataGridTextColumn
Header="InterestingName"
Binding="{Binding Path=InterestingName}"/>
</WpfToolkit:DataGrid.Columns>
</WpfToolkit:DataGrid>
</UserControl>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否可能搞乱了代码隐藏中的继承?
您的类需要继承自 UserControl:
Did you possibly mess with the inheritance in code-behind?
Your class needs to inherit from UserControl: