Start up View Model ...

Topics: Framework Services, Getting Started
Sep 28, 2012 at 10:37 PM

I have:

=

    public class MTMainViewModel : Conductor<IMTModule>.Collection.OneActive, IMTMain
    {
        [ImportingConstructor]
        public MTMainViewModel([ImportMany]IEnumerable<Lazy<IMTModule, IMTModuleMetadata>> moduleHandles)
        {
            var modules = from h in moduleHandles orderby h.Metadata.Order select h.Value;
            Items.AddRange(modules);
            //ScreenExtensions.TryActivate(this);
        }

     }

=

<ListBox x:Name="Items" Background="#FF87BAE8">
               
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding DisplayName}" />
                    </DataTemplate>
                </ListBox.ItemTemplate>
           
                <ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal" />
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
           
            </ListBox>
           
            <!-- This is the overall content style of the view -->
           
            <ContentControl x:Name="ActiveItem" Style="{StaticResource MainContentStyle}" />

=

Which works great and loads my views and view models, but I need to click on one of the ListBox items to get the first view to show up.  I'm new to Caliburn so please bear with me.

 

Is there a way to get a Default View Module to appear before the user is required to click on one of the other items?

Thank You,

Joe Mellone

Sep 30, 2012 at 1:43 AM

don't use lazy loading