When I select a value in a combobox I want to update a value on the dynamic viewmodel
I have this template:
And when the selecting changes i want to do some stuff, Can I do this from within a template?
Right now I am having two problems.
The clear button on the RadComboBox is not setting the value on my model and because I am using IntersectionMode = Dynamic viewmodel I can not use my model to execute the logic
Normal when I set IsVisible I will get a NotifyPropertyChanged (using Fody https://github.com/Fody/PropertyChanged.)
I am very close to my goal but I am unable to go the rest of the way alone (-.
Will it help if I have the depended properties in the same template?.
I have this template:
<
DataTemplate
x:Key
=
"RequiredCondition"
>
<
telerik:RadComboBox
ItemsSource="{Binding
Path
=
DataContext
.Conditions, RelativeSource={RelativeSource FindAncestor,
AncestorType={x:Type views:PropertyEditorView}},
Mode
=
OneWay
}"
DisplayMemberPath
=
"Name"
SelectedItem
=
"{Binding CurrentPropertySet[RequiredCondition]}"
ToolTip
=
"{Binding ElementName=cboRequiredCondition, Path=SelectionBoxItem.Description}"
ClearSelectionButtonContent
=
"Clear"
ClearSelectionButtonVisibility
=
"Visible"
TextSearchMode
=
"Contains"
x:Name
=
"cboRequiredCondition"
/>
</
DataTemplate
>
And when the selecting changes i want to do some stuff, Can I do this from within a template?
Right now I am having two problems.
The clear button on the RadComboBox is not setting the value on my model and because I am using IntersectionMode = Dynamic viewmodel I can not use my model to execute the logic
public
Condition VisibleCondition
{
get
{
if
(Conditions.Count > 0 && _visibleCondition ==
null
)
{
_visibleCondition = Conditions.SingleOrDefault(x => x.Action == Condition.Actions.SET_IS_VISIBLE);
IsVisible = _visibleCondition ==
null
;
}
return
_visibleCondition;
}
set
{
if
(_visibleCondition != value)
{
IsVisible = value ==
null
;
// remove the old condition
if
(Conditions.Contains(_visibleCondition))
Conditions.Remove(_visibleCondition);
// add the new condition
_visibleCondition = value;
Conditions.Add(_visibleCondition);
IsVisible = _visibleCondition ==
null
;
}
}
}
Normal when I set IsVisible I will get a NotifyPropertyChanged (using Fody https://github.com/Fody/PropertyChanged.)
I am very close to my goal but I am unable to go the rest of the way alone (-.
Will it help if I have the depended properties in the same template?.