简体   繁体   中英

How do I make these errors go away?

Can you tell me please what I need to change so that I won't get these errors anymore? I've duplicated an xaml+css class and that's why I get so many errors. I've attached an image to show you the errors. Someone recommended me to change something about these 2 things but I didn't quite understand, which is why I've decided to make a new post regarding this matter.

code c1.cs:

public partial class ImagesGrid : UserControl

code xaml c1.xaml:

x:Class="KinectInfoPortal.ImagesGrid"

在此处输入图片说明

EDIT1:

Code for C1.xaml.cs class:

public partial class ImagesGrid : UserControl

Code for ImageGrid.xaml.cs class:

public partial class ImagesGrid : UserControl

Code for C1.xaml:

x:Class="KinectInfoPortal.ImagesGrid"

Code for ImageGrid.xaml:

x:Class="Microsoft.Samples.Kinect.ControlsBasics.ImagesGrid"

Here is the mistake:

Code for C1.xaml.cs class:

public partial class ImagesGrid : UserControl

Code for ImageGrid.xaml.cs class:

public partial class ImagesGrid : UserControl

It should be:

Code for C1.xaml.cs class:

public partial class C1: UserControl

Code for ImageGrid.xaml.cs class:

public partial class ImagesGrid : UserControl

You renamed file to C1.xaml but your class name is same as it is for ImagesGird.xaml user control due to which it is saying that its already defined changed class name as well.

You have two class with same name.

1) in ImagesGrid.xaml user control

2) in C1.xaml user control

which is obviuosly wrong.

When you duplicate a xaml/cs pair, you need to take care to change the name of the class in both the XAML file and the codebehind, basically the two lines of code you listed. Make sure that in the original class and in the new class, BOTH are different.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM