How to view all Visual Tree UI elements of any UI controls, Which is using styles & templates on windows 11 OS environment using VisualUIAVerifyNative tool?
Kavitha T
0
Reputation points
VisualUIAVerifyNative is not displaying few UI elements
If TextBox uses style, which has TextBlock as PlaceholderText, then the placeholder textblock UI element is not getting displayed in VisualUIAVerifyNative on windows 11 machine
<Style x:Key="SearchTextBoxStyle" TargetType="controls:SearchTextBox">
<Setter Property="Margin" Value="16,12,16,12" />
<Setter Property="BorderBrush" Value="{ThemeResource TextControlBorderBrush}" />
<Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}" />
<Setter Property="ContextFlyout" Value="{StaticResource TextControlCommandBarContextFlyout}" />
<Setter Property="MaxLength" Value="{StaticResource SearchTextInputMaxLength}" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto" />
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto" />
<Setter Property="SelectionFlyout" Value="{StaticResource TextControlCommandBarSelectionFlyout}" />
<Setter Property="SelectionHighlightColor" Value="{ThemeResource TextControlSelectionHighlightColor}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:SearchTextBox">
.
.
.
<TextBlock x:Name="PlaceholderTextContentPresenter" Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2"
Margin="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"
VerticalAlignment="Center"
Foreground="{Binding PlaceholderForeground, RelativeSource={RelativeSource Mode=TemplatedParent}, TargetNullValue={ThemeResource TextControlPlaceholderForeground}}"
IsHitTestVisible="False" Text="test Placeholder"
TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}" />
In above TextBox style, the UI element 'PlaceholderTextContentPresenter' textblock is not getting displayed in VisualUIAVerifyNative tool in windows 11 OS machine. However, it is getting displayed on windows 10 machine.
What would be the reason for not displaying few UI elements in VisualUIAVerifyNative tool?
Sign in to answer