Пример #1
0
        public void Initialize()
        {
            injector.RegisterType <IMyService, MyService>();

            // injector.RegisterType<IMySharedService, MySharedService>();

            SourceResolver.RegisterTypeForNavigation <ViewC>();
        }
Пример #2
0
        public void Registers_Type_For_Navigation()
        {
            SourceResolver.ClearTypesForNavigation();

            Assert.AreEqual(0, SourceResolver.TypesForNavigation.Count);

            SourceResolver.RegisterTypeForNavigation <MyNavViewA>("A");

            Assert.AreEqual(1, SourceResolver.TypesForNavigation.Count);
            Assert.AreEqual(typeof(MyNavViewA), SourceResolver.TypesForNavigation["A"]);

            SourceResolver.RegisterTypeForNavigation <MyNavViewB>("B");

            Assert.AreEqual(2, SourceResolver.TypesForNavigation.Count);
            Assert.AreEqual(typeof(MyNavViewA), SourceResolver.TypesForNavigation["A"]);
            Assert.AreEqual(typeof(MyNavViewB), SourceResolver.TypesForNavigation["B"]);

            SourceResolver.ClearTypesForNavigation();
        }
Пример #3
0
 public void Initialize()
 {
     SourceResolver.RegisterTypeForNavigation <ViewA>();                 // With View
     SourceResolver.RegisterTypeForNavigation <ViewBViewModel>("ViewB"); // With ViewModel (+ DataTemplate)
 }