what exactly below code do
-
foreach (TabItem ti in MainWindow.mw.tcMain.Items)
{
if (Convert.ToInt16(ti.Tag) == r.id)
{
MainWindow.mw.tcMain.SelectedItem = ti;
return;
}
}Who write this code ask to him... :-)
-
foreach (TabItem ti in MainWindow.mw.tcMain.Items)
{
if (Convert.ToInt16(ti.Tag) == r.id)
{
MainWindow.mw.tcMain.SelectedItem = ti;
return;
}
}Finds an item in the tab control with a matching ID value, and sets it as the selected tab item. It relies on you having set the appropriate ID value into the Tag property of each TabItem when you created it, however. And in future, please ask WPF queries in the WPF forum: http://www.codeproject.com/Forums/1004257/Silverlight-WPF.aspx[^]
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952) Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
-
foreach (TabItem ti in MainWindow.mw.tcMain.Items)
{
if (Convert.ToInt16(ti.Tag) == r.id)
{
MainWindow.mw.tcMain.SelectedItem = ti;
return;
}
}