-
Notifications
You must be signed in to change notification settings - Fork 352
/
Copy pathPageWithEmptyLayout.razor
59 lines (46 loc) · 2.1 KB
/
PageWithEmptyLayout.razor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
@page "/interactive-page-empty-layout"
@layout EmptyLayout
@rendermode InteractiveServer
<PageTitle>Interactive Page with Empty Layout in Static App</PageTitle>
<LayoutContainer>
<h1>Interactive Page with Empty Layout</h1>
<Notes PageInteractivity="interactive" AppInteractivity="static">
<Explanation>
<strong>
Thе page uses an empty non-interactive layout (<code>EmptyLayout.razor</code>),
and all the content from <code>MainLayout.razor</code> is copied to <code>Shared/LayoutContainer.razor</code>
(including the scoped CSS in <code>MainLayout.razor.css</code>).
</strong>
The <code>TelerikRootComponent</code> is inside <code>LayoutContainer.razor</code>.
The benefit of this approach, compared to <code>InteractivePage.razor</code> and <code>InteractiveIslands.razor</code> is
that the <code>TelerikRootComponent</code> wraps all the page content, which ensures correct position of the Telerik popups.
</Explanation>
</Notes>
<TelerikDatePicker @bind-Value="@DatePickerValue"
Width="200px" />
<TelerikButton OnClick="@( () => WindowVisible = !WindowVisible )">Toggle Window</TelerikButton>
<TelerikWindow @bind-Visible="@WindowVisible" Width="300px" Height="200px">
<WindowTitle>Telerik Window</WindowTitle>
<WindowActions>
<WindowAction Name="Close" />
</WindowActions>
<WindowContent>
Window Content
</WindowContent>
</TelerikWindow>
<TelerikDialogHelper @ref="@DialogHelperRef" />
<TelerikButton OnClick="@OnButtonClick">Show Dialog With Helper</TelerikButton>
<DialogAwareComponent />
</LayoutContainer>
@code {
private DateTime DatePickerValue { get; set; } = DateTime.Today;
private TelerikDialogHelper? DialogHelperRef { get; set; }
private bool WindowVisible { get; set; }
private async Task OnButtonClick()
{
if (DialogHelperRef != null)
{
await DialogHelperRef.AlertAsync("Telerik DialogFactory");
}
}
}