Posted 16 years ago by Tom West
Avatar
Hi,
I am trying to format a DateTime to a shorttime format in xaml, what is the correct synatax to apply the shorttime format?

This is what i have:

xmlns:Calendar="clr-namespace:ActiproSoftware.Windows.Controls.Calendar;assembly=ActiproSoftware.Shared.WPF30"


<Calendar:DateTimeToStringConverter x:Key="ShortTimeConverter" />


<TextBlock Text="{Binding EndTime,Converter={StaticResource ShortTimeConverter}}" TextWrapping="Wrap" FontSize="{Binding EndTimeFontSize}" Foreground="{Binding EndTimeForeground}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="117" Height="37" SnapsToDevicePixels="True" />


How to I pass in the ShortTime parameter in Xaml?

Thanks,
Tom

Comments (1)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Tom,

Something like this will work:
{Binding Converter={StaticResource ShortTimeConverter}, ConverterParameter={x:Static shared:DateTimeToStringPattern.ShortTime}}


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.