Thank you. My Problem Solved with using simple Try Catch code for reset the Index of Array;
But now I have another Problem. I Want move between Item of TreeView With keyboard and Button i Define, But i Do not know how to change the Item with Behind Code.
for Solve This i Create Temp integer for get the index of item selected and move in array,But in this way the item Selected in treeview not Change in Correct way.
I want use this code for change the video in media element and from the list of treeview.
I try This code, But i know this is not the Correct way. please help me.
private int TVI = 0;
` private void ForwardBT_Click(object sender, RoutedEventArgs e)
{
try
{
mediaPlayer.Source = new Uri(paths[TVI]);
}
catch
{
try
{ TVI = 0; mediaPlayer.Source = new Uri(paths[TVI]); }
catch { }
}
}
I want use the below Code But I Don't now how to change Item Select with Button or Keyboard.
mediaPlayer.Source = new Uri(paths[TreeView.Items.IndexOf(TreeView.SelectedItem)]);