RE: [WPF Disciples] Hey Mike

174 views
Skip to first unread message

Peter O'Hanlon

unread,
Jul 11, 2012, 3:03:11 AM7/11/12
to wpf-di...@googlegroups.com
I'm really looking forward to reading it. I suspect that you will get a lot of orders here.




From: Michael Brown
Sent: 10/07/2012 22:06
To: wpf-di...@googlegroups.com
Subject: RE: [WPF Disciples] Hey Mike

We're aiming for November (shortly after Windows 8 Launch). Life has gotten in the way of getting this done. The book is listed on Amazon already under MVVM Unleashed.


From: wpf-di...@googlegroups.com [wpf-di...@googlegroups.com] on behalf of Brian Noyes [brian...@softinsight.com]
Sent: Tuesday, July 10, 2012 1:05 PM
To: wpf-di...@googlegroups.com
Subject: Re: [WPF Disciples] Hey Mike

Good question! And any kind of link I can point to? Giving an MVVM fundamentals talk at VSLive! in August.

On Tue, Jul 10, 2012 at 12:58 PM, Peter O'Hanlon <pete.o...@gmail.com> wrote:
When's the MVVM book coming out? Looking forward to it mate.

--
Peter O'Hanlon



--
-----------------------------------------
Brian Noyes
Chief Architect, IDesign Inc
Microsoft Regional Director / MVP
http://www.idesign.net
+1 703-447-3712
-----------------------------------------

Sacha Barber

unread,
Jul 11, 2012, 5:57:07 AM7/11/12
to wpf-di...@googlegroups.com
What I'm expecting a copy for free. Hell yeah.

Nah only joking, I'll be buying it, slightly daunted by 500 pages though.
--
Sacha Barber
sacha....@gmail.com

Colin E.

unread,
Jul 11, 2012, 6:21:09 AM7/11/12
to wpf-di...@googlegroups.com
500 pages for an MVVM book - wowzers!

I hope it has a *lot* of pictures ;-)

Anyhow, good luck with that one. From my activities on StackOverflow I
can see that there are a great many people in need of guidance in this
area.
--
Regards,
Colin E.

Michael Brown

unread,
Jul 11, 2012, 8:37:58 AM7/11/12
to wpf-di...@googlegroups.com
I'm cheating a bit and going beyond just MVVM...discussing how other patterns supplement it...have some chapters dedicated to multi-target development using MonoTouch/Mono for Android, Windows Phone, WPF, Silverlight, WinRT, and Knockout/Kendo (which can also be used to target WinRT).

It's been quite a journey of discovery for me.
________________________________________
From: wpf-di...@googlegroups.com [wpf-di...@googlegroups.com] on behalf of Colin E. [colin.e...@gmail.com]
Sent: Wednesday, July 11, 2012 6:21 AM

Sacha Barber

unread,
Jul 11, 2012, 8:55:13 AM7/11/12
to wpf-di...@googlegroups.com
Yeah I have been doing stuff with Knockout and its lovely bindings and extenders
--
Sacha Barber
sacha....@gmail.com

Colin E.

unread,
Jul 11, 2012, 9:35:04 AM7/11/12
to wpf-di...@googlegroups.com
I'll second that, Knockout is a very elegant UI framework. I
especially like the $parent and $root pseudo-variables which allow you
to navigate up your view model structure without making all your
relationships bi-direction, or resorting to some nasty FindAncestor
bindings.
--
Regards,
Colin E.

Sacha Barber

unread,
Jul 11, 2012, 9:45:58 AM7/11/12
to wpf-di...@googlegroups.com
The more I use it the more similarities I see with XAML bindings, and MVVM sure is useful even in the web.

On Wed, Jul 11, 2012 at 2:35 PM, Colin E. <colin.e...@gmail.com> wrote:
$parent



--
Sacha Barber
sacha....@gmail.com

Colin E.

