This is a migrated thread and some comments may be shown as answers.

WPF RadDesktopAlert with Buttons

3 Answers 233 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jai
Top achievements
Rank 1
Jai asked on 12 Apr 2017, 05:14 PM
Hi Telerik,
I need your quick suggestion on the below requirement for our reputed Client (Transportation domain).
We are using the RaddesktopAlert and have an immediate requirement to have some buttons  on RaddesktopAlert to perform some functionalities. I came across that RaddesktopAlert for Winforms supports this but don't have any idea how to achieve the same on RaddesktopAlert for WPF.
Any help on this one will be grateful :)

3 Answers, 1 is accepted

Sort by
0
Accepted
Nasko
Telerik team
answered on 13 Apr 2017, 07:39 AM
Hello Jai,

In order to achieve the desired appearance of RadDesktopAlert you need to modify its default Template. So, basically you need to create a custom Style for RadDesktopAlert based on its default one. After that you need to place the desired Button inside its ControlTemplate with key x:Key="RadDesktopAlertTemplate".

We have created a sample project that demonstrates that. Please, check it and let us know if it worked for you - notice that Implicit Styles were used.

We have also noticed that you have asked the exact same question on several other forum threads. We have provided the answer to them as well in order to be available for the other members of the community. However, please lets continue our discussion in the current forum thread, so that we could follow the communication more easily.

Hope this helps.

Regards,
Nasko
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
RJ
Top achievements
Rank 1
answered on 14 Jan 2018, 08:16 AM
Hi, I had tried the sample solution provided. What code can we add that after I click the button will close the alert automatically?
0
Martin Ivanov
Telerik team
answered on 17 Jan 2018, 11:36 AM
Hello RJ,

As I understand you want to close the alert when you click on a button. If this is so, note that the control has a built-in close button displayed by default. If you want to show a custom button as shown in the Nasko's example and execute an action that closes the alert, you can use the DesktopAlertCommands.Close routed command.
<Button Command="telerik:DesktopAlertCommands.Close"  />

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
General Discussions
Asked by
Jai
Top achievements
Rank 1
Answers by
Nasko
Telerik team
RJ
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or