MvvmCross
MvvmCross copied to clipboard
<nullable> cause MvxWpfView error
🐛 Bug Report
Error CS0263 Partial declarations of 'SomeView' must not specify different base classes
Expected behavior
the nullable attribute shouldn't affect the MvxWpfView
Reproduction steps
create a mvvmcross wpf project and add the nullable
attribut in project settings
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop>
....
<PropertyGroup>
<Nullable>enable</Nullable>
</PropertyGroup>
<Project>
create a view:
<views:MvxWpfView
x:Class="BlaBla.SomeView"
xmlns:views="clr-namespace:MvvmCross.Platforms.Wpf.Views;assembly=MvvmCross.Platforms.Wpf"
x:TypeArguments="SomeViewModel">
<Grid>
...
</Grid>
</views:MvxWpfView>
with a basic code behind:
public partial class SomeView : MvxWpfView<SomeViewModel>
{
public SomeView ()
{
InitializeComponent();
}
}
Configuration
Version: 8.0.1
Platform:
- [ ] :iphone: iOS
- [ ] :robot: Android
- [x] :checkered_flag: WPF
- [ ] :earth_americas: UWP
- [ ] :apple: MacOS
- [ ] :tv: tvOS
- [ ] :monkey: Xamarin.Forms
You don't have to specify the base class in all partial class definitions (one is enough). Hence the error will go away if if you remove : MvxWpfView<SomeViewModel>
from the .cs file but the class will properly inherit from MvxWpfView<SomeViewModel>
since the base class is define in the XAML.