unread,
Jul 11, 2012, 10:22:07 AM7/11/12
to wpf-di...@googlegroups.com
It is very similar, it certainly makes learning Knockout much easier
than AngularJS for example. I guess you saw the codeproject article I
wrote that compares Silverlight and Knockout a while back?

http://www.codeproject.com/Articles/365120/KnockoutJS-vs-Silverlight

I haven't used Knockout in anger yet though. I do wonder how well it
would scale? whether it would start to struggle with really complex
business logic and large volumes of data.
--
Regards,
Colin E.

Daniel Vaughan

unread,
Jul 11, 2012, 10:33:51 AM7/11/12
to wpf-di...@googlegroups.com
I've been using Knockout with Script# for a little while, building a single page application. Nearly all of my application logic is in C#, which has allowed me to reuse a lot of my previously thought out approaches to validation and so forth. I complement that with smatterings of js in the form of binding handlers and so forth. I'm really pleased with this approach so far.

One thing that stood out for me when I began using Knockout is that its take on data-binding is markedly different to INPC. Notification happens at the field level and not at object level. It's an approach that allows you to create composite bindings more easily, and gives it a magical feel (in a good way). 

Cheers,
Daniel 
--
 

Colin E.

unread,
Jul 11, 2012, 10:50:24 AM7/11/12
to wpf-di...@googlegroups.com
That sounds very interesting Daniel, do you think you will be sharing
it at some point?

I currently use GWT as my JavaScript-avoidance method of choice.
Although, it irks me to have to write code in Java (it's like stepping
back ten years in time).

Also GWT does have a bucket load of enterprise features such as i18n,
code-splitting, sprites, etc ... , which I doubt Script# will ever
have judging by its momentum.

Knockout's field level notifications and computed observables are very
enjoyable to use. Especially when you compare it to people attempts to
add computed properties to C# / INPC code. However, I still get caught
out by the need to *invoke* observables far too often.

Will we ever see a day when JavaScript gets proper tool support! ;-)
--
Regards,
Colin E.

Sacha Barber

unread,
Jul 11, 2012, 11:06:02 AM7/11/12
to wpf-di...@googlegroups.com
Yeah it was great article.
--
Sacha Barber
sacha....@gmail.com

Sacha Barber

unread,
Jul 11, 2012, 11:08:56 AM7/11/12
to wpf-di...@googlegroups.com
Daniel

Knockout is that its take on data-binding is markedly different to INPC. Notification happens at the field level and not at object level 

I think its quite similar actually. INPC is really at property level isn't it, you typically notify a single property changed using INPC, ok knockout has computed observables but that is just the same as having some other property in your object that you raise property changed using INPC for when a property it depends on changes. Perhaps I am missing your point, but I felt it a pretty easy transition.


Colin

We are doing some pretty hairy financial stuff (loads of logic) and it has held up quite well.




On Wed, Jul 11, 2012 at 3:33 PM, Daniel Vaughan <dbva...@gmail.com> wrote:



--
Sacha Barber
sacha....@gmail.com

Daniel Vaughan

unread,
Jul 11, 2012, 11:18:19 AM7/11/12
to XAML Disciples
If you're willing to limit yourself to C# 3.0 language features (and
no generics support yet), then you may want to give Script# a look. I
considered the other main commercial C# to JS compiler (I forget its
name) but decided to go with Script#. I wasn't really interested in
interacting with the DOM via Script#. If I need to do that then I use
JS. My intent was to write my business logic in C# and have Knockout
glue it all together, and it works nicely.
I would really like to see Microsoft mainstream Script#.

I have started work on an article, though it may take me a while to
get it out there.
> > On Wed, Jul 11, 2012 at 3:45 PM, Sacha Barber <sacha.bar...@gmail.com>
> > wrote:
>
> >> The more I use it the more similarities I see with XAML bindings, and MVVM
> >> sure is useful even in the web.
>
> >> On Wed, Jul 11, 2012 at 2:35 PM, Colin E. <colin.eberha...@gmail.com>
> >> wrote:
>
> >>> $parent
>
> >> --
> >> Sacha Barber
> >> sacha.bar...@gmail.com

