Fixed part of my last request

0 views
Skip to first unread message

Sacha Barber

unread,
May 16, 2008, 7:41:11 AM5/16/08
to wpf-di...@googlegroups.com
Fixed part of my last request

Noticed that I had a mistake in my attached property

So fixed that, which is now

using System.Windows;

namespace DirectPlusDemoApp
{

    public static class ButtonExtraProps
    {
        public static double GetScaleTo(DependencyObject obj)
        {
            return (double)obj.GetValue(ScaleToProperty);
        }

        public static void SetScaleTo(
            DependencyObject obj, double value)
        {
            obj.SetValue(ScaleToProperty, value);
        }

        public static readonly DependencyProperty ScaleToProperty =
            DependencyProperty.RegisterAttached(
            "ScaleTo",
            typeof(double),
            typeof(ButtonExtraProps),
            new UIPropertyMetadata(1.0));
    }

}

but still cant get Storyboard to work with this Attached property.

Any ideas?


Get fish-slapping on Messenger! Play Now

Andrew

unread,
May 16, 2008, 11:46:59 PM5/16/08
to wpf-di...@googlegroups.com

Sorry about the last reply - was looking at the latest emails and didn't see this one indicating you fixed the get/set. I could be wrong but I don't think you'll be able to do what you want. I had tried something similar to this a while back and couldn't get it to work from xaml (in a controltemplate) and ended up having to create the animation in code. The problem I hit is that when the wpf framework seals the template they try to seal everything within the template - including animations which are freezables - and that throws an exception if any of the dp's of that freezable have expressions (i.e. bindings) associated with them.

 

-Andrew

Sacha Barber

unread,
May 17, 2008, 3:43:32 AM5/17/08
to wpf-di...@googlegroups.com
Andrew,

Fair enough this could explain it. I have certainly had issues with Freezable in animations / binding before, so had to create Clone converters in the past.

Didnt think that an Attached double property would be Freezable though. I thought things like Brushes etc etc were Freezable




Date: Fri, 16 May 2008 20:46:59 -0700
From: webfl...@yahoo.com
Subject: Re: Fixed part of my last request
To: wpf-di...@googlegroups.com

Andrew

unread,
May 17, 2008, 10:32:27 PM5/17/08
to wpf-di...@googlegroups.com

It's not the value that is freezable. The animation class (so the doubleanimation in this case) derives from freezable. It is the To property of that freezable class that you are attempting to set to a Binding. The problem really isn't related to the fact that the property to which you are binding is defined as attached or not. Again, maybe the problem you're having isn't the same one I did but it sounds quite similar and I do get the same exception with your setup if I use the following modified version of the animation in the storyboard.

 

              <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetName="imgScale"
                               Storyboard.TargetProperty="(ScaleTransform.ScaleX)"
                               To="{Binding Path=(local:ButtonExtraProps.ScaleTo), RelativeSource={x:Static RelativeSource.TemplatedParent}}"
                               AutoReverse="True"/>

Sacha Barber

unread,
May 18, 2008, 2:39:49 AM5/18/08
to wpf-di...@googlegroups.com
Andrew

Thanks for that, that makes sense somehow.

Thanks for that answer




Date: Sat, 17 May 2008 19:32:27 -0700


Messenger's gone Mobile! Get it now!

Corrado Cavalli

unread,
May 20, 2008, 1:06:52 AM5/20/08
to wpf-di...@googlegroups.com

Please welcome Brennon Williams

Brennon he’s  a great guy and book author (Expression Blend Unleashed) he know everything about Expression Blend J , a longtime member of Expression newsgroups.and owner of  http://www.learnexpressionblend.com/ and http://x-coders.com/Default.aspx

 

Welcome mate!

Corrado

rudigrobler

unread,
May 20, 2008, 2:26:35 AM5/20/08
to WPF Disciples
Welcome

