Class1.cs 1019 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System.Globalization;
  2. using System.Text;
  3. using System.Windows;
  4. using System.Windows.Controls;
  5. using System.Windows.Data;
  6. using System.Windows.Documents;
  7. using System.Windows.Input;
  8. using System.Windows.Media;
  9. using System.Windows.Media.Imaging;
  10. using System.Windows.Navigation;
  11. using System.Windows.Shapes;
  12. namespace WpfApp4
  13. {
  14. public class DateTimeToDateConverter : IValueConverter
  15. {
  16. public object Convert(
  17. object value,
  18. Type targetType,
  19. object parameter,
  20. CultureInfo culture)
  21. {
  22. return ((DateTime)value).ToString("dd.MM.yyyy");
  23. }
  24. public object ConvertBack(
  25. object value,
  26. Type targetType,
  27. object parameter,
  28. CultureInfo culture)
  29. {
  30. return DependencyProperty.UnsetValue;
  31. }
  32. }
  33. class Phone
  34. {
  35. public string Title { get; set; }
  36. public string Company { get; set; }
  37. public int Price { get; set; }
  38. }
  39. }