当前位置:网站首页>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边栏推荐
- 腾讯云,实现图片上传
- 1. Five layer network model
- SFTP cannot connect to the server # yyds dry goods inventory #
- Azkaban actual combat
- [groovy] string (string type variable definition | character type variable definition)
- 問下,這個ADB mysql支持sqlserver嗎?
- Kubernetes - identity and authority authentication
- Why is this an undefined behavior- Why is this an undefined behavior?
- Multi person online anonymous chat room / private chat room source code / support the creation of multiple chat rooms at the same time
- [groovy] loop control (number injection function implements loop | times function | upto function | downto function | step function | closure can be written outside as the final parameter)
猜你喜欢
IPv6 experiment
SQL performance optimization skills
2021 Li Hongyi machine learning (1): basic concepts
The latest blind box mall, which has been repaired very popular these days, has complete open source operation source code
Flume configuration 4 - customize mysqlsource
Azkaban actual combat
Talk about the SQL server version of DTM sub transaction barrier function
腾讯云,实现图片上传
Voice chip wt2003h4 B008 single chip to realize the quick design of intelligent doorbell scheme
Leetcode42. connect rainwater
随机推荐
Design and practice of kubernetes cluster and application monitoring scheme
[micro service SCG] 33 usages of filters
Yyds dry goods inventory intelligent fan based on CC2530 design
MySQL winter vacation self-study 2022 11 (9)
Delphi free memory
Tiny series rendering tutorial
When sqlacodegen generates a model, how to solve the problem that the password contains special characters?
Single box check box
Azkaban安装部署
How can we truncate the float64 type to a specific precision- How can we truncate float64 type to a particular precision?
PHP cli getting input from user and then dumping into variable possible?
glibc strlen 实现方式分析
this+闭包+作用域 面试题
College Students' innovation project management system
端口,域名,协议。
Pat class a 1160 forever (class B 1104 forever)
Basic knowledge of tuples
Easy processing of ten-year futures and stock market data -- Application of tdengine in Tongxinyuan fund
Devtools的簡單使用
El select, El option drop-down selection box