|
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace DataGridDemo1.Converters
{
public class GroupRowHeaderVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
double width = System.Convert.ToDouble(value);
bool parameterState = parameter != null && bool.Parse(parameter.ToString());
if ((width == 0 && parameterState == false) || (width != 0 && parameterState))
{
return Visibility.Visible;
}
if ((width == 0 && parameterState) || (width != 0 && parameterState == false))
{
return Visibility.Collapsed;
}
return Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Kunal Chowdhury is a former Microsoft "Windows Platform Development" MVP (Most Valuable Professional, 2010 - 2018), a Codeproject Mentor, Speaker in various Microsoft events, Author, passionate Blogger and a Senior Technical Lead by profession.
He is currently working in an MNC located in India. He has a very good skill over XAML, C#, Silverlight, Windows Phone, WPF and Windows app development. He posts his findings, articles, tutorials in his technical blog (www.kunal-chowdhury.com) and CodeProject.
Books authored:
Connect with Kunal on: