MainWindow.xaml 941 B

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