Home Database Mysql Tutorial WPF 中Binding的2个属性Source与ElementName的区别

WPF 中Binding的2个属性Source与ElementName的区别

Jun 07, 2016 pm 03:44 PM
source wpf Attributes

http://www.im47.cn/?p=482 ElementName The ElementName property is used to reference an object by the name of the object. This is particularly useful in XAML, where you can directly reference other elements defined in XAML. 举例 StackPanel

http://www.im47.cn/?p=482

ElementName
The ElementName property is used to reference an object by the name of the object. This is particularly useful in XAML, where you can directly reference other elements defined in XAML.

举例


Source
The Source property is used to specify an object reference on which the binding Path or XPath will be evaluated. The Source property is usually used when the object on which the Binding is set is known and differs from the DataContext.

举例:

 

简单地说,“ElementName”用于绑定到xaml界面设计中添加的其它控件对象,“Source”用于绑到资源中的对象。

 

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Analysis of how to use Source Insight in Ubuntu system Analysis of how to use Source Insight in Ubuntu system Jan 08, 2024 pm 11:49 PM

I believe that many friends are accustomed to using SourceInsight to read and analyze source code under Windows. There are indeed more efficient tools under LINUX, but it is troublesome and cumbersome to configure them. I believe many people definitely hope to be able to use them under Linux. SourceInsight can be used. The following editor will give you a detailed explanation of the use of SourceInsight in Ubuntu! Let’s go and see it together! This is my system information: Linuxgavin-laptop2.6.32-40-generic#87-UbuntuSMPTueMar600:56:56UTC2012x86_64GNU/Li

What button is source? What button is source? Oct 10, 2023 pm 03:26 PM

Source is the button to switch the input signal source or select a different input source. Typically found on televisions, projectors, sound systems, computer monitors, and other equipment. On the TV, the source button allows users to switch between different input sources to play different content on the TV. On a projector, the source button has a similar function and can connect different devices to the projector. On the audio system, the source button is used to switch between different audio input sources. On computer monitors, the source button functions similarly to TVs and projectors, etc.

How to get integer literal properties in Python without SyntaxError? How to get integer literal properties in Python without SyntaxError? Aug 20, 2023 pm 07:13 PM

TogetintliteralattributeinsteadofSyntaxError,useaspaceorparenthesis.TheintliteralisapartifNumericLiteralsinPython.NumericLiteralsalsoincludesthefollowingfourdifferentnumericaltypes−int(signedintegers)−Theyareoftencalledjustintegersorints,arepositiveo

Python's dir() function: View the properties and methods of an object Python's dir() function: View the properties and methods of an object Nov 18, 2023 pm 01:45 PM

Python's dir() function: View an object's properties and methods, specific code example required Summary: Python is a powerful and flexible programming language, and its built-in functions and tools provide developers with many convenient features. One of the very useful functions is the dir() function, which allows us to view the properties and methods of an object. This article will introduce the usage of the dir() function and demonstrate its functions and uses through specific code examples. Text: Python’s dir() function is a built-in function.

WPF tutorial from entry to proficiency WPF tutorial from entry to proficiency Oct 27, 2023 am 09:45 AM

WPF is a desktop application development framework based on the .NET Framework developed by Microsoft. It provides rich user interface elements, data binding, animation and other functions, allowing developers to easily create high-quality desktop applications.

How to rename properties of JSON using Gson in Java? How to rename properties of JSON using Gson in Java? Aug 27, 2023 pm 02:01 PM

The Gson@SerializedName annotation can be serialized to JSON and have the provided name value as its field name. This annotation can override any FieldNamingPolicy, including the default field naming policy that may have been set on the Gson instance. Different naming strategies can be set using the GsonBuilder class. Syntax@Retention(value=RUNTIME)@Target(value={FIELD,METHOD})public@interfaceSerializedNameExample importcom.google.gson.annotations.*;

What to do if Win11 disk properties are unknown What to do if Win11 disk properties are unknown Jul 03, 2023 pm 04:17 PM

What should I do if the disk properties of Win11 are unknown? Recently, Win11 users found that the system prompted a disk error when using their computers. What is going on? And how to solve it? Many friends don’t know how to operate in detail. The editor has compiled the steps to solve the Win11 disk error below. If you are interested, follow the editor to read below! Steps to solve Win11 disk error 1. First, press the Win+E key combination on the keyboard, or click the File Explorer on the taskbar; 2. In the right sidebar of the File Explorer, find the side and right-click the local disk (C :), in the menu item that opens, select Properties; 3. Local disk (C:) Properties window, switch to Tools

Methods and examples of dynamically adding attributes using the Vue.set function Methods and examples of dynamically adding attributes using the Vue.set function Jul 24, 2023 pm 07:22 PM

Methods and examples of using the Vue.set function to dynamically add properties. In Vue, if we want to dynamically add a property to an existing object, we usually use the Vue.set function. The Vue.set function is a global method provided by Vue.js, which can ensure responsive updates when adding properties. This article will introduce the use of Vue.set and provide a specific example. First of all, in Vue, we usually use the data option to declare responsive data.

See all articles