//05/18/2013 //oldvalue is null initially //you don't have to return any values //The main purpose of this function is to populate sp.Children.Add(tmp); with the radio buttons protected override object GetEditedValue(Control EditControl, string PropertyName, object oldValue, object currentObj) { if (EditControl is DependentListBoxEditorWindow) { DependentListBoxEditorWindow w = EditControl as DependentListBoxEditorWindow; //Aaron added 11/11/2013 //Object wrapper is a wrapper object used to show categories in the grid //We need to extract the button object from the wrapper ObjectWrapper placeHolder = currentObj as ObjectWrapper; FrameworkElement selectedElement = placeHolder.SelectedObject as FrameworkElement; //Aaron added 11/11/2013 //Commented code below //FrameworkElement selectedElement = currentObj as FrameworkElement; if (w.DialogResult.HasValue && w.DialogResult.Value) { return(w.MasterSlaveEntries); } return(oldValue); } return(false); }
protected override Control GetEditControl(string PropName, object CurrentValue, object CurrentObj) { MasterSlaveValueCollection col = new MasterSlaveValueCollection(); //Aaron added 11/11/2013 //Object wrapper is a wrapper object used to show categories in the grid //We need to extract the button object from the wrapper slaveList = new List <string>(); masterList = new List <string>(); ObjectWrapper placeHolder = CurrentObj as ObjectWrapper; BSkyMasterListBox lb = placeHolder.SelectedObject as BSkyMasterListBox; //Aaron added 11/11/2013 //Commented code below // BSkyRadioGroup rg = CurrentObj as BSkyRadioGroup; //Added by Aaron 1/2/2014 //Checking to see whether the master listbox name is null or empty if (string.IsNullOrEmpty(lb.Name)) { MessageBox.Show(BSky.GlobalResources.Properties.Resources.EnterValidMasterNameProp); return(null); } //Added by Aaron 12/19/2013 //Lets get the slave listbox name string slaveName = lb.SlaveListBoxName; if (string.IsNullOrEmpty(slaveName)) { MessageBox.Show(BSky.GlobalResources.Properties.Resources.EnterValidSlaveNameProp); return(null); } //Populating the slavelist that we will bind to in the master slave mapping BSkyListBox slaveListBox = GetResource(lb, slaveName) as BSkyListBox; if (slaveListBox == null) { MessageBox.Show(BSky.GlobalResources.Properties.Resources.EnterValidNameSlave); return(null); } foreach (String item in slaveListBox.Items) { slaveList.Add(item); } //Populating the masterlist that we will bind to in the master slave mapping foreach (String itemms in lb.Items) { masterList.Add(itemms); } //Aaron 05/05/2013 //Did not change code only added comment below //This launches the radio group editor window that allows the use to enter details about the radio group DependentListBoxEditorWindow w = new DependentListBoxEditorWindow(); //StackPanel sp = rg.Content as StackPanel; //Added by Aaron 05/05/2013 //Did not change code only added comment below //If there were existing radio buttons, the code below populates the windows with existing radio buttons //Commented by Aaton to try //foreach (string obj in rg.Items) //{ // DependentListBoxEntry entry = new DependentListBoxEntry(); // entry.entryName = obj; // col.Add(entry); //} if (lb.MappingMasterSlaveEntries != null) { if (lb.MappingMasterSlaveEntries.Count > 0) { w.MasterSlaveEntries = lb.MappingMasterSlaveEntries; } } else { w.MasterSlaveEntries = col; } //Added by Aaron 05/05/2013 //Did not change code only added comment below //the line below adds the BSkyRadioButtonCollection to the observable collection of radio buttons //public ObservableCollection<BSkyRadioButton> RadioCollection //The observable collection is populated in the setter of //Aaron 12/26 ADDED AND commented lines below // rg.RadioButtons = col; return(w); }