TransformXaml parses markup files to identify elements for renaming and updates their corresponding references.
Supported Markup Formats
The feature supports the following binary and text-based formats:
| Format | Description |
|---|---|
| XBF | Binary format typically used in UWP and Windows 8.x apps. |
| BAML | XAML file encoded as binary, typically used in WPF. |
| XAML | Standard mark-up language for UI. |
Example: WPF Application Obfuscation
Consider a simple WPF application WpfSampleApp where a Button UI element changes a TextBox via WPF data binding. The solution structure contains MainWindow.xaml and App.xaml.
Inside MainWindow.xaml, a Grid container holds the TextBox and Button child elements. All three elements use the x:Name attribute for identification:
-
Grid:
testWpfGrid -
TextBox:
txtWpfTextBox -
Button:
btnWpfButton
When you obfuscate the assembly (.dll), Dotfuscator updates these identifier names. Review the Map.xml file to see the mapping of original names to new identifier names.
You can also view the updated references by opening the obfuscated assembly in the ILSpy decompiler.
Check the Field Metadata table in ILSpy to confirm the changed TextBox name.
After disabling Library Mode, use ILSpy to view the updated class names in the obfuscated assembly.