DateTimeConverter converts a DateTime value during data binding using specified format string.
Namespace
StoreAppLib.Converters
Using DateTimeConverter
To use DateTimeConverter in your project, add the reference to StoreAppLib project or install StoreAppLib from Visual Studio "Manage NuGet Packages" tool.
To use the converter while binding first declare the converter in the App.xaml file.
<Application
xmlns:storeAppConverter="using:StoreAppLib.Converters"
... >
<Application.Resources>
<ResourceDictionary>
<storeAppConverter:DateTimeConverter x:Key="DateTimeConverter" />
</ResourceDictionary>
</Application.Resources>
</Application>
Following code shows the usage of the converter while binding.
<TextBlock Width="150"
Height="30"
Text="{Binding CurrentDate, Converter={StaticResource DateTimeConverter}, ConverterParameter='dd-MMM-yyyy'}" />