Codebehind FindName not working in ItemsControl?
Posted: 19 Apr 2017, 05:57
As the subject says...
Works just fine if I add the control to a parent xaml as a totally normal control with <myNamespace:ControlName />
But, if I go
then FindName returns null.
Any help would be appreciated. Thanks! This is in Unity 5.5.1f1 32b, and Noesis 2.0
Code: Select all
private void OnInitialized(object sender, EventArgs args)
{
var but = FindName("Buttony");
UnityEngine.Debug.Log("but: " + but.ToString());
}
But, if I go
Code: Select all
<ItemsControl ItemsSource="{Binding Blah}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<myNamespace:ControlName />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
Any help would be appreciated. Thanks! This is in Unity 5.5.1f1 32b, and Noesis 2.0