Magellan Behaviors

This is an old post and doesn't necessarily reflect my current thinking on a topic, and some links or images may not work. The text is preserved here for posterity.

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