Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

22. WPF Binding > Review

Review

image

Declare a Label element that binds its Content to the Text of a TextBox named ContentSource.

Declare a Label that binds its Content to the Name property of the Window's DataContext.

When would it be appropriate to use a OneWay binding?

We’ve seen that in order to support two-way binding, a collection has to implement some form of change notification. Can you bind to an instance of the Array class?

Why would you want to set UpdateSourceTrigger to Explicit?

Declare a TextBlock (just for a change) that binds its Text property to the FontSize of itself.


Under the Microscope

image

Every control type has a default value for UpdateSourceTrigger and BindingMode, but it’s best practice to specify both explicitly, if for no other reason than it saves remembering what the defaults are.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


 Â