Archive for the ‘XAML’ Category

WPF XAML Status Display - Push vs Pull

Wednesday, April 23rd, 2008

OLD WAY - PUSH

Coder directly touches the ui element requiring intimate immediate knowlege of the ui that must preexist before coding.

txtStatus.Text = “Foo Bar”

NEW WAY - PULL

Coder make the status available through a public property that is set thusly before ui is created.

Status = “Foo Bar”

Designer binds to the programmers object pulling the data into the ui

<TextBlock Text=”{Binding Status}” />

Note: The text block does not have or need a Control Name as it is never referenced by the code.

Having names on your TextBlocks may be an indication that you are not yet really operating in the XAML WPF pardigm.