i am using TimePicker control for the first time. I want to get the selected time into my ViewModel as well as bind the sele.cted time into a textblock/textbox. I am Able to bind the TextBox to selected to selected value But it displays Date As well with time. I want to display only time meaning, get only time from TimePicker.
the textbox data looks like- 2/8/2015 10:18:35 PM What want to display is - 10:18:35 PM
I dont understand why TimePicker should display date?? If so i could go for DateTimePicker control. But now i need only time to be selected and displayed. Here is my code trying to get it.. Please help me with this......!
Here is my code trying to get it..
Title="MainWindow" Height="350" Width="525">
<Window.DataContext>
<vm:Data></vm:Data>
</Window.DataContext>
<Grid>
<TimePick:TimePicker Name="tp" Format="LongTime" FormatString="hh:mm tt" Margin="10,52,174,244"/>
<TextBox Text="{Binding Path=Value, ElementName=tp}" Margin="0,127,174,153"></TextBox>
</Grid>