On May 20, 7:06 am, "Corrado Cavalli" <corradocava...@gmail.com>
wrote:
> Please welcome Brennon Williams
>
> Brennon he's  a great guy and book author (Expression Blend Unleashed) he
> know everything about Expression Blend J , a longtime member of Expression
> newsgroups.and owner of  http://www.learnexpressionblend.com/andhttp://x-coders.com/Default.aspx
>
> Welcome mate!
>
> Corrado
>
> From: wpf-di...@googlegroups.com [mailto:wpf-di...@googlegroups.com]
> On Behalf Of Sacha Barber
> Sent: domenica 18 maggio 2008 08:40
> To: wpf-di...@googlegroups.com
> Subject: RE: Fixed part of my last request
>
> Andrew
>
> Thanks for that, that makes sense somehow.
>
> Thanks for that answer
>
>   _____  
>
> Date: Sat, 17 May 2008 19:32:27 -0700
> From: webflye...@yahoo.com
> Subject: Re: Fixed part of my last request
> To: wpf-di...@googlegroups.com
>
> It's not the value that is freezable. The animation class (so the
> doubleanimation in this case) derives from freezable. It is the To property
> of that freezable class that you are attempting to set to a Binding. The
> problem really isn't related to the fact that the property to which you are
> binding is defined as attached or not. Again, maybe the problem you're
> having isn't the same one I did but it sounds quite similar and I do get the
> same exception with your setup if I use the following modified version of
> the animation in the storyboard.
>
>               <DoubleAnimation Duration="0:0:0.2"
> Storyboard.TargetName="imgScale"
>
> Storyboard.TargetProperty="(ScaleTransform.ScaleX)"
>                                To="{Binding
> Path=(local:ButtonExtraProps.ScaleTo), RelativeSource={x:Static
> RelativeSource.TemplatedParent}}"
>                                AutoReverse="True"/>
>
> -Andrew----- Original Message ----
> From: Sacha Barber <sachabar...@hotmail.com>
> To: wpf-di...@googlegroups.com
> Sent: Saturday, May 17, 2008 3:43:32 AM
> Subject: RE: Fixed part of my last request
>
> Andrew,
>
> Fair enough this could explain it. I have certainly had issues with
> Freezable in animations / binding before, so had to create Clone converters
> in the past.
>
> Didnt think that an Attached double property would be Freezable though. I
> thought things like Brushes etc etc were Freezable
>
>   _____  
>
> Date: Fri, 16 May 2008 20:46:59 -0700
> From: webflye...@yahoo.com
> Get fish-slapping on Messenger! Play Now
> <http://clk.atdmt.com/UKM/go/msnnkmgl0010000008ukm/direct/01/>
>
>   _____  
>
> Get fish-slapping on Messenger! Play Now
> <http://clk.atdmt.com/UKM/go/msnnkmgl0010000008ukm/direct/01/>
>
>   _____  
>
> Messenger's gone Mobile! Get it now!
> <http://clk.atdmt.com/UKM/go/msnnkmgl0010000001ukm/direct/01/>

Jeremiah Morrill

unread,
May 20, 2008, 2:43:55 AM5/20/08
to wpf-di...@googlegroups.com
Awesome!  Welcome, welcome, welcome!
 
-Jer

Marlon Grech

unread,
May 20, 2008, 4:06:07 AM5/20/08
to wpf-di...@googlegroups.com
Welcome to the geek CLUB!!!!!
can't wait to start some threads with you :D

--
Regards
Marlon
Blog - http://marlongrech.wordpress.com/
WPF Controls Library - http://www.codeplex.com/avaloncontrolslib

Laurent Bugnion [MVP, MCP]

unread,
May 20, 2008, 4:31:38 AM5/20/08
to wpf-di...@googlegroups.com
Welcome Brennon!

Corrado Cavalli wrote:
>
> Please welcome Brennon Williams
>
> Brennon he’s a great guy and book author (Expression Blend Unleashed)
> he know everything about Expression Blend J , a longtime member of
> Expression newsgroups.and owner of
> http://www.learnexpressionblend.com/ and http://x-coders.com/Default.aspx
>
> Welcome mate!
>
> Corrado
>

--
Laurent Bugnion [Microsoft MVP, MCP]
Software engineering, Blog: http://www.galasoft.ch
PhotoAlbum: http://www.galasoft.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch

brennon williams

unread,
May 20, 2008, 5:13:20 AM5/20/08
to WPF Disciples
Thanks everyone.. glad to be here :-)

My wife is going to have a field day with "the geek club".. she
already makes enough fun of me as it is...

My primary sites are:

www.learnexpressionstudio.com which had a very soft launch the other
week back... just gearing up slowly there..
www.x-coders.com which is my company site and support site for stuff,
and home of the blog(s)..
www.expressionblend.com which almost killed me.. and will be revamped
later this year..

and I have a ton of supplementary domains that will be built out over
the next 3 years... (yeah I am on a long term plan here... :-))

I look forward to being involved with some very cool things...

Send me an email if you would like my MSN details, only too happy to
chat, share, help if I can and hopefully learn as well...

Cheers

