【发布时间】:2017-04-13 10:54:02
【问题描述】:
当我改变这个时:
public partial class FrmCategories : UserControl
到这里:
public partial class FrmCategories : MyUserControl
MyUserControl 继承自 UserControl。
我收到了这个错误:
错误 2 'WpfTest.FrmCategories' 的部分声明不得 指定不同的基类
\Projects\WpfTest\WpfTest\FrmCategories.xaml.cs 21 26 WpfTest
XAML:
<UserControl x:Class="WpfTest.FrmCategories"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:we="clr-namespace:WpfTest"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" Background="Azure" Height="131" Width="229">
<StackPanel Margin="5,24,5,0" Name="catFrm" Height="75" VerticalAlignment="Top">
我正在开始 WPF(正如项目名称所暗示的那样),所以我预计这里会出现一个微不足道的错误
【问题讨论】: