Manipulate the Dynamic viewmodel

2 posts, 0 answers
  1. Martin
    Martin avatar
    39 posts
    Member since:
    Sep 2008

    Posted 25 Mar 2013 Link to this post

    When I select a value in a combobox I want to update a value on the dynamic viewmodel

    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}"
                                SelectedItem="{Binding CurrentPropertySet[RequiredCondition]}"
                                ToolTip="{Binding ElementName=cboRequiredCondition, Path=SelectionBoxItem.Description}"

    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
                  if (Conditions.Count > 0 && _visibleCondition == null)
                      _visibleCondition = Conditions.SingleOrDefault(x => x.Action == Condition.Actions.SET_IS_VISIBLE);
                      IsVisible = _visibleCondition == null;
                  return _visibleCondition;
                  if (_visibleCondition != value)
                      IsVisible = value == null;
                      // remove the old condition
                      if (Conditions.Contains(_visibleCondition))
                      // add the new condition
                      _visibleCondition = value;
                      IsVisible = _visibleCondition == null;

    Normal when I set IsVisible I will get a NotifyPropertyChanged (using Fody
    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?. 


  2. Ivan Ivanov
    Ivan Ivanov avatar
    1116 posts

    Posted 28 Mar 2013 Link to this post


     Will it be possible for you to send us a sample project as it is extremely difficult for us to reproduce your scenario by having only few code snippets?

    Kind regards,
    Ivan Ivanov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft R3 2016 release webinar banner
Back to Top