SelectedColor Binding issu

2 posts, 0 answers
  1. Bill
    Bill avatar
    8 posts
    Member since:
    Dec 2012

    Posted 29 Mar 2013 Link to this post

    Hi telerick
         I use MVVM to Binding the SelectedColor Property,but When I change the color, there don't work,the VM's property don't change,How can I do?
    telerik:RadColorPicker SelectedColor="{Binding SuspectColor}" BorderThickness="0" MainPalette="Concourse" HeaderPalette="Solstice" NoColorText="{Resx RadColorPic_NoColorText}"
    StandardPaletteHeaderText="{Resx RadColorPic_StandardPaletteHeaderText}" MainPaletteHeaderText="{Resx RadColorPic_MainPaletteHeaderText}" />

    the VM code
    private string _suspectColor;
           public string SuspectColor
           {
               get
               {
     
                   if (_projectConfiguration != null)
                   {
                       _suspectColor = _projectConfiguration.SuspectColor;
                   }
                   return _suspectColor;
               }
               set
               {
                   _suspectColor = value;
                   _project.SavaImageTabConfig("SuspectColor", value.ToString());
                   base.OnPropertyChanged("SuspectColor");
               }
           }

  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 01 Apr 2013 Link to this post

    Hi Bill,

    Please make sure to bind the SelectedColor two-way:
    SelectedColor="{Binding SuspectColor, Mode="TwoWay"}"
    Kind regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top