62
thinking in wpf ivan towlson mindscape

Thinking in wpf ivan towlson mindscape. model is everything

Embed Size (px)

Citation preview

thinking in wpf

ivan towlsonmindscape

model is everything

DateTime LastActive

string UserName

bool IsModerator

model

DateTime LastActive

string UserName

bool IsModerator

model

presenter

viewview interface

don’t repeat yourself

DateTime LastActive

string UserName

bool IsModerator

model

view

if i can’t data bind to it,it’s not my framework

with apologies to emma goldman

what is the work oflist boxes

in this framework?

with apologies to joel spolsky

what is the work ofcheck boxes

in this framework?

with apologies to joel spolsky

what is the work ofbuttons

in this framework?

with apologies to joel spolsky

what is the work ofcontrols

in this framework?

with apologies to joel spolsky

Behaviour

Behaviour

Content

Behaviour

Layout

Content

Stacked

Positioned

Tabular

None Selectablelist

Selectablelist

Text

Images

Composite with trigger

Selectablelist

Positioned

Images

today we would prefer not to havenaming of parts

about that of whichone cannot speak,one must be silent

with apologies to ludwig wittgenstein

how will clicky-ba know them?

with apologies to steve bell and the wolf of kabul

you can’t use an event there

you do not need a new control

except for a property grid, a tree list view and 11 others– you need those

timer is not missing

you can still sort list boxes

this is your brain on xaml

with apologies to talking heads

what is the value of adependency property?

it depends...

onthe default value

onthe value inherited from a parent

onthe value specified in a style

onthe value specified in a trigger

onthe value you put in there

onthe value of a data binding

onwhether the property is animated

onwhether the property is coerced

it depends

why is this text green?

and is this text green for the same reason?

why is this text green?

and is this text green for the same reason?

<TextBlock Foreground="{StaticResource QueryText}">

</TextBlock>

<TextBlock Foreground="{Binding IsInCredit, Converter=...}">

</TextBlock>

how did i get here?

<DockPanel>

</DockPanel>

<TextBlock DockPanel.Dock="Bottom">how did i get here?

where did this content come from?

where did this content come from?

QuoteAlbumTitle

<local:MisquotationConverter />

cupboards, not storyboards

building blocks

extensibility is like elvis:everywhere

accessing a property from codeis an admission of defeat

accessing a control from codeis an admission of defeat

string UserName

model

viewtextBox1.Text = member.UserName;

member.UserName = textBox1.Text;

textBox1.TextChanged += UpdateUserName;

string UserName

model

viewtextBox1.Text = member.UserName;

member.UserName = textBox1.Text;

textBox1.TextChanged += UpdateUserName;

code smellalert!

string UserName

model

view

DateTime LastActive

string UserName

bool IsModerator

model

view

building blocks

ConvertersSelectorsTriggersLookless

controls

StylesTemplatesBindings

Events / comman

ds

the littlest birdssing the prettiest songs

with apologies to the be good tanyas

thanks

[email protected]

[email protected]/flatlander