On May 20, 9:31 am, "Laurent Bugnion [MVP, MCP]" <laur...@galasoft.ch>
wrote:
> Welcome Brennon!
>
> Corrado Cavalli wrote:
>
> > Please welcome Brennon Williams
>
> > Brennon he’s a great guy and book author (Expression Blend Unleashed)
> > he know everything about Expression Blend J , a longtime member of
> > Expression newsgroups.and owner of
> >http://www.learnexpressionblend.com/andhttp://x-coders.com/Default.aspx

Karl Shifflett

unread,
May 20, 2008, 6:07:20 AM5/20/08
to wpf-di...@googlegroups.com

Welcome Brennon.  I love you Blend book.

 

Cheers,

 

Karl

Pavan Podila

unread,
May 20, 2008, 6:09:38 AM5/20/08
to wpf-di...@googlegroups.com
The group is growing exponentially stronger !

Welcome aboard Brennon.
--
the approach, rather than the solution
...o0O0o...
http://blog.pixelingene.com

Josh Smith

unread,
May 20, 2008, 7:20:19 AM5/20/08
to wpf-di...@googlegroups.com
I agree!

Laurent Bugnion [MVP, MCP]

unread,
May 20, 2008, 10:18:23 AM5/20/08
to wpf-di...@googlegroups.com
Hi Brennon,

Good idea sharing the MSN contact info. Mine is galas...@bluewin.ch

Actually, all my info can be found on my contact page
http://www.galasoft.ch/contact

Greetings,
Laurent

Mike Brown

unread,
May 20, 2008, 11:57:43 AM5/20/08
to wpf-di...@googlegroups.com
Is it out yet? I've been checking for it on Amazon and they keep telling me that the book isn't available yet.
 
Welcome aboard. You know you're not allowed to submit an entry into the Podder skinning competition...anyone who has written a book on Blend has too much of an advantage ;)
 
Anyway, I'm looking forward to a lot of fun design threads now that we have more than one design guy in house!

Brennon Williams

unread,
May 20, 2008, 12:08:55 PM5/20/08
to wpf-di...@googlegroups.com

Hey Mike..

 

The book is on shelf on June 2 (or so say the publisher…) so Amazon should ship as well from that date… what a nightmare…

 

Even though I wrote this book on Blend.. I am still primarily a developer with better then average developer design skills.. I have my good days with art… then others I am back to stick figures L

 

 

I will upload the BIO shortly… which will tell the story of my twisted ways…

 

Cheers for the welcome!

Marlon Grech

unread,
May 20, 2008, 12:26:47 PM5/20/08
to wpf-di...@googlegroups.com
guys.... may I please remind you that this is public.... so if you are sharing MSN contacts here, you are sharing it with the world.... if you want to then it is ok... but if you do not then it is another story :D just reminding you guys .....

(Laurent if you want I can delete your msn address from public...)

Laurent Bugnion [MVP, MCP]

unread,
May 20, 2008, 1:08:23 PM5/20/08
to wpf-di...@googlegroups.com
Hi Brennon

Brennon Williams wrote:
>
>
>
> Even though I wrote this book on Blend..
>

It sounds rather difficult to write a book on Blend. I prefer Word for
my book :)

Cheers. Looking forward to get your book!
Laurent

Laurent Bugnion [MVP, MCP]

unread,
May 20, 2008, 1:09:02 PM5/20/08
to wpf-di...@googlegroups.com
Hey Marlon,

No worries, my MSN address is public domain :)

Greetings,
Laurent

Marlon Grech wrote:
> guys.... may I please remind you that this is public.... so if you are
> sharing MSN contacts here, you are sharing it with the world.... if
> you want to then it is ok... but if you do not then it is another
> story :D just reminding you guys .....
>
> (Laurent if you want I can delete your msn address from public...)
>
> On Tue, May 20, 2008 at 6:08 PM, Brennon Williams

> <brennon...@x-coders.com <mailto:brennon...@x-coders.com>>

> wrote:
>
> Hey Mike..
>
>
>
> The book is on shelf on June 2 (or so say the publisher…) so
> Amazon should ship as well from that date… what a nightmare…
>
>
>
> Even though I wrote this book on Blend.. I am still primarily a
> developer with better then average developer design skills.. I
> have my good days with art… then others I am back to stick figures L
>
>
>
>
>
> I will upload the BIO shortly… which will tell the story of my
> twisted ways…
>
>
>
> Cheers for the welcome!
>
>
>
>
>
>
>

