web-dev-qa-db-fra.com

Que signifie «{Binding Path =.}» Dans la liaison WPF?

Qu'est-ce que {Binding Path=.} signifie dans une liaison WPF?

Je vois que certaines personnes l'utilisent, mais je n'ai trouvé aucune explication.

Existe-t-il d'autres symboles spéciaux dans la syntaxe de liaison (autres que {Binding /})?

76
Sergey Aldoukhov

Il s'agit d'un raccourci pour la liaison à la source actuelle. Pour plus d'informations, voir ici .

51
micahtan

J'ai trouvé cela WPF Binding CheatSheet il y a quelques mois et je l'ai trouvé très utile, surtout pour ceux qui apprennent WPF. Il contient quelques fautes d'orthographe, mais c'est quand même assez bon.

Voici un petit extrait (qui est censé avoir une mise en forme tabulaire):

Basic Binding   
{Binding}  Bind to current DataContext. 
{Binding Name}  Bind to the “Name” proeprty of the current DataContext. 
{Bindind Name.Length}  Bind to the Length property of the object in the Name property of the current DataContext. 
{Binding ElementName=SomeTextBox, Path=Text}  Bind to the “Text” property of the element XAML element with name=”SomeTextBox” or x:Name=”SomeTextBox”. 

Lien direct vers CheatSheet

58
Ryan Versaw