Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4970
SelectionChanged not fired for XamComboEditor
posted

1. Create a class as:

 public class Item: Object
    {
        public int ID { get; set; }
        public string Name { get; set; }
        public override bool Equals(System.Object obj)
        {
            // If parameter is null return false.
            if (obj == null)
            {
                return false;
            }

            // If parameter cannot be cast to Point return false.
            Item i = obj as Item;
            if ((System.Object)i == null)
            {
                return false;
            }
            // Return true if the fields match:
            return ( ID== i.ID);
        }
        public override int GetHashCode()
        {
            return ID;
        }
    }

2.  Get data from wcf ria service:

  MyItems = (from b in this._result
                       select new Item{ Name = b.Name, ID = b.ID }).Distinct();

3. set ItemSource for XamComboEditor:

this.MyCombo.ItemsSource = vm.MyItems;

4. Xaml for XamComboEditor is:

<ig:XamComboEditor x:Name="MyCombo" IsEditable="True"  AllowFiltering="True" AutoComplete="True"
DisplayMemberPath="Name" SelectionChanged="MyCombo_SelectionChanged" />

then run the app and change selected item from XamComboEditor, but event MyCombo_SelectionChanged is never fired.

How to resolve this problem?