1234567891011121314151617181920212223242526272829303132 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Windows.Data;
- using System.Windows.Media;
- using System.Windows;
- namespace Aitex.UI.Charting.Converter
- {
- public class RolloverDataTimeConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- if (value != null)
- {
- DateTime dt;
- var isSucc = DateTime.TryParse(value.ToString(), out dt);
- if (isSucc)
- return string.Format("{0}{1}{2}", " 【", dt.ToString("yyyy/MM/dd HH:mm:ss"), "】 ");
- }
- return "N/A";
- }
- public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- return null;
- }
- }
- }
|