基本类型页面在其他部分指定

Base type page is specified in other parts

即使 XAML 页自动从 Page 继承,ReSharper 也会将所有从该 Base class 继承的内容灰显,并显示以下消息:

Base type page is specified in other parts

它建议删除多余的超类型引用。

这一切的解释是什么?

代码隐藏 MainPage class 是 partial class。另一部分在 XAML 中这样定义 -

<Page x:Class="xxx.MainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      ...
</Page>

这个标记已经在说 MainPage 继承自 Page,所以在代码隐藏中再次这样做是多余的,这就是 Resharper 标记它的原因。