> *From:* wpf-di...@googlegroups.com
> <mailto:wpf-di...@googlegroups.com>
> [mailto:wpf-di...@googlegroups.com
> <mailto:wpf-di...@googlegroups.com>] *On Behalf Of *Mike Brown
> *Sent:* 20 May 2008 16:58
>
> *To:* wpf-di...@googlegroups.com
> <mailto:wpf-di...@googlegroups.com>
> *Subject:* Re: Another disciple into group


>
>
>
> Is it out yet? I've been checking for it on Amazon and they keep
> telling me that the book isn't available yet.
>
>
>
> Welcome aboard. You know you're not allowed to submit an entry
> into the Podder skinning competition...anyone who has written a
> book on Blend has too much of an advantage ;)
>
>
>
> Anyway, I'm looking forward to a lot of fun design threads now
> that we have more than one design guy in house!
>
>
>
>
>
>
>
> --
> Regards
> Marlon
> Blog - http://marlongrech.wordpress.com/
> WPF Controls Library - http://www.codeplex.com/avaloncontrolslib
>
> >

--

Sacha Barber

unread,
May 20, 2008, 1:57:01 AM5/20/08
to wpf-di...@googlegroups.com
Hello Brennon, you really should have kept quite about that book, you are going to get some questions for sure




From: corrado...@gmail.com

To: wpf-di...@googlegroups.com
Subject: Another disciple into group
Date: Tue, 20 May 2008 07:06:52 +0200

Brennon Williams

unread,
May 20, 2008, 2:57:33 PM5/20/08
to wpf-di...@googlegroups.com

Howdy Sacha,

 

 

As my first book, it will probably be slated by people like the Infomercial King… like you say.. cant win them all..

 

I am going to pretend that someone else wrote it and I bought the rights to my name on the cover… ;-)

Sacha Barber

unread,
May 21, 2008, 2:16:37 AM5/21/08
to wpf-di...@googlegroups.com
I shall look forward to this book, can you let us know when it comes out and ill buy it straight away.

At last a good blend book




From: brennon...@x-coders.com

To: wpf-di...@googlegroups.com
Subject: RE: Another disciple into group
Date: Tue, 20 May 2008 19:57:33 +0100


Miss your Messenger buddies when on-the-go? Get Messenger on your Mobile!

Josh Smith

unread,
May 21, 2008, 11:24:41 AM5/21/08
to wpf-di...@googlegroups.com
Me too.  I'll finally have no excuse to not know Blend!  (Damn you, Brennon!) :P

Brennon Williams

unread,
May 21, 2008, 11:48:04 AM5/21/08
to wpf-di...@googlegroups.com

June 2nd is the release date Sacha. I have no idea if that means stockist will be shipping on that date, but it shouldn’t be far away as I know they have almost completed the print run now.

 

Thanks for the support!

Sacha Barber

unread,
May 22, 2008, 2:44:16 AM5/22/08
to wpf-di...@googlegroups.com
Excellent Ill look out for it.





Subject: RE: book
Date: Wed, 21 May 2008 16:48:04 +0100


Get 5GB of online storage for free! Get it Now!

Dr. WPF

unread,
May 23, 2008, 7:50:31 PM5/23/08
to wpf-di...@googlegroups.com

A belated welcome to you also, Brennon!

I've heard of that Blend program...  even installed it once...  but then I couldn't figure out what it was for...  guess I'll have to give it a try again now that we have the fellow who wrote the book on hand!

> />>


Dr. WPF - Online Office at http://www.drwpf.com/blog/


Jeremiah Morrill

unread,
May 23, 2008, 8:48:50 PM5/23/08
to wpf-di...@googlegroups.com
I heard "Blending" was a term for getting high.  I think Blend is one of those new performance enhancing drugs, popular amung the creative elite...But software developers are starting to get into it too.
 
-Jer

Josh Smith

unread,
May 23, 2008, 9:21:29 PM5/23/08
to wpf-di...@googlegroups.com
I once put my hand in a blender.  Does that make me a creative elite?  Like a Van Gogh of the modern age?  :P

Jeremiah Morrill

unread,
May 23, 2008, 9:23:50 PM5/23/08
to wpf-di...@googlegroups.com
Hahaha.  An ear or a hand, same level of sanity.

Brennon Williams

unread,
May 25, 2008, 11:52:13 AM5/25/08
to wpf-di...@googlegroups.com

Thanks Doc.. nice to virtually meet you.

 

Cheers

Reply all
Reply to author
Forward
0 new messages