Testing 将AutomationID分配给UWP组合框

Testing 将AutomationID分配给UWP组合框,testing,combobox,uwp,appium,uwp-xaml,Testing,Combobox,Uwp,Appium,Uwp Xaml,我已经看过一些相关的WPF示例,但是我在为UWP组合框中的项目分配AutomationID时遇到了问题。 本例使用EditingElementStyle,但在我的XAML代码中没有看到intellisense自动完成 <ComboBox x:Name="SampleComboBox" ItemsSource ="{Binding SampleList}" AutomationProperties.AutomationId="SampleReason" SelectionChanged="

我已经看过一些相关的WPF示例,但是我在为UWP组合框中的项目分配AutomationID时遇到了问题。 本例使用EditingElementStyle,但在我的XAML代码中没有看到intellisense自动完成

<ComboBox x:Name="SampleComboBox" ItemsSource ="{Binding SampleList}" 
AutomationProperties.AutomationId="SampleReason" SelectionChanged="Sample_OnSelectionChanged"
Height="40" Width="120" FontSize="18"  BorderBrush="#cccccc" BorderThickness="1"  
Background="White" Margin="0 0 2 0"  VerticalAlignment="Bottom"></ComboBox>

其中,作为数据源的采样列表在viewmodel中定义为

SampleList = null;
 string[] sampleTypes =
 {
      _screenText.GetString("SampleText1/Text"),
      _screenText.GetString("SampleText2/Text")
 };
 SampleList = new ObservableCollection<string>(sampleTypes);
SampleList=null;
字符串[]采样类型=
{
_screenText.GetString(“SampleText1/Text”),
_screenText.GetString(“SampleText2/Text”)
};
SampleList=新的ObservableCollection(sampleTypes);

在UWP中不起作用的样式中使用绑定。请发布有关使用
AutomationProperties.AutomationId
的代码。嗯,没有可发布的代码?有这个示例,但答案似乎与所问的问题不匹配。我没有模型,只有一个列表。