当前位置:网站首页>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边栏推荐
- [micro service SCG] 33 usages of filters
- Monitoring web performance with performance
- Mongodb common commands
- Kbp206-asemi rectifier bridge kbp206
- Dart series: collection of best practices
- 线程基础知识
- 有个疑问 flink sql cdc 的话可以设置并行度么, 并行度大于1会有顺序问题吧?
- Azkaban installation and deployment
- 问下,这个ADB mysql支持sqlserver吗?
- Talk about the SQL server version of DTM sub transaction barrier function
猜你喜欢
Why are there fewer and fewer good products produced by big Internet companies such as Tencent and Alibaba?
Flume配置4——自定义MYSQLSource
College Students' innovation project management system
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
Azkaban actual combat
Jd.com 2: how to prevent oversold in the deduction process of commodity inventory?
Hot knowledge of multithreading (I): introduction to ThreadLocal and underlying principles
Qrcode: generate QR code from text
Leetcode42. connect rainwater
Pat class a 1162 postfix expression
随机推荐
[groovy] groovy environment setup (download groovy | install groovy | configure groovy environment variables)
Flex flexible layout
Monitoring web performance with performance
Why do some programmers change careers before they are 30?
PHP cli getting input from user and then dumping into variable possible?
El tree whether leaf node or not, the drop-down button is permanent
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
this+闭包+作用域 面试题
Machine learning experiment report 1 - linear model, decision tree, neural network part
2021 Li Hongyi machine learning (3): what if neural network training fails
Qrcode: generate QR code from text
問下,這個ADB mysql支持sqlserver嗎?
Design and practice of kubernetes cluster and application monitoring scheme
Mongodb common commands
Basic authorization command for Curl
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?
Difference between MotionEvent. getRawX and MotionEvent. getX
Share the newly released web application development framework based on blazor Technology
Utilisation simple de devtools
Vb+access hotel service management system