// (c) Copyright Microsoft Corporation. // This source is subject to the Microsoft Public License (Ms-PL). // Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details. // All other rights reserved. using System.Globalization; using System.Windows.Data; namespace System.Windows.Controls.DataVisualization.Charting.Compatible { /// /// Converts from a true/false value indicating whether selection is enabled to a SeriesSelectionMode. /// internal class SelectionEnabledToSelectionModeConverter : IValueConverter { /// /// Initializes a new instance of the SelectionEnabledToSelectionModeConverter class. /// public SelectionEnabledToSelectionModeConverter() { } /// /// Converts a value. /// /// The value produced by the binding source. /// The type of the binding target property. /// The converter parameter to use. /// The culture to use in the converter. /// Converted value. public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { SeriesSelectionMode selectionMode = SeriesSelectionMode.None; if ((value is bool) && (bool)value) { selectionMode = SeriesSelectionMode.Single; } return selectionMode; } /// /// Converts a value back. /// /// The value produced by the binding source. /// The type of the binding target property. /// The converter parameter to use. /// The culture to use in the converter. /// Converted value. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }