Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use data binding designer in Visual Studio

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly shows you how to use the data binding designer in Visual Studio. The content is simple and easy to understand. It is clearly organized. I hope it can help you solve your doubts. Let Xiaobian lead you to study and learn how to use the data binding designer in Visual Studio.

Bindings can be implemented by writing C#code or XAML code directly, or, in fact, with the help of the data binding designer provided by Visual Studio.

1. Binding to UI elements

Methods:

Click the small icon to the right of the property name in the Properties pane--->Apply Data Binding

As shown in the figure:

Drag and drop a Slider1 control and a TextBox1 control

(2) Select ElementName-> slider1 in the Source column of the Binding Designer.

(3) Select Value in Path column

(4) In the Options column, confirm that Mode is TwoWay.

At this point, the code in XAML becomes:

2. Binding to static resource objects

A static resource object is an object defined declaratively in XAML.

Defining objects as static resource forms is equivalent to defining them in C#code.

(1) Employee class as the basic data structure

(2) Add a namespace mapping to the phone: PhoneApplicationPage tag of the new page, mapping the current project namespace PhonApp1 to local.

Attached Code:

xmlns:local="clr-namespace:PhoneApp1"

(3) Add a page-level resource definition under the phone:PhoneApplicationPage tag,

(4)

(5)

(6) Additional codes:

In fact, silverlight also provides a mechanism similar to creating objects in XAML and using them for binding.

You can save objects in a separate design-time data file.

The above is "Visual Studio data binding designer how to use" all the content of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report