Hi.
I use the property editor and want almost all of the properties to be auto generated, because they are dynamically loaded from available modules. But there are some properties, which should be generated as nested properties, so I define them in code like this:
The result you can see on the attached screenshot, the properties are generated correctly, but the binding made in line 8 is not working.
I am getting this binding exceptions:
System.Windows.Data Error: 40 : BindingExpression path error: 'WorkStartTillPause' property not found on 'object' ''PropertySetViewModel' (HashCode=37731737)'. BindingExpression:Path=WorkStartTillPause; DataItem='PropertySetViewModel' (HashCode=37731737); target element is 'RadTimePicker' (Name=''); target property is 'SelectedValue' (type 'Nullable`1')
Can you tell me how to construct the binding to get this work?
I use the property editor and want almost all of the properties to be auto generated, because they are dynamically loaded from available modules. But there are some properties, which should be generated as nested properties, so I define them in code like this:
01.
private
PropertyDefinition GetOperationTimePropertyDefinition(List<OperationTime> times)
02.
{
03.
var definition =
new
PropertyDefinition();
04.
05.
int
order = 1;
06.
foreach
(var operationTime
in
times)
07.
{
08.
var binding =
new
Binding { Source = operationTime, Path =
new
PropertyPath(
""
)};
09.
10.
var nestedPropertyDefinition =
new
PropertyDefinition
11.
{
12.
DisplayName = operationTime.DayOfWeek,
13.
OrderIndex = order++,
14.
Binding = binding,
15.
EditorTemplate = FindResource(
"OperationTimeEditorTemplate"
)
as
DataTemplate
16.
};
17.
18.
definition.NestedProperties.Add(nestedPropertyDefinition);
19.
}
20.
21.
return
definition;
22.
}
The result you can see on the attached screenshot, the properties are generated correctly, but the binding made in line 8 is not working.
I am getting this binding exceptions:
System.Windows.Data Error: 40 : BindingExpression path error: 'WorkStartTillPause' property not found on 'object' ''PropertySetViewModel' (HashCode=37731737)'. BindingExpression:Path=WorkStartTillPause; DataItem='PropertySetViewModel' (HashCode=37731737); target element is 'RadTimePicker' (Name=''); target property is 'SelectedValue' (type 'Nullable`1')
Can you tell me how to construct the binding to get this work?