Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Is there an 'inlinesproperty' for a textblock datatemplate?

$
0
0

Hi,

     my application generates a datatemplate for a textblock at runtime (i.e. in code). This works fine if I only want to bind to the text property see below:

Binding binValueBinding = new Binding("UnitID");
                    binValueBinding.Converter = valConverter;

FrameworkElementFactory txtValue = new FrameworkElementFactory(typeof(TextBlock));

txtValue.SetValue(TextBlock.TextProperty, binValueBinding);

Now I want to be able to display inline elements in the text block so I tried to bind to the Inlines property but this doesn't exist. Can anyone suggest how I do this? (When I run this with the binding set to the TextProperty as shown above I get 'System.Windows.Documents.Span' displayed instead of the contents of the Span object).

SteveR


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>