Forums

How to use Behavior
Last Post 13 Dec 2015 08:31 PM by Filip Dušek. 1 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
UkrEngineUser is Offline
New Member
New Member
Posts:5


--
13 Dec 2015 05:47 PM
    Hello, in v.1.12 you added the Behavior (and Action). I can not find an example of how (and where) to use them.
    It is ideal if you add an example for each class from EmptyKeys.UserInterface.Designer.Interactions
    Filip DušekUser is Offline
    Advanced Member
    Advanced Member
    Posts:676


    --
    13 Dec 2015 08:31 PM
    In general behaviors are used to expand or change behavior of any control. I implemented one basic behavior (EventTriggerBehavior) for now. This behavior can do some action on any routed event of the control. There are 3 actions implemented - CallMethodAction, ChangePropertyAction and InvokeCommandAction. The names say what they do.

    In XAML you can use them like this:

            <Button Name="button1">
                <eki:Interaction.Behaviors>
                    <eki:EventTriggerBehavior EventName="Click" SourceObject="{Binding Test}">
                        <eki:EventTriggerBehavior.Actions>
                            <eki:CallMethodAction MethodName="TestMethodName" TargetObject="{Binding Target}" />
                            <eki:ChangePropertyAction PropertyName="TestPropertyname1" TargetObject="{Binding Target}" Value="1" />
                            <eki:InvokeCommandAction Command="{Binding TestCommand}" CommandParameter="TestParam" />
                        </eki:EventTriggerBehavior.Actions>
                    </eki:EventTriggerBehavior>                
            </Button>
    


    Namespace - xmlns:eki="clr-namespace:EmptyKeys.UserInterface.Designer.Interactions;assembly=EmptyKeys.UserInterface.Designer"
    You are not authorized to post a reply.