Daniel Vaughan

unread,
Jul 11, 2012, 11:28:50 AM7/11/12
to XAML Disciples
Sacha, INPC is raised at the property owner level, whereas Knockout
observable fields perform change notification themselves. It's just
more fine grained. This would be near on impossible to achieve with
the current INPC binding implementation of WPF/Silverlight which
listens for property changes at the owner object level. The way I see
it is that Knockout observables are more akin to dependency properties
in this respect, yet more flexible in the way they can be combined.


On Jul 11, 5:08 pm, Sacha Barber <sacha.bar...@gmail.com> wrote:
> *Daniel*
> *
>
> Knockout is that its take on data-binding is markedly different to INPC.
> Notification happens at the field level and not at object level *
> *
> *
> I think its quite similar actually. INPC is really at property level isn't
> it, you typically notify a single property changed using INPC, ok knockout
> has computed observables but that is just the same as having some other
> property in your object that you raise property changed using INPC for when
> a property it depends on changes. Perhaps I am missing your point, but I
> felt it a pretty easy transition.
> *
> *
> *
> *
> Colin
> *
> *
> We are doing some pretty hairy financial stuff (loads of logic) and it has
> held up quite well.
> *
> *
> *
> *
> *
> *
>
>
>
>
>
>
>
>
>
> On Wed, Jul 11, 2012 at 3:33 PM, Daniel Vaughan <dbvaug...@gmail.com> wrote:
> > I've been using Knockout with Script# for a little while, building a
> > single page application. Nearly all of my application logic is in C#, which
> > has allowed me to reuse a lot of my previously thought out approaches to
> > validation and so forth. I complement that with smatterings of js in the
> > form of binding handlers and so forth. I'm really pleased with this
> > approach so far.
>
> > One thing that stood out for me when I began using Knockout is that its
> > take on data-binding is markedly different to INPC. Notification happens at
> > the field level and not at object level. It's an approach that allows you
> > to create composite bindings more easily, and gives it a magical feel (in a
> > good way).
>
> > Cheers,
> > Daniel
>
> > On Wed, Jul 11, 2012 at 3:45 PM, Sacha Barber <sacha.bar...@gmail.com>wrote:
>
> >> The more I use it the more similarities I see with XAML bindings, and
> >> MVVM sure is useful even in the web.
>
> >> On Wed, Jul 11, 2012 at 2:35 PM, Colin E. <colin.eberha...@gmail.com>wrote:
>
> >>> $parent
>
> >> --
> >> Sacha Barber
> >> sacha.bar...@gmail.com
>
> > --
>
> > Daniel Vaughan
> > danielvaughan.org
> > outcoder.com
>
> --
> Sacha Barber
> sacha.bar...@gmail.com

Sachs Barber

unread,
Jul 11, 2012, 11:52:52 AM7/11/12
to wpf-di...@googlegroups.com, XAML Disciples
I see what you mean but I don't see the difference between this and inpc based change to be honest.

But hey ho

Sent from my iPhone

Daniel Vaughan

unread,
Jul 11, 2012, 12:07:40 PM7/11/12
to wpf-di...@googlegroups.com
mmm ok. So for example you can do <span data-bind="text: firstName() + ' ' + lastName()" />, where firstName and lastName are observables. When either firstName or lastName changes, the span text content is updated. With INPC you'd need two bindings (or a MultiBinding ala Colin). Because binding occurs at the field level it makes combining them in binding expressions easier.

Daniel Vaughan

unread,
Jul 11, 2012, 12:38:23 PM7/11/12
to XAML Disciples
On reflection, that wasn’t a good example because the Knockout binding
expression interpreter composes a function consisting of the fields,
which is not a direct result of the binding being at the field level.

