I need to write UI Automation test for the application where yours NavBar is used. the problem is when I dynamically create some views, they are not appears in the UI Automation tree. Without yours NavBar they are appeared.
I've attached video and sample project. To see the difference, use Inspect.exe tools from Microsoft.
Try #1 - as is, with NavBar;
Try #2 - comment NavBar (or remove it from xaml).
here the simple app that shows root cause:
I want you explain me why this happened and fix this bug.
MainWindow.xaml
<Window x:Class="UIA.WithNavBarControl.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525" xmlns:dxn="http://schemas.devexpress.com/winfx/2008/xaml/navbar">
<Grid Name="ContentGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<dxn:NavBarControl Name="navBarControl1">
<dxn:NavBarControl.Groups>
<dxn:NavBarGroup Header="navBarGroup1" Name="navBarGroup1">
</dxn:NavBarGroup>
</dxn:NavBarControl.Groups>
</dxn:NavBarControl>
<TextBox Grid.Column="1" Name="Statictb" Text="I'm a staticaly created control" />
<Button Grid.Row="1" Content="Create controls" Height="25" Click="Button_Click"/>
</Grid>
</Window>
MainWindow.xaml.cs
using System;
using System.Windows;
using System.Windows.Controls;
namespace UIA.WithNavBarControl
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
TextBox tb = new TextBox();
Grid.SetRow(tb, 1);
Grid.SetColumn(tb, 1);
tb.Text = "I'm dynamically created control";
ContentGrid.Children.Add(tb);
}
}
}
We are working on this issue. Please bear with us.