I have a static ArrayList
of DateTimes
<Window.Resources>
<col:ArrayList x:Key="startHours">
<sys:DateTime>0:00</sys:DateTime>
<sys:DateTime>0:30</sys:DateTime>
<!-- .... -->
</col:ArrayList>
</Window.Resources>
I want to fill a combobox with hour:minute
formatted dates, so I do
<ComboBox x:Name="cmbFinish"
ItemsSource="{Binding Source={StaticResource startHours}}"
ItemStringFormat="t"/>
The Items are formatted ok - hour:minute
, but when I select an item, the cmbFinish.Value
has the default DateTime.ToString()
format. What am I missing? I need the cmbFinish.Value
to be in hour:minute
format.