当前位置:网站首页>How to make the listbox scroll automatically when adding a new item- How can I have a ListBox auto-scroll when a new item is added?
How to make the listbox scroll automatically when adding a new item- How can I have a ListBox auto-scroll when a new item is added?
2022-07-05 03:30:00 【Bustling city 】
problem :
I have a WPF ListBox that is set to scroll horizontally. I have one set to scroll horizontally WPF ListBox.The ItemsSource is bound to an ObservableCollection in my ViewModel class.ItemsSource Bound to my ViewModel Class ObservableCollection.Every time a new item is added, I want the ListBox to scroll to the right so that the new item is viewable. Every time you add a new item , I hope ListBox Scroll right , So that you can view new projects .
The ListBox is defined in a DataTemplate, so I am unable to access the ListBox by name in my code behind file.ListBox Is in DataTemplate As defined in , So I can't access by name in my code behind file ListBox.
How can I get a ListBox to always scroll to show a latest added item? How to make ListBox Always scroll to show newly added items ?
I would like a way to know when the ListBox has a new item added to it, but I do not see an event that does this. I want a way to know ListBox When a new item was added , But I don't see the event of this operation .
Solution :
Reference resources : https://stackoom.com/en/question/8Q2b边栏推荐
- Watch the online press conference of tdengine community heroes and listen to TD hero talk about the legend of developers
- Subversive cognition: what does SRE do?
- Sqoop命令
- Unity implements the code of the attacked white flash (including shader)
- 问下,这个ADB mysql支持sqlserver吗?
- Accuracy problem and solution of BigDecimal
- [micro service SCG] 33 usages of filters
- Devtools的简单使用
- SQL performance optimization skills
- El tree whether leaf node or not, the drop-down button is permanent
猜你喜欢

Linux Installation redis

Machine learning experiment report 1 - linear model, decision tree, neural network part

线程基础知识

The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety

Asp+access campus network goods trading platform

SQL performance optimization skills
![[groovy] string (string injection function | asBoolean | execute | minus)](/img/ea/bf1e6aa713cf54e29653e35b164560.jpg)
[groovy] string (string injection function | asBoolean | execute | minus)

VM in-depth learning (XXV) -class file overview

Share the newly released web application development framework based on blazor Technology

The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
随机推荐
Talk about the SQL server version of DTM sub transaction barrier function
为什么腾讯阿里等互联网大厂诞生的好产品越来越少?
Binary heap implementation (priority queue implementation)
PHP cli getting input from user and then dumping into variable possible?
Pat class a 1160 forever (class B 1104 forever)
How can we truncate the float64 type to a specific precision- How can we truncate float64 type to a particular precision?
Azkaban实战
NPM introduction link symbolic link
Azkaban installation and deployment
SQL performance optimization skills
Anchor free series network yolox source code line by line explanation Part 2 (a total of 10, ensure to explain line by line, after reading, you can change the network at will, not just as a participan
The latest blind box mall, which has been repaired very popular these days, has complete open source operation source code
[deep learning] deep learning reference materials
看 TDengine 社区英雄线上发布会,听 TD Hero 聊开发者传奇故事
LeetCode 234. Palindrome linked list
Asemi rectifier bridge 2w10 parameters, 2w10 specifications, 2w10 characteristics
Talk about the SQL server version of DTM sub transaction barrier function
Design and practice of kubernetes cluster and application monitoring scheme
Ask, does this ADB MySQL support sqlserver?
Use of kubesphere configuration set (configmap)