I am successfully using XamlReader
to download the XamlReader
file and create a FrameworkElement
to work with.
In xaml, which I download, there are related expressions such as:
<TextBlock Text="{Binding DataContextTextProperty}" />
If I put FrameworkElement, I will return from XamlReader.Load()
to the WPF window, binding everything works fine.
However, in this case, I use Laurent Bugnion's excellent article on creating PNG from WPF / XAML . Since the result of XamlReader.Load()
written directly to PNG via a VisualBrush
, it seems that the necessary WPF mechanics to invoke binding expressions are bypassed.
This makes me think that the actual bindings are not actually called only by calling XamlReader.Load()
, or that they do not work because I donβt know what to do with the absence of a visual tree until you add the FrameworkElement
to the existing one visual tree or something else.
Is there anything I can do to ensure that these bindings are invoked?
Thank you very much in advance.
source share