Replies: 2 comments
-
I think, the controls have a method called Update. |
Beta Was this translation helpful? Give feedback.
0 replies
-
There are some ways you can achieve this. The easiest way would be to call |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to progammly select a new created item in treeview, however, the TreeViewItem/TreeViewNode of that item will not been built till the GUI update, also will not been built till the rootnode expand (if the rootnode is in collapsed state, but itemsource change).
The tree structure is:
rootnode
--node1
----subnode1
----subnode2
--node2
If I do something like that
Line3 and line4 are all useless, for after the
treeview.Expand(rootnode);
, node1.Children.Count=0, Sotreeview.Expand(node)
will do nothing andtreeview.ContainerfromItem(subnode1item)
ortreeview.NodefromContainer(...)
will all return null.So I wonder if I can do something like that
I try lots of things like use
await Task.Run(async () => { await Task.Delay(10000); });
, but it is hard to control the delay time and also it will not gurantee the GUI finish update during the delay time.So I wonder is there anyway to force updating GUI during the code excute in UI thread?
Or Is there anyway to force treeview refresh to build all its new chilnodes?
Thank you very much if you have any idea
Beta Was this translation helpful? Give feedback.
All reactions