- aliagha.huseynli
- Posts: 44
- Joined:
view.Content.FindName performance impact
Hi Noesis Team,
I use a lot from FindName to get any element in XAML.
If I use over 50 or more of this code will I face any performance issues in my Unity project?
I use a lot from FindName to get any element in XAML.
If I use over 50 or more of this code will I face any performance issues in my Unity project?
Code: Select all
private TextBlock TextBlock1;
void Start
{
NoesisView view = GetComponent<NoesisView> ();
view.Content.DataContext = this;
TextBlock1 = view.Content.FindName (nameof (TextBlock1)) as TextBlock;
}
-
sfernandez
Site Admin
- Posts: 3008
- Joined:
Re: view.Content.FindName performance impact
Calling FindName on the the View.Content will be a pretty fast operation because the lookups are done on a map that is stored in the Content element. So you shouldn't have any performance issues because of this.
Have you found any trouble with it?
Have you found any trouble with it?
Re: view.Content.FindName performance impact
Just a note for future readers, although FindName is a fast operation, we don't recommend doing it per frame.
- aliagha.huseynli
- Posts: 44
- Joined:
Re: view.Content.FindName performance impact
No, I didn't find any problem with it. I just want to make sure about it. Thanks a lot :)
Who is online
Users browsing this forum: Ahrefs [Bot] and 6 guests