On Jul 11, 6:07 pm, Daniel Vaughan <dbvaug...@gmail.com> wrote:
> mmm ok. So for example you can do <span data-bind="text: firstName() + ' '
> + lastName()" />, where firstName and lastName are observables. When either
> firstName or lastName changes, the span text content is updated. With INPC
> you'd need two bindings (or a MultiBinding ala Colin). Because binding
> occurs at the field level it makes combining them in binding expressions
> easier.
>
> On Wed, Jul 11, 2012 at 5:52 PM, Sachs Barber <sacha.bar...@gmail.com>wrote:
>
>
>
>
>
>
>
>
>
> > I see what you mean but I don't see the difference between this and inpc
> > based change to be honest.
>
> > But hey ho
>
> > Sent from my iPhone
>

Daniel Vaughan

unread,
Jul 11, 2012, 12:59:26 PM7/11/12
to XAML Disciples
I guess the real advantage of field level binding is that there is
ordinarily no need for plumbing code in the owner class.
There’s just so much to like about Knockout.


On Jul 11, 5:52 pm, Sachs Barber <sacha.bar...@gmail.com> wrote:
> I see what you mean but I don't see the difference between this and inpc based change to be honest.
>
> But hey ho
>
> Sent from my iPhone
>

Laurent Bugnion

unread,
Jul 11, 2012, 1:03:02 PM7/11/12
to wpf-di...@googlegroups.com

Typically in that case I do a FullName property on the VM. I agree that it is a bit more complex than that though.

 

Cheers,

Laurent

 

From: wpf-di...@googlegroups.com [mailto:wpf-di...@googlegroups.com] On Behalf Of Daniel Vaughan


Sent: Wednesday, July 11, 2012 6:08 PM
To: wpf-di...@googlegroups.com

Sachs Barber

unread,
Jul 11, 2012, 1:07:08 PM7/11/12
to wpf-di...@googlegroups.com
Yeah my point was just have an extra property and fire that when it's upstream properties change. I would not use the syntax you provide as I think the view model should contain all computed observables too, do to my mind there really is not much in it.

Anyway done this one to death it's all good

Sent from my iPhone

Daniel Vaughan

unread,
Jul 11, 2012, 3:23:10 PM7/11/12
to XAML Disciples
That's the way I do it too. I've never much liked it though. To me
it's a code smell having to raise a PropertyChanged event for multiple
dependent properties. Granted it's not a big issue, but it's something
that a different binding expression interpreter is able to solve
elegantly.


On Jul 11, 7:03 pm, "Laurent Bugnion" <laur...@galasoft.ch> wrote:
> Typically in that case I do a FullName property on the VM. I agree that it
> is a bit more complex than that though.
>
> Cheers,
>
> Laurent
>
> From: wpf-di...@googlegroups.com [mailto:wpf-di...@googlegroups.com]
> On Behalf Of Daniel Vaughan
> Sent: Wednesday, July 11, 2012 6:08 PM
> To: wpf-di...@googlegroups.com
> Subject: Re: [WPF Disciples] Re: Hey Mike
>
> mmm ok. So for example you can do <span data-bind="text: firstName() + ' ' +
> lastName()" />, where firstName and lastName are observables. When either
> firstName or lastName changes, the span text content is updated. With INPC
> you'd need two bindings (or a MultiBinding ala Colin). Because binding
> occurs at the field level it makes combining them in binding expressions
> easier.
>
> On Wed, Jul 11, 2012 at 5:52 PM, Sachs Barber <sacha.bar...@gmail.com>
> wrote:
>
> I see what you mean but I don't see the difference between this and inpc
> based change to be honest.
>
> But hey ho
>
> Sent from my iPhone
>
>  <http://danielvaughan.org/> danielvaughan.org
>
>  <http://outcoder.com/> outcoder.com

Sachs Barber

unread,
Jul 11, 2012, 3:23:56 PM7/11/12
to wpf-di...@googlegroups.com
Yeah I'm on the not a big deal camp I guess

Sent from my iPhone

Michael Brown

unread,
Jul 11, 2012, 4:21:15 PM7/11/12
to wpf-di...@googlegroups.com

