Files
DP44/Common/DTS.CommonCore/.svn/pristine/d2/d21cd402d1b5ef176f0b908e8e7186bf4a6fccc4.svn-base

40 lines
1.8 KiB
Plaintext
Raw Normal View History

2026-04-17 14:55:32 -04:00
using System;
using System.Windows;
using System.Windows.Data;
namespace DTS.Common.Converters
{
/// <summary>
/// Represents the converter that converts Text (GroupName) values to and from <see cref="Visibility">Visibility</see> enumeration values.
/// </summary>
public class GroupNameToVisibilityConverter : IValueConverter
{
/// <summary>
/// Converts a Group Name value to a Visibility enumeration value.
/// </summary>
/// <param name="value">The Boolean value to convert. This value can be a standard Boolean value or a nullable Boolean value.</param>
/// <param name="targetType">This parameter is not used.</param>
/// <param name="parameter">The converter parameter to use.</param>
/// <param name="culture">This parameter is not used.</param>
/// <returns>The value to be passed to the target dependency property.</returns>
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value != null && value.ToString().Trim().StartsWith("Graph")) { return Visibility.Visible; }
return Visibility.Collapsed;
}
/// <summary>
///
/// </summary>
/// <param name="value">A Visibility enumeration value.</param>
/// <param name="targetType">This parameter is not used.</param>
/// <param name="parameter">This parameter is not used.</param>
/// <param name="culture">This parameter is not used.</param>
/// <returns>The value to be passed to the source object.</returns>
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return null;
}
}
}