Skip to content

Commit 91a8896

Browse files
Apostolos GiatsidisDimo Dimovdimodintacheva
authored
docs(window): Overview Revamp and new features (#874)
* docs(window): Overview Revamp and new features * Window overview polish * Window Overview and Size polish * Window docs polish even more * Window docs polish even more 2 * docs(window): Polish all Window pages * Remove Window images * Update components/window/overview.md Co-authored-by: Nadezhda Tacheva <[email protected]> * Update components/window/overview.md Co-authored-by: Nadezhda Tacheva <[email protected]> * Update components/window/overview.md Co-authored-by: Nadezhda Tacheva <[email protected]> * Actions polishing Co-authored-by: Dimo Dimov <[email protected]> Co-authored-by: Dimo Dimov <[email protected]> Co-authored-by: Nadezhda Tacheva <[email protected]>
1 parent a7c939d commit 91a8896

17 files changed

+291
-177
lines changed

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ intro_columns:
540540
-
541541
title: "Layout"
542542
items:
543-
"Window": "components/window/overview"
543+
"Window": "window-overview"
544544
"Predefined Dialogs": "dialog-predefined"
545545
"Animation Container": "components/animationcontainer/overview"
546546
"Tooltip": "tooltip-overview"

components/window/actions.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,29 @@ The Window offers action buttons in its titlebar:
2020

2121
To define action buttons, populate the `WindowActions` tag of the Window with `WindowAction` instances.
2222

23+
24+
## Action Parameters
25+
2326
Action buttons expose the following properties:
2427

25-
* `Name` - the name of the action. Can be one of the built-in actions (see above), or a custom action name.
26-
* `Hidden` - a boolean property indicating whether the action button is rendered. Do not use for `Minimize` and `Maximize` actions - the Window manages their visibility internallty, based on the component state. Check the example below for a possible alternative.
27-
* `OnClick` - event handler so you can respond to custom action clicks.
28-
* `Icon` - the CSS class name of the icon that will be rendered. You can use the [Telerik font icons]({%slug general-information/font-icons%}) directly, or your own font icon font class.
29-
* `Title` - the `title` attribute of the action button.
28+
<style>
29+
article style + table {
30+
table-layout: auto;
31+
word-break: normal;
32+
}
33+
</style>
34+
35+
| Parameter | Type and Default&nbsp;Value | Description |
36+
| --- | --- | --- |
37+
| `Name` | `string` | The name of the action. Can be one of the built-in actions (see above), or a custom action name. |
38+
| `Hidden` | `bool` | Sets if the action button is rendered. Do not use for `Minimize` and `Maximize` actions - the Window manages their visibility internally, based on the component state. Check the example below for a possible alternative. |
39+
| `OnClick` | `EventCallback<MouseEventArgs>` | An event handler to respond to custom action clicks. |
40+
| `Icon` | `string` | The CSS class of the icon to be rendered. Use with the [Telerik font icons]({%slug general-information/font-icons%}), or set your own font icon class. |
41+
| `Title` | `string` | The `title` HTML attribute of the action button. |
3042

3143

44+
## Built-in Actions
45+
3246
>caption The built-in actions of a Window
3347
3448
````CSHTML
@@ -56,9 +70,8 @@ Action buttons expose the following properties:
5670
}
5771
````
5872

59-
>caption The result from the code snippet above
6073

61-
![](images/built-in-actions.png)
74+
## Custom Actions
6275

6376
You can create a custom action icon and you must provide its `OnClick` handler.
6477

@@ -89,9 +102,8 @@ Custom actions can call C# directly
89102
}
90103
````
91104

92-
>caption The result from the code snippet above
93105

94-
![](images/custom-action.png)
106+
## Using Both Action Types
95107

96108
You can mix custom actions with built-in actions, and you do not have to define all of the available ones.
97109

@@ -130,11 +142,7 @@ You can mix custom actions with built-in actions, and you do not have to define
130142
}
131143
````
132144

133-
>caption The result from the code snippet above
134-
135-
![](images/mixed-actions.png)
136-
137145

138146
## See Also
139147

