-
- vaninadisc
- Posts: 10
- Joined:
Codebehind FindName not working in ItemsControl?
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
-
- vaninadisc
- Posts: 10
- Joined:
Re: Codebehind FindName not working in ItemsControl?
Ah, oops. Just realized it's the same bug as my other post (viewtopic.php?f=3&t=1064), I guess it applies to both ItemsPanelTemplates and DataTemplates. I put them in a <Border> and it fixed it like last time.
Nevermind!
Nevermind!
-
-
sfernandez
Site Admin
- Posts: 3250
- Joined:
Re: Codebehind FindName not working in ItemsControl?
Yes, it the same scenario.
It will be fixed in the next release.
It will be fixed in the next release.
Who is online
Users browsing this forum: No registered users and 6 guests