void SetSource(RadioButtonsSourceLocation location)
 {
     switch(location)
     {
         case RadioButtonsSourceLocation.Items:
             elements.GetSourceComboBox().SelectItemByName("ItemsComboBoxItem");
             break;
         case RadioButtonsSourceLocation.ItemSource:
             elements.GetSourceComboBox().SelectItemByName("ItemsSourceComboBoxItem");
             break;
     }
 }
示例#2
0
        private void SetSource(RadioButtonsSourceLocation location)
        {
            var sourceComboBox = QueryAll("SourceComboBox");

            sourceComboBox.SetDependencyPropertyValue("SelectedIndex", "1");
            sourceComboBox.SetDependencyPropertyValue("SelectedIndex", "0");
            sourceComboBox.SetDependencyPropertyValue("SelectedIndex", "-1");

            switch (location)
            {
            case RadioButtonsSourceLocation.Items:
                sourceComboBox.SetDependencyPropertyValue("SelectedIndex", "0");
                break;

            case RadioButtonsSourceLocation.ItemSource:
                sourceComboBox.SetDependencyPropertyValue("SelectedIndex", "1");
                break;
            }
        }