/// <summary> /// Fills the group combo boxes and contact lists with custom groups and their /// associated contacts from the Lync contact list /// </summary> void UpdateGroupList() { //Get the collection of Lync custom groups and add the collection to the left list LeftGroupList = new ObservableCollection <GroupInfo>(GetCustomGroups().OrderBy(p => p.Name)); //Add the same custom group collection to the right list RightGroupList = LeftGroupList; //Set the left and right combo boxes to the first custom group in the groups collection LeftCurrentGroup = LeftGroupList.First(); RightCurrentGroup = RightGroupList.First(); //Notify UI that data bound to controls have changed. if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs("LeftGroupList")); PropertyChanged(this, new PropertyChangedEventArgs("RightGroupList")); PropertyChanged(this, new PropertyChangedEventArgs("LeftCurrentGroup")); PropertyChanged(this, new PropertyChangedEventArgs("RightCurrentGroup")); } }
void UpdateIsMoveEnabled() { IsMoveButtonEnabled = false; if (LeftCurrentGroup == null) { LeftCurrentGroup = LeftGroupList.First(); } if (RightCurrentGroup == null) { RightCurrentGroup = RightGroupList.First(); } if (LeftCurrentGroup.Name != RightCurrentGroup.Name && contactListBox1.SelectedItem != null) { IsMoveButtonEnabled = true; } if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs("IsMoveButtonEnabled")); } }