Header area and Conductor.

Topics: Getting Started
Nov 16, 2012 at 2:03 AM

Hello,

In my ShellView I need to display toolbar "Header" with certain HeaderView mapped to it and below area navigating between two another views FirstView and SecondView. 

Here is ShellView.xaml:

Grid>
        <Grid.RowDefinitions>
            <RowDefinition  />
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>

        <Border Grid.Row="0" BorderBrush="LightBlue" BorderThickness="2,2,2,2" Margin="05,05,05,03"  >
            <ContentControl Name="Header" />
        </Border>

        <StackPanel Grid.Row="1"
                    Orientation="Horizontal">
            <Button x:Name="Page1"
                    Content="Page1"
                    Height="50" />
            <Button x:Name="Page2"
                    Content="Page2"
                    Height="50" />
        </StackPanel>
        <Border Grid.Row="2" BorderBrush="LightBlue" BorderThickness="2,2,2,2" Margin="05,05,05,03"  >
            <ContentControl x:Name="ActiveItem" Grid.Row="2"  />
        </Border>
        
    </Grid>

And code:

public class ShellViewModel : Conductor<IScreen>, IShell
    {
        [Import("FirstView", typeof(IScreen))]
        public FirstViewModel First;

        [Import("SecondView", typeof(IScreen))]
        public SecondViewModel Second;

        [Import("HeaderView", typeof(IScreen))]
        public HeaderViewModel Header;

        public void Page1()
        {
            ActivateItem(First);
            
        }

        public void Page2()
        {
            ActivateItem(Second);
        }
    }

I can successfully navigate between First and Second views, but Header is not displayed.

Could you please advise what to do to display Header ?