I have renamed the namespace of a referenced class and WPF compiler doesn't want to take it into account: it keeps prefixing MyOldNameSpace in .g.cs file:
[System.CodeDom.Compiler.GeneratedCodeAttribute
("PresentationBuildTasks", "4.0.0.0")]
public partial class MyClass:
MyOldNameSpace.MyReferencedClass,
System.Windows.Markup.IComponentConnector {
Why ? How to fix this ? What's this obscure .g.cs file ?
Looks like you didn't change your MyClass.xaml
file. There should be something like this on top of it
<MyClass x:Class="MyOldNameSpace.MyReferencedClass"
but should be "MyNewNameSpace.MyReferencedClass"
Close the .g.cs file. You can even delete it.
The g stands for generated, VS generates the wireing up between the code and the Xaml in this partial class.
Clean the solution and rebuild. That should fix it.
Don't forget to change your Generic.xaml file too,
<ResourceDictionary
xmlns:local="clr-namespace:MyOldNameSpace">
</ResourceDictionary>
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