5

I tried ILSpy, but it failed:

System.NotImplementedException: StaticResourceStart
   в Ricciolo.StylesExplorer.MarkupReflection.XmlBamlReader.ProcessNext()
   в Ricciolo.StylesExplorer.MarkupReflection.XmlBamlReader.ReadInternal()
   в Ricciolo.StylesExplorer.MarkupReflection.XmlBamlReader.Read()
   в System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)
   в System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o)
   в System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
   в ILSpy.BamlDecompiler.BamlResourceEntryNode.LoadIntoDocument(IAssemblyResolver resolver, AssemblyDefinition asm, Stream stream)
   в ILSpy.BamlDecompiler.BamlResourceEntryNode.LoadBaml(AvalonEditTextOutput output)
   в ILSpy.BamlDecompiler.BamlResourceEntryNode.<>c__DisplayClass3.<View>b__1()

I tried Baml Viewer for .Net Reflector, but it was unable to generate valid XAML.

The main problem was with Binding that reference to wrong StaticResource.

For example (namedViews is CollectionViewSource):

   Visibility="{Binding Path=Value, Converter={StaticResource namedViews}}"
   ToolTip="{StaticResource namedViews}"

What other applications exist to decompile BAML? Any patch to BAML Viewer?

Quiz
  • 514
  • 1
  • 7
  • 13
  • 1
    I just used **ILSpy version 6.0.0.5559-preview2** to open a WPF assembly and it produced XAML from the baml without any problem. – Brian THOMAS Jul 20 '20 at 08:27

1 Answers1

6

Not sure if this will help you, but if you can run the application, you can use Snoop to run through the structure of a WPF application.

Other options:

I've only tried Snoop and like it very much, but that didn't seem to solve your problem.

Martin Liversage
  • 104,481
  • 22
  • 209
  • 256
Peter
  • 13,733
  • 11
  • 75
  • 122
  • I can view ToolBarTrayControl, but Ribbon is not presented in Snoop. – Quiz Jun 15 '11 at 12:23
  • Hm, no mention of ToolBarTrayControl or Ribbon in your question. I think you should elaborate a little more. Are you trying to find the bindings with wrong StaticResources? You could also try dotPeek (from JetBrains) – Peter Jun 15 '11 at 13:53
  • dotPeek plugin based on BAML Viewer for Reflector, and yes problems are same. JustDecompile doesn't support BAML feature [yet](http://justdecompile.uservoice.com/forums/113277-justdecompile-feature-suggestions/suggestions/1893781-styles-explorer-baml-decompiler-and-codeviewer-f). Woodstock ask for Full Trust. – Quiz Jun 16 '11 at 06:32
  • Sorry, I'm all out of ideas :( – Peter Jun 16 '11 at 07:30