Say I have a hidden CollectionView, which becomes visible when I click on a button, and I need to set the focus on a CollectionView when it becomes visible (to detect when it is not focused anymore and should be hidden again).
For that I use the SetFocus method when the condition triggering the CollectionView visibility is set to true.
Then I call SetFocus.
-> The issue is that SetFocus returns false, probably because the element has not been rendered yet.
I clearly need to wait for something before the SetFocus call can be honored, the issue is that I have not found anything about that. One workaround would be to use Task.Delay but I was wondering if I missed something ?
Thanks a lot for your input
1