Vlasta Juračka

Vlasta Juračka

  • NA
  • 54
  • 629

WPF get children from layout by name

Sep 12 2017 8:48 PM
Hi guys i have really special problem.... I need return child from layout by name... But method findName works only on XAML. But i create layout with label programmatically and i neeed search Label by name from layout. Thanks for some help.
Grid g = (Grid) tasks.SelectedItem;
Label b = (Label)g.FindName("idLabel");
Console.WriteLine(b.Content); //b is null
 
And guys i havent variable i know only name..

Answers (2)