|
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using XMLStudio_IDE.WPFControlUtils;
using XMLStudio_IDE.WPFControlUtils.WPFPropertyGridProxies;
namespace XMLStudio_IDE.Converters
{
public class WPFPropertyGridProxyConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is TextBox)
return new TextBoxProxy(value as TextBox);
if (value is Label)
return new LabelProxy(value as Label);
if (value is CheckBox)
return new CheckBoxProxy(value as CheckBox);
if (value is DatePicker)
return new DatePickerProxy(value as DatePicker);
if (value is ComboBox)
return new ComboBoxProxy(value as ComboBox);
if (value is Expander)
return new ExpanderProxy(value as Expander);
if (value is RadioButton)
return new RadioButtonProxy(value as RadioButton);
if (value is ListView)
return new ListViewProxy(value as ListView);
if (value is Choice)
return new ChoiceProxy(value as Choice);
if (value is GroupBox)
return new GroupBoxProxy(value as GroupBox);
if (value is CloseButton || value is GroupMembersButton)
{
Button btn = UIHelper.FindFirstChild<Button>(value as DependencyObject, false);
if (btn != null)
{
return new ButtonProxy(btn);
}
}
return value;
}
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.
Sr. application developer currently developing desktop and web applications for the specialty insurance sector. Data integration specialist, interested in learning the latest .Net technologies.