You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 27, 2026. It is now read-only.
Hi!
I am using your class BamlTranslator and I've found an issue when decompiling BAML.
If the original XAML as a TextBlock like this:
<TextBlock.Inlines>
</TextBlock.Inlines>
Where the property Inlines is used and inside there is a TextBlock collection, the function BamlTranslator.ReadText(string value) will throw a cast exception. Unable to cast object of type 'Property' to type 'Element'
I have fixed this issue my code as following:
private void ReadText(string value)
{
// skip the function if peek returns something different from element if (this.elementStack.Peek() is Element parent)
{
// Element parent = (Element)this.elementStack.Peek(); // the old line of code
if (this.constructorParameterTable.Contains(parent))
{
parent.Arguments.Add(value);
}
else
{
this.AddContent(parent, value);
}
}
}
Hi!
I am using your class BamlTranslator and I've found an issue when decompiling BAML.
If the original XAML as a TextBlock like this:
<TextBlock.Inlines>
</TextBlock.Inlines>
Where the property Inlines is used and inside there is a TextBlock collection, the function BamlTranslator.ReadText(string value) will throw a cast exception.
Unable to cast object of type 'Property' to type 'Element'
I have fixed this issue my code as following:
private void ReadText(string value)
{
// skip the function if peek returns something different from element
if (this.elementStack.Peek() is Element parent)
{
// Element parent = (Element)this.elementStack.Peek(); // the old line of code
if (this.constructorParameterTable.Contains(parent))
{
parent.Arguments.Add(value);
}
else
{
this.AddContent(parent, value);
}
}
}