Expression > Gallery > Behaviors > Sample Silverlight 3 Behaviors
Express yourself! Share your work with other members of the Expression Community.

Each contribution is licensed to you under a License Agreement by its owner, not Microsoft. Microsoft does not guarantee the contribution or purport to grant rights to it.

Sample Silverlight 3 Behaviors

Average Rating:  (11)
Description
Discussions (6)
  • Mix09 Demo
    15 Posts | Last Post: December 10, 2009
    • I saw this on the mix demo.
      I see that the body behaviour is not in the sample provided.
      That was rather disapointig.
      Is there any plans to update this and include the body behaviour?

      Also thank you very much for this, I am so excited about silverlight 3 and blend 3 I am having a hard time sleeping.
    • Hi!
      I find behaviors really cool however I think it's really badly located in blend... (dragging from asset library?? :) )

      I tried to write a Behavior for WPF but the interactivity.dll in blend 3 was missing the *.Layout namespace so I cannot compile it. Any way to fix this?
    • Hi Furball! I've pinged Pete to upload his behaviors up, so hopefully he will be adding his ones soon.

      Zoltan - let me look into that.

      Cheers!
      Kirupa :)
    • Zoltan - I have been able to write a simple behavior in WPF without running into that problem. Could you please e-mail me your project to kirupa[at]kirupa.com?

      Thanks,
      Kirupa
    • hello kirupa

      i have the same problem, when i use the sample behaviour

      kind regards
      Dieter

      Error 1 Invalid XmlnsDeclaration occurs in assembly 'Microsoft.Expression.Interactivity, Version=1.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. XmlnsDeclaration references a namespace 'Microsoft.Expression.Interactivity.Layout' that is not in the assembly. D:\temp\SilverlightPreviewBehaviors\Project Files\SilverlightPreviewBehaviors\Page.xaml 1 1 SilverlightPreviewBehaviors
    • dieter - I noticed it as well this time around.

      The fix is to, as Roland suggests here (http://blog.kirupa.com/?p=351#comment-191905) to add a new CS file whose namespace is Microsoft.Expression.Interactivity.Layout.
    • I agree with my friend, Zoltan - behaviors should not be hidden inside the assets panel. The Assets seem to be the place where "everything else" is being put, much like Office 2003's Tools menu. Please consider putting "tabs" or an outlook bar on the toolbar.
    • Hello,

      Still we can't find the body behavior. Is it going to be released here in the galary or some where else, or it is not going to be released at all, hopefully no.

      --
      Shahbour
    • I am also anxiously awaiting the body behavior! And as if I wasn't demanding enough already- I want it for WPF.
    • Where do we need to add this new class for Microsoft.Expression.Interactivity.Layout? I think the only place that would work would be inside that dll. Otherwise we going to get an error every time we refrence it.
    • Where do we need to add this new class for Microsoft.Expression.Interactivity.Layout? I think the only place that would work would be inside that dll. Otherwise we going to get an error every time we refrence it.
    • obsid - look at my post half-a-page up. Simply add a .CS file with the missing namespace. We'll be sure to fix it in a future release.

      Shahbour - the body behavior can be seen here: http://gallery.expression.microsoft.com/MIXBehaviorPack

      Cheers!
      Kirupa :)
    • Hi,

      I've added a new .cs file with that namespace in (with and without an empty class) and am still getting the "Microsoft.Expression.Interactivity.Layout" error listed above. Any ideas of why this may be?

      Thanks,

      P
    • To fix the Microsoft.Expression.Interactivity.Layout problem, you might as well reference the expression assembly explicitly, instead of:
      xmlns:i="http://schemas.microsoft.com/expression/2009/interactivity"
      use
      xmlns:i="clr-namespace:Microsoft.Expression.Interactivity;assembly=Microsoft.Expression.Interactivity"
    • Can anyone tell me where the DragDropItem behavior included in Snowboard_Mix_StartScreens (Expression.Prototype.Screens.dll) and used in the Sketchflow Starter Kit videos is hiding????
      Several people have posted that it is missing and no one has found it anywhere. Thanks!
  • They just don't work with Blend 3 RC and SL 3
    3 Posts | Last Post: August 27, 2009
    • These used to work with the Blend Preview but now they don't any ideas how to fix this?
    • Yes: the description says it's been updated to work with Blend 3 release. Thus, update to Blend 3 release, and it will work.
    • Jon, texmex was correct when that statement was made :) I updated the samples after that post was made.

      Cheers!
      Kirupa
  • DragBehavior and Scale
    1 Posts | Last Post: May 25, 2009
    • If you put the target object in Canvas, and then scale the canvas (ScaleTransform) the drag behavior gets confused. You can drag, but the offset between mouse and what you are dragging changes over distance.
  • Code behind?
    2 Posts | Last Post: April 10, 2009
    • Anyone know how to programmatically attach a behavior to a UIElement in the code behind?
    • Found it- there's an Attach function.
  • in the framework?
    5 Posts | Last Post: March 26, 2009
    • hello, i think behaviors are really great, not just for designers but for everyone. they allow really great abstraction
      are there any plans for putting the base classes into the framework(s)?
      it would be a shame if they where bound to blend :/ its a bit iffy to have to distribute a pice of the designer with the apps :) also, i find it a bit of a hassle to locate the assemblies to reference them :) and what about licensing and stuff? do i have to have blend to use/create behaviors? that'd be a shame :/
      they really belong in the framework imo :)
    • Hi Al,
      You don't need Blend installed to run apps that use behaviors. The same goes for creating behaviors. You can create behaviors using just VS without having Blend installed. All you need is a reference to the DLL.

      I'll have more details to share in the future on some of these things, but rest assured that we'll be as flexible as the libraries that ship with Silverlight and WPF.

      Cheers!
      Kirupa
    • great :) im looking forward to those posts :)
      but if i dont haev blend, where would i get the dll? will they be made available as a separate download? again, i think behavios are really super awsome and highly applicable for games and stuff :)

      id also love more info on how they compose, like if diffrent behaviours tried to affect the same properties of the element, or if they can affect each other. lets say you have a game, im thinking you could have like a physics behaviour controlling gravity and such, maybe a clipping behavior, an ai behavior that controls how the character moves. perhaps you could have one behaviour that handles the animation of the character legs or whatever and one for the actual ai :)

      it would make for a very composable app and that's really nice :)
    • Al - yep, there will be a way to just get the behaviors DLLs without having to have (or downnload) the full Expression Blend 3 product.

      For your next question, you should look into and experiment with Pete's behaviors posted here: http://gallery.expression.microsoft.com/MIXBehaviorPack :P
    • sounds great :) i still love to see them in the framework though ;) they're just so awsome :)

      yes, ive been looking at that, very cool indeed. beeing a bit of a xaml noob im not completly up to speed on what can be done with dependency properties and attatched properties :) ive been looking at another physics engine and im going to try and write something to post here :)
  • WPF Behaviours
    2 Posts | Last Post: March 23, 2009
    • Will these behaviours work for WPF, as well? Is it possible to use Blend 3 Preview to write behaviours for WPF? Is there or could you release walkthrough to create a bahaviour for WPF and Silverlight 3? Thank you. Very good sessions about topic at Mix09:)
    • Behaviors will work for WPF. While these behaviors are written for Silverlight 3, the behaviors created by Tor Langlo work in WPF: http://gallery.expression.microsoft.com/WPFBehaviors1

      :)