Mahesha999
Mahesha999

Reputation: 24721

Copy pasting WPF window gives error

I realized that VS gives error when we try to copy paste one of the window. The errors are usually of type the method call is ambiguous between InitializeComponet() or other methods. This is because that VS only renames xaml files but not the assciated CS files. I dont know why VS dont handle that. What is better way to copy paste the existing windows, that will not give any error. Or is their any simple workaround? What all other things we need to manually rename?

Upvotes: 2

Views: 841

Answers (1)

Shakti Prakash Singh
Shakti Prakash Singh

Reputation: 2533

The VS renames XAML and the associated CS files as well. What it does not do is change the class name and constructor name in the CS file and the x:Class property in the XAML file. If you change these, this would work fine.

I don't think there is a workaround, but I don't think that it is a lot of work either.

Upvotes: 4

Related Questions