Quantcast
Channel: Caliburn.Micro: Xaml Made Easy
Viewing all articles
Browse latest Browse all 1760

New Post: Getting started

$
0
0
Like I said previously you were mixing two MVVM disciplines and I think it might have even confused you a little, because you have to specifically tell it to populate the Items, it will not do it automatically... then when everything is setup correctly you will see Tabs

something like this...

public class ShellViewModel : Conductor<IScreen>.Collection.OneActive{
 [ImportingConstructor]

 public ShellViewModel([ImportMany]IEnumerable<IScreen> Screens){

          DisplayName = "CM - Example";
          Items.AddRange(Screens);

 }

 protected override void OnActivate(){
        ActivateItem(Items[0]);
 }
}

then with your tabcontrol in the ShellView.xaml

<TabControl x:Name="Items" />

Also your tab text (header) will be bound automagically due to the conventions, CM magic...

http://sdrv.ms/15zbZ78 a sample for some clarity

Viewing all articles
Browse latest Browse all 1760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>