2017-05-30 15 views
3

即使XAML页面,从页面自动继承,ReSharper的灰色了从基类的所有继承和以下消息出现:基本类型页面在其他地方规定

Base type page is specified in other parts 

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

enter image description here

什么是这一切的解释呢?

回答

3

代码隐藏MainPage类是partial类。另一部分是在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> 

此标记已经从PageMainPage继承,所以在做一遍代码隐藏是多余的,这就是为什么ReSharper的是其标记。

相关问题