locked
How to create non-video trigger in expression blend? (Littlepig.) - 11/27/2007 7:34 AM PST RRS feed

  • Question

  • By: Littlepig.


    HI all.,
    
    I am very eager to know how to  create a non video trigger in this software 
    as the trigger can only control video's play and stop.
    
    If I wanna make a trigger that lead the click-button action to a next screen 
    or make some changes in the data,how can I make it in this software?
    
    Many Thanks!
    
    Littlepig.
    
    Thursday, February 21, 2008 8:08 PM

All replies

  • By: Rob Relyea [MSFT]

    Your terms are a bit confusing.
    I don't know what Non-Video Trigger means.
    
    In WPF, a Trigger is a declarative statement that says when X is true, 
    please set these properties to Y1, Y2, Y3, etc....
    
    The Trigger documentation 
    (http://msdn2.microsoft.com/en-us/library/system.windows.trigger.aspx) has a 
    good example of this:
    <Style x:Key="Triggers" TargetType="Button">
        <Style.Triggers>
        <Trigger Property="IsMouseOver" Value="true">
            <Setter Property = "Background" Value="Red"/>
        </Trigger>
        <Trigger Property="IsPressed" Value="true">
            <Setter Property = "Foreground" Value="Green"/>
        </Trigger>
        </Style.Triggers>
    </Style>
    
    So a Trigger is just a declarative way of setting one or more properties 
    when another property is in a certain state.  In the past, people always did 
    this kind of thing in code.  For examlpe instead of having a Trigger based on 
    IsPressed being true.  You would listen to the mousedown event, change the 
    Foreground to Green; and the mouseup event, change the Foreground back to the 
    old color.
    
    So it sounds like you are asking if you can make a trigger which causes a 
    navigation to the next "page" or to change some data...
    You can definitely do these kind of things in code...I'm not sure if using a 
    trigger for those scenarios is great use.
    
    Can you say why you want to use a Trigger, and not code for those 2 
    scenarios you mention?
    
    Thanks, Rob
    
    Rob Relyea | Program Manager, WPF & Xaml Language Team
    robrelyea.com | /blog | /wpf | /xaml
    
    
    "Littlepig." wrote:
    
    > HI all.,
    > 
    > I am very eager to know how to  create a non video trigger in this software 
    > as the trigger can only control video's play and stop.
    > 
    > If I wanna make a trigger that lead the click-button action to a next screen 
    > or make some changes in the data,how can I make it in this software?
    > 
    > Many Thanks!
    > 
    > Littlepig.
    > 
    Friday, February 22, 2008 6:59 PM
  • By: Litlepig

    Thank you Rob,
    
    I wanna make my project in XNA game studio first,but when expression blend 
    is very easy to make my project's UI handsome.
    
    Unfortunately espression blend cannot be embedded in XNA game studio.
    
    And I am not sure how to write the code to lead the button action to the 
    next screen.
    
    Could you say some related to me?
    
    
    "Rob Relyea [MSFT]" wrote:
    
    > Your terms are a bit confusing.
    > I don't know what Non-Video Trigger means.
    > 
    > In WPF, a Trigger is a declarative statement that says when X is true, 
    > please set these properties to Y1, Y2, Y3, etc....
    > 
    > The Trigger documentation 
    > (http://msdn2.microsoft.com/en-us/library/system.windows.trigger.aspx) has a 
    > good example of this:
    > <Style x:Key="Triggers" TargetType="Button">
    >     <Style.Triggers>
    >     <Trigger Property="IsMouseOver" Value="true">
    >         <Setter Property = "Background" Value="Red"/>
    >     </Trigger>
    >     <Trigger Property="IsPressed" Value="true">
    >         <Setter Property = "Foreground" Value="Green"/>
    >     </Trigger>
    >     </Style.Triggers>
    > </Style>
    > 
    > So a Trigger is just a declarative way of setting one or more properties 
    > when another property is in a certain state.  In the past, people always did 
    > this kind of thing in code.  For examlpe instead of having a Trigger based on 
    > IsPressed being true.  You would listen to the mousedown event, change the 
    > Foreground to Green; and the mouseup event, change the Foreground back to the 
    > old color.
    > 
    > So it sounds like you are asking if you can make a trigger which causes a 
    > navigation to the next "page" or to change some data...
    > You can definitely do these kind of things in code...I'm not sure if using a 
    > trigger for those scenarios is great use.
    > 
    > Can you say why you want to use a Trigger, and not code for those 2 
    > scenarios you mention?
    > 
    > Thanks, Rob
    > 
    > Rob Relyea | Program Manager, WPF & Xaml Language Team
    > robrelyea.com | /blog | /wpf | /xaml
    > 
    > 
    > "Littlepig." wrote:
    > 
    > > HI all.,
    > > 
    > > I am very eager to know how to  create a non video trigger in this software 
    > > as the trigger can only control video's play and stop.
    > > 
    > > If I wanna make a trigger that lead the click-button action to a next screen 
    > > or make some changes in the data,how can I make it in this software?
    > > 
    > > Many Thanks!
    > > 
    > > Littlepig.
    > > 
    Friday, February 22, 2008 7:02 PM