Dammit…I’ll have to see if I can squeeze Script# in now…thanks a lot dude :P

 

From: wpf-di...@googlegroups.com [mailto:wpf-di...@googlegroups.com] On Behalf Of Daniel Vaughan
Sent: Wednesday, July 11, 2012 10:34 AM
To: wpf-di...@googlegroups.com
Subject: Re: [WPF Disciples] Hey Mike

 

I've been using Knockout with Script# for a little while, building a single page application. Nearly all of my application logic is in C#, which has allowed me to reuse a lot of my previously thought out approaches to validation and so forth. I complement that with smatterings of js in the form of binding handlers and so forth. I'm really pleased with this approach so far.

Daniel Vaughan

unread,
Jul 11, 2012, 4:34:09 PM7/11/12
to XAML Disciples
I've heard rumors MVVM V2 will be out later in the year. ;)

Good luck with the book Mike. I know it will be terrific. Sounds like
you're in the final mile.

Cheers,
Daniel

On Jul 11, 10:21 pm, Michael Brown <mbr...@kharasoft.com> wrote:
> Dammit...I'll have to see if I can squeeze Script# in now...thanks a lot dude :P
>
> From: wpf-di...@googlegroups.com [mailto:wpf-di...@googlegroups.com] On Behalf Of Daniel Vaughan
> Sent: Wednesday, July 11, 2012 10:34 AM
> To: wpf-di...@googlegroups.com
> Subject: Re: [WPF Disciples] Hey Mike
>
> I've been using Knockout with Script# for a little while, building a single page application. Nearly all of my application logic is in C#, which has allowed me to reuse a lot of my previously thought out approaches to validation and so forth. I complement that with smatterings of js in the form of binding handlers and so forth. I'm really pleased with this approach so far.
>
> One thing that stood out for me when I began using Knockout is that its take on data-binding is markedly different to INPC. Notification happens at the field level and not at object level. It's an approach that allows you to create composite bindings more easily, and gives it a magical feel (in a good way).
>
> Cheers,
> Daniel
>
> On Wed, Jul 11, 2012 at 3:45 PM, Sacha Barber <sacha.bar...@gmail.com<mailto:sacha.bar...@gmail.com>> wrote:
> The more I use it the more similarities I see with XAML bindings, and MVVM sure is useful even in the web.
> On Wed, Jul 11, 2012 at 2:35 PM, Colin E. <colin.eberha...@gmail.com<mailto:colin.eberha...@gmail.com>> wrote:
> $parent
>
> --
> Sacha Barber
> sacha.bar...@gmail.com<mailto:sacha.bar...@gmail.com>
>
> --
>
> Daniel Vaughan
> danielvaughan.org<http://danielvaughan.org/>
> outcoder.com<http://outcoder.com/>

Laurent Bugnion

unread,
Jul 12, 2012, 2:37:08 PM7/12/12
to wpf-di...@googlegroups.com
Wait, there is reflection in JavaScript now???

-----Original Message-----
From: wpf-di...@googlegroups.com [mailto:wpf-di...@googlegroups.com]
On Behalf Of Daniel Vaughan
Sent: Wednesday, July 11, 2012 6:38 PM
To: XAML Disciples
Subject: [WPF Disciples] Re: Hey Mike

On reflection, that wasn’t a good example because the Knockout binding
expression interpreter composes a function consisting of the fields, which
is not a direct result of the binding being at the field level.

On Jul 11, 6:07 pm, Daniel Vaughan <dbvaug...@gmail.com> wrote:
> mmm ok. So for example you can do <span data-bind="text: firstName() + ' '
> + lastName()" />, where firstName and lastName are observables. When
> + either

Sachs Barber

unread,
Jul 12, 2012, 3:14:53 PM7/12/12
to wpf-di...@googlegroups.com, <wpf-disciples@googlegroups.com>
Actually there kind of is there is typeof and prototype so sure there is pseudo reflection

Sent from my iPhone
Reply all
Reply to author
Forward
0 new messages