使用MultiBinding的原则:数据源有一个以上

1. 需求:在一个需要显示的内容中,不同的部分要进行的处理不一样,这时可以使用MultiBinding

1 <TextBlock>
2           <TextBlock.Text>
3                      <MultiBinding StringFormat="{}{0} {1} {2}">
4                                 <Binding Path="DownloadViewModel.TotalDeviceCount" />
5                                  <Binding Path="Language" Converter="{StaticResource LanConverter}" ConverterParameter="Problem"/>
6                                   <Binding Path="DownloadViewModel.TotalDeviceCount" Converter="{StaticResource NumToPluralConverter}" ConverterParameter="Driver" />
7                        </MultiBinding>
8              </TextBlock.Text>
9  </TextBlock>
View Code

相关文章:

  • 2022-03-04
  • 2022-12-23
  • 2021-09-17
  • 2021-05-27
  • 2021-06-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
相关资源
相似解决方案