I know there is information on this on the internet but Im having problems translating it to my situation.
I have a xaml window and im getting the error: Partial declarations of 'GX3OpenStackupGUIPlugin.GX3OpenStackupGUIPlugin' must not specify different base classes .
My code behind is:
public partial class GX3OpenStackupGUIPlugin : GX3ClientPlugin, IGX3PluginInterface
{
My xaml is:
<Grid xmlns:my="clr-namespace:CustomControls;assembly=MultiComboBox" xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" x:Class="GX3OpenStackupGUIPlugin.GX3OpenStackupGUIPlugin"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
Please could someone advise :)
Here is a link to what I have found but am struggling to translate... Partial declarations must not specify different base classes
After doing a little more research I have discovered that if I change my code behind to implement the top level element in my xaml it gets rid of the error. Thats obviously still a problem as my codebehind class needs to implement the interfaces I have designed.
The question you linked to contains the answer. The person who asked that question started with this (which worked):
<A x:Class="B">
public partial class B : A
And they changed it to this (which didn't work):
<A x:Class="C">
public partial class C : B
This doesn't work because, behind the scenes, a .cs file is generated based on the XAML that contains a partial class that inherits from A. To fix it, they needed to change it to this:
<B x:Class="C">
public partial class C : B
So in your case, I believe you should replace Grid, i.e. do something like this:
<namespace:GX3ClientPlugin x:Class="namespace.GX3OpenStackupGUIPlugin">
public partial class GX3OpenStackupGUIPlugin : GX3ClientPlugin
(I assume that GX3ClientPlugin ultimately inherits from something like Grid or UserControl?)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With