Overriding or removing an event?

2 posts, 0 answers
  1. Alex
    Alex avatar
    16 posts
    Member since:
    Nov 2013

    Posted 23 Sep Link to this post

    I'm trying to override or remove the ability to click directly on the content of a DesktopAlert. My problem is that when you set the alert's content to a plain string, it acts as a link-button and upon clicking the text, it will close the window. This is a problem since there are certain DesktopAlerts that I don't want to be closed at all. I can set it as Enabled = False but then the dropdown menu and other parts of the alert quit functioning. This is all created from code behind so it is a little harder for me to set any properties or templates for it in XAML. I thought perhaps I should post in this forum and see if there is a way to not only remove the ability to click the content, but also to remove/override events in code-behind in general for WPF controls created server-side.

    Dim mainAlert = New RadDesktopAlert() With {
        .Header = "Messages",
        .Content = "You have " & unreadCount & " new messages",
        .Height = 75,
        .Width = 300,
        .IconTemplate = TryCast(Application.Current.FindResource("radIconTemplate"), DataTemplate),
        .IconColumnWidth = 30,
        .IconMargin = New Thickness(5, 10, 15, 0),
        .CanAutoClose = False,
        .ShowCloseButton = False,
        .Tag = "main",
        .ShowMenuButton = True,
        .MenuItemsSource = GetDesktopAlertMenuItems

  2. Nasko
    Nasko avatar
    555 posts

    Posted 26 Sep Link to this post

    Hello Alex,

    We have noticed that you have asked the exact same question here. Please, check the provided answer there.

    As for your question concerning the events. In order to handle events that already been handled by the control and execute some logic in that event you could use the RegisterClassHandler method of the EventManager class - thus events that are already handled by the control will be raised as expected.

    We hope this will help you.

    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft R3 2016 release webinar banner
Back to Top