1.ListBox
对于数据绑定:如绑定的是实体,正常使用DataSource和SelectedItem即可
如自己手动添加的ListBoxItem获取选中项
b.需定义一个ListBoxItem类型的变量(如:SymbolSelected)绑定到SelectedItem;
c.使用时SymbolSelected.Content即可
2 .MultiBinding
<DataGridTextColumn Width="240" Header="起止时间" >
<DataGridTextColumn.Binding>
<MultiBinding StringFormat="{}{0:yyyy/MM/dd HH:mm}-{1:yyyy/MM/dd HH:mm}">
<Binding Path="ApplicantLeaveTimeFrom"/>
<Binding Path="ApplicantLeaveTimeTo" />
</MultiBinding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>