I have XAML like this.. Basically it concatenates multiple strings that bind to different properties. Let’s say for some reason I do not want to expose another property on VM to have it as single property.
Is there any other XAML-bind way to make it more compact?
<StackPanel Grid.Column="1" Orientation="Horizontal">
<TextBlock Text="Added by " FontSize="10" Foreground="#2C2C2C" />
<TextBlock Text="{Binding Document.MEMUser.UserName}" Foreground="#2C2C2C" FontSize="10" />
<TextBlock Text=" on " FontSize="10" Foreground="#2C2C2C"/>
<TextBlock Text="{Binding CreatedOn, Converter={StaticResource DateTimeToStringConverter}}" Foreground="#2C2C2C" FontSize="10" />
<!--BIND COMMANDS TO PARENT ViewModel to process operations-->
<Button Content="Delete" Command="{Binding DataContext.DeleteCommand, ElementName=LayoutRoot}" CommandParameter="{Binding}" />
<Button Content="Download" Command="{Binding DataContext.DownloadCommand, ElementName=LayoutRoot}" CommandParameter="{Binding}" />
</StackPanel>
You can use
<Run>elements within theTextBlock: