当前位置:网站首页>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边栏推荐
- 【做题打卡】集成每日5题分享(第三期)
- Pat class a 1162 postfix expression
- [Chongqing Guangdong education] 2777t green space planning reference questions of National Open University in autumn 2018
- [105] Baidu brain map - Online mind mapping tool
- PHP cli getting input from user and then dumping into variable possible?
- Single box check box
- SPI and IIC communication protocol
- Learning notes of raspberry pie 4B - IO communication (I2C)
- Jd.com 2: how to prevent oversold in the deduction process of commodity inventory?
- Talk about the SQL server version of DTM sub transaction barrier function
猜你喜欢
Learning notes of raspberry pie 4B - IO communication (I2C)
El select, El option drop-down selection box
Acwing game 58 [End]
Blue Bridge Cup single chip microcomputer -- PWM pulse width modulation
Subversive cognition: what does SRE do?
Sqoop installation
Azkaban overview
Linux Installation redis
Hot knowledge of multithreading (I): introduction to ThreadLocal and underlying principles
Flume配置4——自定义MYSQLSource
随机推荐
端口,域名,协议。
Azkaban概述
Pytest (4) - test case execution sequence
Azkaban actual combat
Solve the problem that sqlyog does not have a schema Designer
Blue Bridge Cup single chip microcomputer -- PWM pulse width modulation
Delphi read / write JSON format
Kubernetes -- cluster expansion principle
There is a question about whether the parallelism can be set for Flink SQL CDC. If the parallelism is greater than 1, will there be a sequence problem?
Anchor free series network yolox source code line by line explanation four (a total of ten, ensure line by line explanation, after reading, you can change the network at will, not just as a participan
Cette ADB MySQL prend - elle en charge SQL Server?
Flex flexible layout
Multi person online anonymous chat room / private chat room source code / support the creation of multiple chat rooms at the same time
[luat-air105] 4.1 file system FS
Share the newly released web application development framework based on blazor Technology
Devtools的簡單使用
Difference between MotionEvent. getRawX and MotionEvent. getX
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
有個疑問 flink sql cdc 的話可以設置並行度麼, 並行度大於1會有順序問題吧?
Easy processing of ten-year futures and stock market data -- Application of tdengine in Tongxinyuan fund