WPF application not working after rename protection
When I protect the following app with rename protection it no longer displays the pages properly, after protecting I copied the dll files into the Confused directory to get it to load. I am using the 2.0 branch.
Any updates ?
The issue is that the binding expressions in the XAML files are not handled properly. This will take some time to fix. The problem is that the constructor parameter of the expression is not mapped to the property in the classes.
In detail this expression causes the issue:
DataContext="{Binding ApplicationViewModel.CurrentPage, Source={x:Static viewModel:ViewModelLocator.Instance}, Converter={valueConverters:ApplicationPageValueConverter}}"
ApplicationViewModel.CurrentPage is not resolved to the property in ViewModelLocator. Fixing this will take some time, because handling the binding expressions separately, can't be easily done in the way how the BAML analysis works now. I suggest disabling the renaming of both the ApplicationViewModel property and the CurrentPage property to work around this issue for now.
So basically a lot of the baml analysis code will have to be rewritten?
The parts that handle the processing those bindings need to anyway. They don't take into consideration what is used as the source for the binding and assume that the type will match with the property the binding writes to. That works sometimes, but it absolutely does not work for the DataContext.
I solved this in my project via a work-a-round. If i see a binding is after protection broken, so i set the binding in the constructor CS. This works for me.