예제 #1
0
        public BookDetailsVM(IWebStoreService webStoreService)
        {
            _webStoreService = webStoreService;

            this.OnRouted((sender, e) =>
            {
                if (!string.IsNullOrEmpty(e.From))
                {
                    // Extract the book title from the route path.
                    var bookTitle = e.From.Replace("book/", "");

                    Book = _webStoreService.GetBookByTitle(bookTitle);
                    Changed(nameof(Book));
                }
            });
        }
예제 #2
0
        public BookStoreVM(IWebStoreService webStoreService)
        {
            _webStoreService = webStoreService;

            // Register the route templates with RegisterRoutes method extension of the IRoutable.
            this.RegisterRoutes("examples/bookstore", new List <RouteTemplate>
            {
                new RouteTemplate("BookDefault")
                {
                    UrlPattern = ""
                },
                new RouteTemplate("Book")
                {
                    UrlPattern = "book(/:title)"
                }
            });
        }
예제 #3
0
        public BookDetailsVM(IWebStoreService webStoreService)
        {
            _webStoreService = webStoreService;

            BookDefaultRoute = this.Redirect("examples/bookstore", "default");

            this.OnRouted((sender, e) =>
            {
                if (!string.IsNullOrEmpty(e.From))
                {
                    // Extract the book title from the route path.
                    SearchTitle = e.From.Replace("book/", "");
                    Changed(nameof(SearchTitle));

                    Book = _webStoreService.GetBookByTitle(SearchTitle);
                    Changed(nameof(Book));
                }
            });
        }
예제 #4
0
 public MasterDetails(IWebStoreService webStoreService)
 {
     _webStoreService = webStoreService;
 }