TreeView. Animate when updating the list #3289
-
Hi! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 15 replies
-
@Frillaut Can you elaborate a bit on which animation you're referring to? The demo app contains an ability to manipulate the contents of a |
Beta Was this translation helpful? Give feedback.
-
@Frillaut I still can't repro the issue with |
Beta Was this translation helpful? Give feedback.
-
@Frillaut I have tried to use your code to create a sample where I can reproduce the issue. Using the code provided, I don't actually see anything other than the root node(s), so I had to make some modifications to make sub-nodes show. And after having done that, I still don't see any animations when dynamically adding items to the collection at runtime. Are you able to share a bit more of your setup? The view model (or code-behind) backing the |
Beta Was this translation helpful? Give feedback.
@Frillaut I had a look at your sample, and I can indeed reproduce the animation that occurs when
IsVirtualizing=True
andVirtualizationMode=Recycling
. Changing toVirtualizationMode=Standard
"fixes" the issue, just like settingIsVirtualizing=False
. However, I assume you would like the settings applied, and avoid the animations.Unfortunately, the MDIX style/template for the
TreeViewItem
explicitly applies these animations using visual states and visual transitions. These do not lend themselves well to extendibility, nor do they allow bindings (so an attached property could be used). So the only real option you're left with, apart from manipulating the visual states in runtime in your cod…