How is it possible to set the focus (from c#-code behind or xaml itself) to the last item of my DataTemplate?
That is my XAML code:
<ItemsControl x:Name="ListViewItems">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Margin="1 10 0 10"
Height="60">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBox Grid.Column="0"
x:Name="SsidTextBox"
Text="{Binding Ssid, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" >
</TextBox>
<TextBox Grid.Column="1"
x:Name="PasswordTextBox"
Text="{Binding Password, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}">
</TextBox>
</Grid>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
By the way: A new item is generated when I click on a button.
Thanks!