private void ElementTypeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { // ElementActionComboBox.Items.Clear(); ElementLocateByComboBox.IsEnabled = true; if (!String.IsNullOrEmpty(ElementTypeComboBox.SelectionBoxItem.ToString())) { if (ElementTypeComboBox.SelectedValue != null && !String.IsNullOrEmpty(ElementTypeComboBox.SelectedValue.ToString())) { if (ElementTypeComboBox.SelectedValue.ToString() != ElementTypeComboBox.SelectionBoxItem.ToString()) { ResetActUIFields(); } } } mAction.ElementType = (eElementType)ElementTypeComboBox.SelectedValue; List <ActUIElement.eElementAction> list = mPlatform.GetPlatformUIElementActionsList(mAction.ElementType); ElementTypeImage.Source = GetImageSource(mAction.Image); ElementActionComboBox.BindControlWithGrouping(mAction, ActUIElement.Fields.ElementAction, list); UpdateActionInfo(mAction.ElementAction); UIElementActionEditPageFrame.Visibility = Visibility.Collapsed; if (mAction.ElementType != eElementType.Unknown && mAction.ElementAction != ActUIElement.eElementAction.Unknown) { ShowControlSpecificPage(); } }
private void ElementTypeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (!Convert.ToBoolean(mAction.GetInputParamValue(Fields.IsWidgetsElement))) { mElementActionsList = mPlatform.GetPlatformUIElementActionsList(mAction.ElementType); } else { mElementActionsList = mPlatform.GetPlatformWidgetsUIActionsList(mAction.ElementType); } ElementActionComboBox.SelectionChanged -= ElementActionComboBox_SelectionChanged; ElementActionComboBox.BindControl(mAction, nameof(ActUIElement.ElementAction), mElementActionsList); ElementActionComboBox.SelectedValue = mAction.ElementAction;//need to fix binding to avoid it ElementActionComboBox.SelectionChanged += ElementActionComboBox_SelectionChanged; if (mElementActionsList.Count == 0) { mAction.ElementAction = eElementAction.Unknown; } else if (mAction.ElementType != eElementType.Unknown && !mElementActionsList.Contains(mAction.ElementAction)) { mAction.ElementAction = mElementActionsList[0];//defualt operation for element type should be first one } xElementTypeImage.ImageType = ElementInfo.GetElementTypeImage(mAction.ElementType); UpdateActionInfo(mAction.ElementAction); }
private void ElementTypeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { mElementActionsList = mPlatform.GetPlatformUIElementActionsList(mAction.ElementType); ElementActionComboBox.SelectionChanged -= ElementActionComboBox_SelectionChanged; ElementActionComboBox.BindControl(mAction, nameof(ActUIElement.ElementAction), mElementActionsList); ElementActionComboBox.SelectedValue = mAction.ElementAction;//need to fix binding to avoid it ElementActionComboBox.SelectionChanged += ElementActionComboBox_SelectionChanged; if (mElementActionsList.Count == 0) { mAction.ElementAction = eElementAction.Unknown; } else if (mAction.ElementType != eElementType.Unknown && !mElementActionsList.Contains(mAction.ElementAction)) { mAction.ElementAction = mElementActionsList[0];//defualt operation for element type should be first one } ElementTypeImage.Source = GetImageSource(mAction.Image); UpdateActionInfo(mAction.ElementAction); }