12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Windows.Data;
- using System.Windows.Media;
- using System.Windows;
- using DataAnalysisControl.Core;
- namespace Aitex.UI.Charting.Converter
- {
- public class Visibility2boolConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- try
- {
- Visibility vi = (Visibility)value;
- if (vi == Visibility.Visible) return true;
- return false;
- }
- catch (Exception ex)
- {
- CONTEXT.WriteLog(ex);
- }
- return true;
- }
- public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- try
- {
- bool isChecked = (bool)value;
- if (isChecked) return Visibility.Visible;
- return Visibility.Hidden;
- }
- catch (Exception ex)
- {
- CONTEXT.WriteLog(ex);
- }
- return Visibility.Visible;
- }
- }
- }
|