Results 1 to 7 of 7

Thread: How to use triggers in Silverlight

  1. #1
    Join Date
    Mar 2010
    Posts
    54

    How to use triggers in Silverlight

    The first thing I want to know that; is it possible to use triggers in Silverlight similar to the WPF. I am not having any idea related to but I want to know about it if it is possible. In simple words is it supporting the properties of trigger, event trigger or the data triggers? If there is any possible way of doing this then how to use triggers in Silverlight?

  2. #2
    Join Date
    May 2008
    Posts
    4,345

    Re: How to use triggers in Silverlight


    According to me triggers are not supported if you are using Silverlight. But there is an alternate method for doing this thing. There are many examples available on net for that purpose. You can visit this Silverlight Examples link. If you are trying to change any WPF code to the silverlight code then it will better if you can give us the code for that. I will try to provide you an alternative method for this purpose.

  3. #3
    Join Date
    May 2008
    Posts
    4,831

    Re: How to use triggers in Silverlight

    I think you should check out the behavioral components in silverlight, the thing that you want to achieve can be done using this. Blend 3 is a major release of this powerful tool that can work in the visual WPF or Silverlight applications. Blend 3 tends toward greater ease of handling especially for graphic designers who want / can invest in the code too complex.

  4. #4
    Join Date
    Apr 2008
    Posts
    4,088

    Re: How to use triggers in Silverlight

    I totally agree with the above reply. The notions of Behaviors (behaviors), Actions and Triggers (triggers) are either new in terms of the former or the latter are strengthened. The goal being to add behavior visually without programming. With the tools 15 years ago as VB Microsoft invented the concept of visual component that is placed on a sheet by Drag Drop. A leap forward when we know the methods before and when we know with hindsight what success has been the technology and its clones (Delphi IDE or Java ...)!

  5. #5
    Join Date
    Mar 2009
    Posts
    1,588

    Re: How to use triggers in Silverlight

    A Behavior is a behavior, ie a piece of code that can do just about anything. With this, you are well advanced will you say! But imagine what can be a standalone piece of code (not depending on external states) and make a nice gift box around so that it appears in a palette as a visual component and you get a Behavior. A Behavior is above all a kind of code snippet that has a name that is listed in Blend as are the components.

  6. #6
    Join Date
    Feb 2010
    Posts
    428

    Re: How to use triggers in Silverlight

    I will try to give you a small example to clarify: Imagine you want to move an object by Drag Drop, must manage the mouse Down the Mouse Up and Move the mouse in a typical scenario that I will not elaborate. Now imagine that we wanted to provide the same behavior to another object. It will also set all these events. If now we encapsulate all this in a Behavior, simply remove the words Behavior on all components which ipso facto, will have the behavior. The reuse of code is complete. Later use it Blend can even develop an application developer without being little that has a good library Behaviors, Actions, and Triggers.

  7. #7
    Join Date
    Feb 2010
    Posts
    488

    Re: How to use triggers in Silverlight

    Create a new Behavior is as simple as creating a new class deriving from <T> Behavior. It should nevertheless find the superclass. It hides in an assembly that is not referenced base and plays a little hide and seek. With the final Blend 3 they are: C: \ Program Files \ Microsoft SDKs \ Expression \ Blend 3 \ Interactivity \ Libraries \ Silverlight \ System.Windows.Interactivity.dll Once the class created, it only remains to override two methods: OnAttached () and OnDetaching (). It is from there that can be programmed behavior. The Behavior can know the object to which it is attached: AssociatedObject.

Similar Threads

  1. Replies: 3
    Last Post: 17-04-2011, 04:55 PM
  2. Types of triggers in MySQL
    By Arrosa in forum Software Development
    Replies: 6
    Last Post: 14-12-2010, 05:11 AM
  3. Replies: 2
    Last Post: 09-08-2010, 09:41 AM
  4. Issues with database and forms triggers
    By Ainsley in forum Software Development
    Replies: 3
    Last Post: 29-01-2010, 10:11 AM
  5. Triggers in SQL
    By Projectkmo in forum Software Development
    Replies: 0
    Last Post: 10-11-2008, 12:29 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,564,177.68205 seconds with 17 queries