I am trying to locate a label by its tag so i can add an additional label beside when a certain condition is met.
in old school winform i would just use:
Label sublabel = Controls.Find(Sub.id, true).FirstOrDefault() as Label;
snippet of the view.xaml:
<Grid>
<Label
Content = "{Binding Path = NodeName, Mode = OneWay}"
Background = "{Binding Path = NodeStatus, Mode = OneWay}"
Tag="{Binding Path = Nodeid, Mode = OneWay}"
i have tried something along these lines:
var label = Grid.Children.OfType<Label>()
.First(i => i.Tag == "tagid");
but generates
An object reference is required for the non-static field, method, or property 'Panel.Children'
Thanks for looking