Partial declarations must not indicate different base classes

I know that there is information on the Internet about this, but I have problems translating into my situation.

I have a xaml window and I get the error: Partial declarations 'GX3OpenStackupGUIPlugin.GX3OpenStackupGUIPlugin' should not indicate different base classes.

My code is:

public partial class GX3OpenStackupGUIPlugin : GX3ClientPlugin, IGX3PluginInterface
    {

My xaml:

<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, if someone advises :)

Here is a link to what I found, but I'm trying to translate ... Partial declarations should not indicate different base classes

After a little research, I found that if I changed my code to implement a top-level element in my xaml, it would get rid of the error. This is clearly a problem, since the codebehind class must implement the interfaces that I developed.

+5
source
4

, , . , , ( ):

<A x:Class="B">
public partial class B : A

( ):

<A x:Class="C">
public partial class C : B

, .cs XAML, , A. , :

<B x:Class="C">
public partial class C : B

, , , Grid, .. - :

<namespace:GX3ClientPlugin x:Class="namespace.GX3OpenStackupGUIPlugin">
public partial class GX3OpenStackupGUIPlugin : GX3ClientPlugin

( , GX3ClientPlugin - Grid UserControl?)

+8

, TabItem..cs :

public partial class ucTabItemSelectionCriteria : TabItem

XAML :

<UserControl 

, XAML. , 2 XAML :

    <controls:TabItem xmlns:controls= 
"clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"

TabItem.

+4

, :

AOther.cs

public partial class A
{}

A.cs

public partial class A
{}

, .

AOther.cs

public partial class A : B
{}

A.cs

public partial class A : X
{}

A B X . , XAML, .

. , , / GX3ClientPlugin, . , GX3ClientPlugin . GX3ClientPlugin, , , . , - , 2 - UI GX3ClientPlugin.

+2

There partial classwill be two (or more) parts for this. If you do a search, you should find another class GX3OpenStackupGUIPlugin that probably indicates the type Controlas basic. You are viewing only one part of the file. The other half should probably be expanded from under haml.

The problem is that the two files are doing something like this:

(file first)

public partial class GX3OpenStackupGUIPlugin : GX3ClientPlugin, IGX3PluginInterface {}

(second file)

public partial class GX3OpenStackupGUIPlugin : SomethingElse {...}
+1
source

All Articles