Unplanned
Last Updated: 02 Feb 2021 10:57 by ADMIN
Oussama
Created on: 02 Feb 2021 10:56
Category: Window
Type: Feature Request
3
Fire OnClick for built-in actions before the built-in action

---

admin edit

At the moment this is not guaranteed and if you want to customize the behavior you should use a custom action to get the OnClick handler, and control the window through its parameters.

Here is an example of implementing a custom close button that also fires an event:

 

<TelerikWindow Visible="@IsWindowVisible" Modal="true" Centered="true">
    <WindowTitle>WindowTitle</WindowTitle>
    <WindowContent>
        lorem ipsum
    </WindowContent>
    <WindowActions>
        <WindowAction Name="MyCustomAction" Icon="close" OnClick="@HandleCancel" />
    </WindowActions>
</TelerikWindow>

@code{
    bool IsWindowVisible { get; set; } = true;

    async Task HandleCancel()
    {
        Console.WriteLine("my custom click happened");
        IsWindowVisible = false;//hide the window with your own code if you also want to do that
    }
}

 

---
0 comments