Skip to content

Commit fe6dfd8

Browse files
chore(window): list specifics for using a custom icon for a built-in … (#1840)
* chore(window): list specifics for using a custom icon for a built-in action * Update components/window/actions.md Co-authored-by: Radko Stanev <[email protected]> * chore(window): address feedback --------- Co-authored-by: Radko Stanev <[email protected]>
1 parent ae91f19 commit fe6dfd8

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

components/window/actions.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Action buttons expose the following properties:
6565
}
6666
````
6767

68+
>Setting a custom icon for a built-in action is not supported as the Window will override it and use the default icon for the corresponding built-in action. If you need to specify a custom icon, use a [custom action](#custom-actions) instead of the built-in one.
6869
6970
## Custom Actions
7071

@@ -75,9 +76,12 @@ You can create a custom action icon and you must provide its `OnClick` handler.
7576
````CSHTML
7677
Custom actions can call C# directly
7778
78-
<TelerikWindow Visible="true">
79+
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet" />
80+
81+
<TelerikWindow Visible="@WindowVisible">
7982
<WindowActions>
80-
<WindowAction Name="MyAction" Icon="@SvgIcon.Gear" OnClick="@MyCustomActionHandler" />
83+
<WindowAction Title="MyAction" Icon="@SvgIcon.Gear" OnClick="@MyCustomActionHandler" />
84+
<WindowAction Title="CustomClose" Icon="@("fas fa-x")" OnClick="@(()=> WindowVisible = false)" />
8185
</WindowActions>
8286
<WindowContent>
8387
@result
@@ -86,9 +90,17 @@ Custom actions can call C# directly
8690
</WindowContent>
8791
</TelerikWindow>
8892
93+
@if (!WindowVisible)
94+
{
95+
<TelerikButton OnClick="@( () => WindowVisible=true )">Show the Window</TelerikButton>
96+
}
97+
8998
@code {
90-
string result;
91-
public void MyCustomActionHandler()
99+
private bool WindowVisible { get; set; } = true;
100+
101+
private string result;
102+
103+
private void MyCustomActionHandler()
92104
{
93105
result = "custom action button clicked on: " + DateTime.Now.ToString();
94106

0 commit comments

Comments
 (0)