You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/window/overview.md
+27-1Lines changed: 27 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ To create a Telerik Window:
42
42
43
43
The Window component is of type `Telerik.Blazor.Components.Window.TelerikWindow` and exposes several properties and methods that let you control its state. The most important ones are the `Visible` property that lets you control whether it is shown on the initial view render, and the `Show` and `Close` methods that control its visibility programmatically.
44
44
45
-
>caption Store a reference to a Telerik Window, open and close it programmatically
45
+
>caption Store a reference to a Telerik Window, open and close it programmatically through methods
46
46
47
47
````CSHTML
48
48
@using Telerik.Blazor.Components.Window
@@ -75,6 +75,32 @@ The Window component is of type `Telerik.Blazor.Components.Window.TelerikWindow`
75
75
}
76
76
````
77
77
78
+
>caption Show and close a Window by toggling a single variable
79
+
80
+
````CSHTML
81
+
@using Telerik.Blazor.Components.Window
82
+
83
+
<button onclick="@ToggleWindow">Toggle the Window</button>
84
+
85
+
<TelerikWindow Visible="@isWindowShown">
86
+
<TelerikWindowTitle>
87
+
<strong>The Title</strong>
88
+
</TelerikWindowTitle>
89
+
<TelerikWindowContent>
90
+
This is my window <strong>popup</strong> content.
91
+
</TelerikWindowContent>
92
+
</TelerikWindow>
93
+
94
+
@functions {
95
+
bool isWindowShown { get; set; }
96
+
97
+
public void ToggleWindow()
98
+
{
99
+
isWindowShown = !isWindowShown;
100
+
}
101
+
}
102
+
````
103
+
78
104
## Styling
79
105
80
106
The `Class` property lets you define a CSS class that will be rendered on the popup element so you can cascade through it in order to change the appearane of both the content, and the built-in elements of the Window.
0 commit comments