- Mastering Windows Presentation Foundation
- Sheridan Yuen
- 227字
- 2021-06-24 16:49:04
Outputting values to UI controls
One of the simplest ways of working out what values our data bound properties have is to just data bind them to other UI controls that have a textual output. For example, if we have a collection of items and we want to do something with the selected item, but whatever that is isn't working, we need to verify that our binding to that selected item is correct.
To visualize the result of the binding, we can simply copy and paste the binding path to the Text property of a TextBox and run the application. If our binding path is correct, we'll see something output in the TextBox and if not, we'll know that the problem that we're having is, in fact, down to the binding path. We can, therefore, use this method to verify that objects that don't normally have a textual output are at least correctly data bound or not.
This simple technique can help in any situation where the faulty data binding is not already rendered in a text-based UI control. For example, we might need to debug a data bound value because a particular visual effect that is created with a DataTrigger instance is not working and we need to determine whether the problem is related to the UI control or the data binding path.
- 深度實踐OpenStack:基于Python的OpenStack組件開發
- Neo4j Essentials
- Linux Device Drivers Development
- Advanced Oracle PL/SQL Developer's Guide(Second Edition)
- SQL Server與JSP動態網站開發
- Android項目實戰:手機安全衛士開發案例解析
- IoT Projects with Bluetooth Low Energy
- WildFly Cookbook
- Android 游戲開發大全(第二版)
- SQL Server 2008實用教程(第3版)
- Getting Started with JUCE
- Kotlin程序員面試算法寶典
- C語言程序設計實驗指導教程
- Hadoop MapReduce v2 Cookbook(Second Edition)
- Python High Performance(Second Edition)