我不能为我的生活让这个工作.我需要从文本块中的一对时空对象中显示hh:mm,它只是不起作用.这是我到目前为止:
<TextBlock>
<TextBlock.Text>
<MultiBinding StringFormat="{}From {0:hh\\:mm} to {1:hh\\:mm}">
<Binding Path="StartTime"/>
<Binding Path="EndTime"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
Run Code Online (Sandbox Code Playgroud)
文本块显示为空白.我也尝试了以下相同的结果:
<TextBlock>
<TextBlock.Text>
<MultiBinding StringFormat="{}From {0} to {1}">
<Binding Path="StartTime" StringFormat="hh\\:mm"/>
<Binding Path="EndTime" StringFormat="hh\\:mm"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
Run Code Online (Sandbox Code Playgroud)
如果我的字符串格式为hust"hh"那么我只得到了几个小时,所以我想我可以用4个部分来构建它,但这感觉不对.任何帮助表示赞赏.