140-
* [Live Demo: Window Actions](https://demos.telerik.com/blazor-ui/window/actions)
148+
* [Live Demo: Window Actions](https://demos.telerik.com/blazor-ui/window/actions)

components/window/events.md

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ This article explains the events available in the Telerik Window for Blazor:
1515

1616
* [VisibleChanged](#visiblechanged)
1717
* [StateChanged](#statechanged)
18+
* [WidthChanged and HeightChanged](#widthchanged-and-heightchanged)
1819
* [Action Click](#action-click)
1920
* [LeftChanged and TopChanged](#leftchanged-and-topchanged)
20-
2121
@[template](/_contentTemplates/common/general-info.md#event-callback-can-be-async)
2222

2323

@@ -158,9 +158,52 @@ You can use the `StateChanged` event to get notifications when the user tries to
158158
}
159159
````
160160

161+
## WidthChanged and HeightChanged
162+
163+
You can use the `WidthChanged` and `HeightChanged` events to get notifications when the user tries to resize the window. The events requires the `Resizable` parameter of the Window to be `true`.
164+
165+
>caption React to the user actions to resizing the window
166+
167+
````CSHTML
168+
<TelerikWindow Visible="true"
169+
Resizable="true"
170+
WidthChanged="@WidthChangedHandler"
171+
HeightChanged="@HeightChangedHandler">
172+
<WindowTitle>
173+
<strong>Lorem ipsum</strong>
174+
</WindowTitle>
175+
<WindowActions>
176+
<WindowAction Name="Minimize"></WindowAction>
177+
<WindowAction Name="Maximize"></WindowAction>
178+
<WindowAction Name="Close"></WindowAction>
179+
</WindowActions>
180+
<WindowContent>
181+
<strong>Resize Me!</strong>
182+
</WindowContent>
183+
</TelerikWindow>
184+
185+
<br />
186+
187+
@EventLog
188+
189+
@code {
190+
public string EventLog { get; set; }
191+
192+
public void WidthChangedHandler()
193+
{
194+
EventLog = "WidthChanged event fired at: " + DateTime.Now.ToString();
195+
}
196+
197+
public void HeightChangedHandler()
198+
{
199+
EventLog = "HeightChanged event fired at: " + DateTime.Now.ToString();
200+
}
201+
}
202+
````
203+
161204
## Action Click
162205

163-
Actions expose the `OnClick` event. You can use it to implement custom buttons that invoke application logic from the Window's titlebar. See the [Window Actions]({%slug components/window/actions%}) article for examples.
206+
Window actions expose the `OnClick` event. You can use it to implement custom buttons that invoke application logic from the Window's titlebar. See the [Window Actions]({%slug components/window/actions%}) article for examples.
164207

165208
If you use the `OnClick` event on a built-in action, it will act as a custom action and it will no longer perform the built-in feature (for example, close the window). If you want the invoke both a built-in action and custom logic from the same button, you have two options:
166209

@@ -225,6 +268,6 @@ The `LeftChanged` event fires second, so if you intend to store locations in an
225268

226269
## See Also
227270

228-
* [Window Overview]({%slug components/window/overview%})
229-
* [Window State]({%slug components/window/size%})
230-
* [Window Actions]({%slug components/window/actions%})
271+
* [Window Overview]({%slug window-overview%})
272+
* [Window State]({%slug components/window/size%})
273+
* [Window Actions]({%slug components/window/actions%})
-4.53 KB
Binary file not shown.
-1.99 KB
Binary file not shown.
-2.54 KB
Binary file not shown.
Binary file not shown.
-1.4 KB
Binary file not shown.

components/window/modal.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,21 @@ The Window for Blazor can be modal so that the user is unable to interact with t
1414

1515
To make a modal window, set its `Modal` property to `true`.
1616

17-
````CSHTML
18-
@* Open and close a modal window *@
17+
It is possible for users to close a modal Window by clicking on the modal background around it. To allow this behavior, set `CloseOnOverlayClick` to `true`.
18+
19+
>caption Open and close a modal Window
1920
20-
<TelerikWindow Modal="true" @bind-Visible="@isModalVisible">
21+
````CSHTML
22+
<TelerikWindow Modal="true"
23+
@bind-Visible="@isModalVisible"
24+
CloseOnOverlayClick="true">
2125
<WindowTitle>
22-
<strong>The Title</strong>
26+
Window Title
2327
</WindowTitle>
2428
<WindowContent>
25-
I am modal so the page behind me is not available to the user.
29+
I am modal, so the page content behind me is not accessible to the user.
2630
</WindowContent>
2731
<WindowActions>
28-
<WindowAction Name="Minimize" />
29-
<WindowAction Name="Maximize" />
3032
<WindowAction Name="Close" />
3133
</WindowActions>
3234
</TelerikWindow>
@@ -38,8 +40,6 @@ To make a modal window, set its `Modal` property to `true`.
3840
}
3941
````
4042

41-
>note A modal window is centered.
42-
4343
## See Also
4444

45-
* [Live Demo: Modal Window Size](https://demos.telerik.com/blazor-ui/window/modal)
45+
* [Live Demo: Modal Window](https://demos.telerik.com/blazor-ui/window/modal)

0 commit comments

Comments
 (0)