Exemplo n.º 1
0
        protected override void OnInitialized()
        {
            base.OnInitialized();
            if (SwitchInstance == null)
            {
                throw new InvalidOperationException("A Route markup must be nested in a Switch markup.");
            }

            SwitchInstance.RegisterRoute(id, ChildContent, Template);
        }
Exemplo n.º 2
0
 protected override Task OnParametersSetAsync()
 {
     if (!hasRegisterd)
     {
         hasRegisterd = true;
         base.OnParametersSetAsync();
         if (SwitchInstance == null)
         {
             throw new InvalidOperationException("A Route markup must be included in a Switch markup.");
         }
         return(SwitchInstance.RegisterRoute(ChildContent, Template, MatchChildren));
     }
     return(Task.CompletedTask);
 }