即使XAML页面自动从Page继承,ReSharper也会从该Base类中查找所有继承,并提供以下消息:
Base type page is specified in other parts
Run Code Online (Sandbox Code Playgroud)
它建议删除冗余的超类型引用.
这一切的解释是什么?
代码隐藏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>
Run Code Online (Sandbox Code Playgroud)
这个标记已经说MainPage继承了Page,所以在代码隐藏中再做一次是多余的,这就是Resharper标记它的原因.
| 归档时间: |
|
| 查看次数: |
512 次 |
| 最近记录: |