/// <summary> /// This looks up about the tagged named. /// </summary> /// <param name="value">Dependency object in a tree</param> /// <param name="tableFields">Fields of the table on which we depend</param> /// <param name="assistTableFields">Fields of the assist table on which we depend</param> private static void OtherDataFieldComponent(DependencyObject value, IDictionary <string, string> tableFields, IDictionary <string, string> assistTableFields) { if (value is DualFieldSearchBox) { // get the table and the field. DualFieldSearchBox dualFieldSearchBox = (DualFieldSearchBox)value; AddOrCreate(dualFieldSearchBox.AssistTableName, dualFieldSearchBox.AssistDataFieldFirst, ref assistTableFields); AddOrCreate(dualFieldSearchBox.AssistTableName, dualFieldSearchBox.AssistDataFieldSecond, ref assistTableFields); AddOrCreate(dualFieldSearchBox.TableName, dualFieldSearchBox.DataFieldFirst, ref tableFields); } else { PropertyInfo fieldInfo = value.GetType().GetProperty("DataField"); PropertyInfo tableInfo = value.GetType().GetProperty("TableName"); if ((fieldInfo != null) || (tableInfo != null)) { string fieldName = (string)fieldInfo.GetValue(value); string tableName = (string)tableInfo.GetValue(value); if ((fieldName != null) || (tableName != null)) { AddOrCreate(tableName, fieldName, ref tableFields); } } } }
/// <summary> /// OnApplyTemplate. This allow a template to be done. /// </summary> public override void OnApplyTemplate() { base.OnApplyTemplate(); _dataField = GetTemplateChild("PART_DataField") as DataField; _dualFieldSearchBox = GetTemplateChild("PART_SearchBox") as DualFieldSearchBox; if (_dataField != null) { _dataField.ItemChangedCommand = new Prism.Commands.DelegateCommand <object>(OnFirstChanged); } if (_dualFieldSearchBox != null) { _dualFieldSearchBox.ItemChangedCommand = new Prism.Commands.DelegateCommand <object>(OnSecondChanged); // _dualFieldSearchBox.MagnifierCommand = new Prism.Commands.DelegateCommand<object>(OnMagnifierCommand); } }