Exemple #1
0
        protected void Save()
        {
            var book = CurrentBook;

            Action <string> action = async(token) =>
            {
                try
                {
                    BooksClient.Token = token;

                    await BooksClient.SaveBook(book);
                }
                catch
                {
                    // Let's suppress weird arbitrary errors
                }

                UriHelper.NavigateTo("/page/1");
            };

            ((MonoWebAssemblyJSRuntime)JSRuntime).InvokeUnmarshalled <Action <string>, bool>("blazorDemoInterop.executeWithToken", action);
        }
        protected async void Save()
        {
            var book = CurrentBook;

            Action <string> action = async(token) =>
            {
                try
                {
                    BooksClient.Token = token;

                    await BooksClient.SaveBook(book);
                }
                catch
                {
                    // Let's suppress weird arbitrary errors
                }

                UriHelper.NavigateTo("/page/1");
            };

            await JSRuntime.Current.InvokeAsync <bool>("blazorDemoInterop.executeWithToken", action);
        }
Exemple #3
0
        protected async Task Save()
        {
            await BooksClient.SaveBook(CurrentBook);

            UriHelper.NavigateTo("/");
        }
Exemple #4
0
 protected void Save()
 {
     BooksClient.SaveBook(CurrentBook);
     UriHelper.NavigateTo("/books/index");
 }