Magellan Behaviors

Back to: Magellan Home

The web typically uses hyperlinks and postbacks to navigate between pages. With Magellan, we can use either a command, C# code, or using an Expression Blend Behavior.

When you reference the Magellan assemblies, the NavigateBehavior will appear in the Assets tab in Blend 3. You can drag and position it onto any UI element:

Navigate behavior

You can use the properties of the behavior to specify the values. The navigation behavior also allows parameters to be passed to the action, using the Parameters collection button.

In XAML, the behavior will appear as shown below:

<Button Content="Calculate">
    <i:Interaction.Behaviors>
        <NavigateBehavior Controller="Home" Action="Add">
            <NavigateBehavior.Parameters>
                <Parameter ParameterName="left" Value="{Binding Path=Left}" />
                <Parameter ParameterName="right" Value="{Binding Path=Right}" />
            </NavigateBehavior.Parameters>
        </NavigateBehavior>
    </i:Interaction.Behaviors>
</Button>

The parameters passed to the behavior should match the method arguments on the controller action - see the controller section for details. Note that the parameters support data binding - this allows you to pass properties from the model or other UI elements automatically.

See also:

Back to: Magellan Home

Posted by: Paul Stovell
Last revised: 04 Feb, 2012 03:54 AM History

Comments

04 Jan, 2011 03:52 AM

The behavior is actually called "NavigateControllerAction" now. I guess it was updated when view model support was introduced.

No new comments are allowed on this post.