Hi,
I am using a time picker control. below is my code in xaml page
<xctk:TimePicker Height="23" Width="150" HorizontalAlignment="Left" Grid.Column="3" Name="DtPktDlvryEndDate" Focusable="False" VerticalAlignment="Center" TextAlignment="Left" Format="Custom" FormatString="hh:mm tt" IsEnabled="{Binding Path=ATGTransDetailsModel.IsAtgConfig}" Value="{Binding Path=ATGTransDetailsModel.DlvryEndDateTime, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
and in view model :
public string DlvryEndDateTime
{
get
{
return dlvryEndDateTime;
}
set
{
dlvryEndDateTime = value;
OnPropertyChanged("DlvryEndDateTime");
}
}
Problem is when I use the up or down arrow to change the time,application giving exception like
Index was out of range. Must be non-negative and less than the size of the collection.
Instead of string, i gave datetime for the property in the model, This way also giving same exception.
When I remove Format="Custom" FormatString="hh:mm tt" from xaml, exception is not coming.
Thing is that i need 24hrs format to display the time.
I am using a time picker control. below is my code in xaml page
<xctk:TimePicker Height="23" Width="150" HorizontalAlignment="Left" Grid.Column="3" Name="DtPktDlvryEndDate" Focusable="False" VerticalAlignment="Center" TextAlignment="Left" Format="Custom" FormatString="hh:mm tt" IsEnabled="{Binding Path=ATGTransDetailsModel.IsAtgConfig}" Value="{Binding Path=ATGTransDetailsModel.DlvryEndDateTime, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
and in view model :
public string DlvryEndDateTime
{
get
{
return dlvryEndDateTime;
}
set
{
dlvryEndDateTime = value;
OnPropertyChanged("DlvryEndDateTime");
}
}
Problem is when I use the up or down arrow to change the time,application giving exception like
Index was out of range. Must be non-negative and less than the size of the collection.
Instead of string, i gave datetime for the property in the model, This way also giving same exception.
When I remove Format="Custom" FormatString="hh:mm tt" from xaml, exception is not coming.
Thing is that i need 24hrs format to display the time.