Binding to Inlines of TextBlock
Posted: 27 May 2023, 17:47
In the TextBlock documentation I see:
So is it possible to bind an inlines collection to the Inlines property?
I don't see any errors being logged from Noesis, but the inline elements also don't show up in the textblock. Is this sort of thing possible to do?
Code: Select all
A TextBlock can contain a string in its Text property or Inline flow content elements, such as Bold, Hyperlink, and InlineUIContainer, in its Inlines property.Code: Select all
<TabControl TabStripPlacement="Left" x:Name="TellsTabs">
<TabControl.ItemTemplate>
<DataTemplate>
<Label Content="{Binding Sender}" />
</DataTemplate>
</TabControl.ItemTemplate>
<TabControl.ContentTemplate>
<DataTemplate>
<TextBlock Inlines="{Binding Text}" />
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>
Code: Select all
struct RealmUI_Tell : Noesis::BaseComponent
{
Noesis::String sender;
Noesis::Ptr<Noesis::InlineCollection> text = Noesis::MakePtr<Noesis::InlineCollection>();
const Noesis::String& GetSender() const { return sender; }
Noesis::InlineCollection* GetText() const { return text; }
NS_IMPLEMENT_INLINE_REFLECTION(RealmUI_Tell, Noesis::BaseComponent)
{
NsProp("Sender", &RealmUI_Tell::GetSender);
NsProp("Text", &RealmUI_Tell::GetText);
}
};