私はこのようなXAMLを持っています。基本的には、異なるプロパティにバインドする複数の文字列を連結します。何らかの理由で、VM上の別のプロパティを公開して単一のプロパティとして使用したくないとしましょう。
それをよりコンパクトにする他のXAMLバインド方法はありますか?
<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>