MainWindow.xaml 1.0 KB

12345678910111213141516171819202122232425262728
  1. <Window x:Class="WpfApp4.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:WpfApp4"
  7. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  8. mc:Ignorable="d"
  9. Title="MainWindow" Height="450" Width="800"
  10. Background="PeachPuff"
  11. >
  12. <Window.Resources>
  13. <sys:DateTime x:Key="myDate">
  14. 2/12/2016
  15. </sys:DateTime>
  16. <local:DateTimeToDateConverter
  17. x:Key= "myDateConverter" />
  18. </Window.Resources>
  19. <StackPanel>
  20. <TextBlock
  21. Text="{Binding
  22. Source={StaticResource myDate},
  23. Converter={StaticResource myDateConverter}}" />
  24. <TextBlock
  25. Text="{Binding
  26. Source={StaticResource myDate}}" />
  27. </StackPanel>
  28. </Window>