diff --git a/.gitignore b/.gitignore index 7a280546..3359c45e 100644 --- a/.gitignore +++ b/.gitignore @@ -347,3 +347,4 @@ Radzen.Blazor.min.js *.md /.gitignore /.gitignore +RadzenBlazorDemos/wwwroot/demos diff --git a/RadzenBlazorDemos/Pages/DashboardPage.razor b/RadzenBlazorDemos/Pages/DashboardPage.razor index 4bc6c0ee..108db1bb 100644 --- a/RadzenBlazorDemos/Pages/DashboardPage.razor +++ b/RadzenBlazorDemos/Pages/DashboardPage.razor @@ -12,6 +12,6 @@ Blazor GitHub Issues - + \ No newline at end of file diff --git a/RadzenBlazorDemos/Pages/DataGridColumnTemplatePage.razor b/RadzenBlazorDemos/Pages/DataGridColumnTemplatePage.razor index 6466fed5..bb416e5c 100644 --- a/RadzenBlazorDemos/Pages/DataGridColumnTemplatePage.razor +++ b/RadzenBlazorDemos/Pages/DataGridColumnTemplatePage.razor @@ -12,6 +12,6 @@ data formatting and HTML embedding. -() { "DialogCardPage.razor" })> +() { "/demos/Pages/DialogCardPage.razor" })> diff --git a/RadzenBlazorDemos/Pages/DataGridFilterApiPage.razor b/RadzenBlazorDemos/Pages/DataGridFilterApiPage.razor index 5d0494a1..81478567 100644 --- a/RadzenBlazorDemos/Pages/DataGridFilterApiPage.razor +++ b/RadzenBlazorDemos/Pages/DataGridFilterApiPage.razor @@ -7,6 +7,6 @@ Set the initial filter of your RadzenDataGrid via the FilterValue and FilterOperator column properties. - + diff --git a/RadzenBlazorDemos/Pages/DataGridFooterTotalsPage.razor b/RadzenBlazorDemos/Pages/DataGridFooterTotalsPage.razor index df7a8059..57e0a0cc 100644 --- a/RadzenBlazorDemos/Pages/DataGridFooterTotalsPage.razor +++ b/RadzenBlazorDemos/Pages/DataGridFooterTotalsPage.razor @@ -7,6 +7,6 @@ The FooterTemplate column property allows you to display aggregated data in the column footer. - + diff --git a/RadzenBlazorDemos/Pages/DataGridODataPage.razor b/RadzenBlazorDemos/Pages/DataGridODataPage.razor index 10c2ea57..36571f46 100644 --- a/RadzenBlazorDemos/Pages/DataGridODataPage.razor +++ b/RadzenBlazorDemos/Pages/DataGridODataPage.razor @@ -7,6 +7,6 @@ Use the LoadData event to get data from a REST service. - + diff --git a/RadzenBlazorDemos/Pages/DialogPage.razor b/RadzenBlazorDemos/Pages/DialogPage.razor index a5abc674..9377bc70 100644 --- a/RadzenBlazorDemos/Pages/DialogPage.razor +++ b/RadzenBlazorDemos/Pages/DialogPage.razor @@ -13,7 +13,7 @@ Open page as a dialog -() { "DialogCardPage.razor" })> +() { "/demos/Pages/DialogCardPage.razor" })> @@ -75,6 +75,6 @@ to update dialog properties -() { "DialogWithCascadingValueImplementation.razor" })> +() { "/demos/Pages/DialogWithCascadingValueImplementation.razor" })> diff --git a/RadzenBlazorDemos/Pages/ExportToExcelCsvPage.razor b/RadzenBlazorDemos/Pages/ExportToExcelCsvPage.razor index 2e82c2c8..295d4ac3 100644 --- a/RadzenBlazorDemos/Pages/ExportToExcelCsvPage.razor +++ b/RadzenBlazorDemos/Pages/ExportToExcelCsvPage.razor @@ -7,6 +7,6 @@ This page demonstrates how to export a Radzen Blazor DataGrid to Excel and CSV. - + \ No newline at end of file diff --git a/RadzenBlazorDemos/Pages/HtmlEditorCustomToolsPage.razor b/RadzenBlazorDemos/Pages/HtmlEditorCustomToolsPage.razor index 2b737882..688fd9ec 100644 --- a/RadzenBlazorDemos/Pages/HtmlEditorCustomToolsPage.razor +++ b/RadzenBlazorDemos/Pages/HtmlEditorCustomToolsPage.razor @@ -30,6 +30,6 @@ Custom dialog - + diff --git a/RadzenBlazorDemos/Pages/HtmlEditorPage.razor b/RadzenBlazorDemos/Pages/HtmlEditorPage.razor index 5c3fced5..076955b1 100644 --- a/RadzenBlazorDemos/Pages/HtmlEditorPage.razor +++ b/RadzenBlazorDemos/Pages/HtmlEditorPage.razor @@ -76,7 +76,7 @@ The Radzen HtmlEditor supports the following tools: <RadzenHtmlEditor @@bind-Value=@@htmlValue UploadUrl="upload/image" />. For a sample implementation check the UploadController.cs tab. - + diff --git a/RadzenBlazorDemos/Pages/SchedulerPage.razor b/RadzenBlazorDemos/Pages/SchedulerPage.razor index d4d6f3da..0776a797 100644 --- a/RadzenBlazorDemos/Pages/SchedulerPage.razor +++ b/RadzenBlazorDemos/Pages/SchedulerPage.razor @@ -11,7 +11,7 @@ Day, week and month views - + @@ -22,7 +22,7 @@ Plan out the whole year with <RadzenYearPlannerView /> and <RadzenYearTimelineView />. - + @@ -30,7 +30,7 @@ Display additional content when the user hovers an appointment - + @@ -38,7 +38,7 @@ Display any number of days side-by-side - + diff --git a/RadzenBlazorDemos/Pages/UploadPage.razor b/RadzenBlazorDemos/Pages/UploadPage.razor index 7480c241..a07f1e32 100644 --- a/RadzenBlazorDemos/Pages/UploadPage.razor +++ b/RadzenBlazorDemos/Pages/UploadPage.razor @@ -23,7 +23,7 @@ To upload files to a server set the Url property of the component. The URL should point to an action method in your server-side code that handles the file upload. - + @@ -32,7 +32,7 @@ To upload multiple files set the Multiple property of the component to true. - + @@ -41,7 +41,7 @@ To trigger the upload from code set the Auto property of the component to false. The upload can be triggered by calling the Upload() method of the component. - + @@ -50,7 +50,7 @@ To filter the files that can be uploaded use the Accept property of the component. The Value should be a comma separated list unique file type specifiers - + @@ -59,7 +59,7 @@ To send additional parameters with the upload request use the Url property of the component. - + @@ -68,7 +68,7 @@ This demo shows how to use the RadzenProgressBar component to show upload progress by handling the Progress event. - + @@ -77,7 +77,7 @@ This demo shows how to use the RadzenUpload component to allow users to drag and drop files for upload. The ChooseText property is used to set the text displayed when no files are selected. - + @@ -86,7 +86,7 @@ To send custom HTTP headers with the upload request use RadzenUploadHeader. - + @@ -96,7 +96,7 @@ To specify the action method parameter name use the ParameterName property of the component. The value should be a string. By default the parameter name is file or files if the Multiple property is set to true. - + diff --git a/RadzenBlazorDemos/RadzenBlazorDemos.csproj b/RadzenBlazorDemos/RadzenBlazorDemos.csproj index e5b1a061..d4a14a99 100644 --- a/RadzenBlazorDemos/RadzenBlazorDemos.csproj +++ b/RadzenBlazorDemos/RadzenBlazorDemos.csproj @@ -25,4 +25,21 @@ true + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/RadzenBlazorDemos/Shared/CodeViewer.razor b/RadzenBlazorDemos/Shared/CodeViewer.razor index 2d55be4e..f324538a 100644 --- a/RadzenBlazorDemos/Shared/CodeViewer.razor +++ b/RadzenBlazorDemos/Shared/CodeViewer.razor @@ -1,6 +1,9 @@ @using System.Text.RegularExpressions; +@using System.IO; +@using System.Net.Http; @inject IJSRuntime JSRuntime @inject CompilerService Compiler +@inject HttpClient Http @@ -73,7 +76,7 @@ string ComponentSourceHref => ComponentSource ?? $"https://github.com/radzenhq/radzen-blazor/blob/master/Radzen.Blazor/Radzen{ComponentName}.razor.cs"; - string PageSourceHref => $"https://raw.githubusercontent.com/radzenhq/radzen-blazor/master/RadzenBlazorDemos/Pages/{PageName}"; + string PageSourceHref => Path.ChangeExtension(PageName != null && PageName.StartsWith("/") ? PageName : $"/demos/Pages/{PageName}", ".txt"); protected override async Task OnParametersSetAsync() { language = PageName == null ? "razor" : PageName.EndsWith(".razor") ? "razor" : "csharp"; @@ -92,9 +95,7 @@ async Task Fetch() { - using var http = new HttpClient(); - - return await http.GetStringAsync(PageSourceHref); + return await Http.GetStringAsync(PageSourceHref); } string Clean(string source) @@ -118,6 +119,8 @@ await OnValueChanged(source); } + + bool isBusy; async Task Run()