Hi there,
i want to display some datatypes in a combobox. the datatypes are wrapped in the following class:
public class TDataTypeBinder: INotifyPropertyChanged
{
private string name;
public string Name
{
get
{
return name ;
}
set
{
name = value;
OnPropertyChanged("Name");
}
}
private DataType datatype;
public DataType Datatype
{
get
{
return datatype;
}
set
{
datatype = value;
OnPropertyChanged("Datatype");
}
}
/// <summary>
/// Initializes a new instance of the <see cref="TDataTypeBinder"/> class.
/// </summary>
/// <param name="valueToSelect">The value to select.</param>
public TDataTypeBinder(string valueToSelect)
{
Name = valueToSelect;
}
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string propName)
{
PropertyChangedEventHandler eh = this.PropertyChanged;
if (null != eh)
{
eh(this, new PropertyChangedEventArgs(propName));
}
}
}
currently i have a property for the binding:
public CollectionView DatatypesDisplayed
{
get
{
List<TDataTypeBinder> list = new List<TDataTypeBinder>();
list.Add(new TDataTypeBinder("String"));
list.Add(new TDataTypeBinder("Float"));
list.Add(new TDataTypeBinder("Integer"));
myDatatypes = new CollectionView(list);
return myDatatypes;
}
}
which is connected via xaml in the WorkflowElement:
<... WorkflowViewElement ...
<ComboBox Name="gType" ItemsSource="{Binding Path=ModelItem.DatatypesDisplayed }" DisplayMemberPath="Name" Margin="3" MinWidth="150" Height="20" />
I dont get anything in my combobox gType
. What did i wrong? I am new to WPF and Workflow 4.0 so i think this isnt a hard one for you.
Thanks in advice, el