是否可以使用通配符在XAML(Silverlight)中找到控件?
Ex ..在我的XAML中
<TextBlock Text="Title" Grid.Row="0" Grid.Column="0" Style="{StaticResource txtBlock}" />
<TextBox x:Name="uxTitle" Grid.Row="0" Grid.Column="1" IsReadOnly="{StaticResource IsControlReadOnly}"
Text="{Binding Title, Mode=TwoWay}" Style="{StaticResource txtBox}" Width="100"/>
<TextBlock Text="Firstname" Grid.Row="1" Grid.Column="0" Style="{StaticResource txtBlock}" />
<TextBox x:Name="uxFirstName" Grid.Row="1" Grid.Column="1"
Text="{Binding FirstName, Mode=TwoWay}" Style="{StaticResource txtBox}" Width="250"/>
<TextBlock Text="Middlename" Grid.Row="2" Grid.Column="0" Style="{StaticResource txtBlock}" />
<TextBox x:Name="uxMiddleName" Grid.Row="2" Grid.Column="1"
Text="{Binding MiddleName, Mode=TwoWay}" Style="{StaticResource txtBox}" Width="250"/>
在Codebehind中
public void searchControl()
{
this.LayoutRoot.FindName("ux*");
// Or like this way
this.LayoutRoot.FindName("ux???");
}