WPF and Desktop Alert

8 posts, 0 answers
  1. Clément
    Clément avatar
    5 posts
    Member since:
    Jul 2015

    Posted 25 Jul 2015 Link to this post

    Hi, 

     

     

    I'm new to Telerik and I use a trial version of telerik devcraft.

    I'd like to use a Desktop Alert in VB.Net and WPF but I don't know how, and I don't find any documentation for it. Can you explain me how to use it ?

     

     

    Thanks,

    Clément.

  2. Clément
    Clément avatar
    5 posts
    Member since:
    Jul 2015

    Posted 26 Jul 2015 in reply to Clément Link to this post

    PS : I'm using VS2015
  3. UI for WPF is Visual Studio 2017 Ready
  4. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 28 Jul 2015 Link to this post

    Hi Clément,

    In order to show a DesktopAlert, you would need firstly to create an instance of RadDesktopAlertManager:

    Dim manager = New RadDesktopAlertManager()

    And then using its ShowAlert method to show the alert:

    Dim alert = New RadDesktopAlert() With {
        Key .Header = "MAIL NOTIFICATION",
        Key .Content = "Hello, Here are two things that we noticed today on our daily meeting.",
        Key .Command = New DelegateCommand(OnCommandExecuted),
        Key .ShowDuration = 5000
    }
    manager.ShowAlert(alert)

    For details regarding the control, you can check the DesktopAlert online documentation on the following link:
    http://docs.telerik.com/devtools/wpf/controls/raddesktopalert/getting-started

    Hope this helps.

    Regards,
    Kalin
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Clément
    Clément avatar
    5 posts
    Member since:
    Jul 2015

    Posted 28 Jul 2015 in reply to Kalin Link to this post

    Thanks Kalin, I have to others questions : is this possible to manage the opacity of the alert ? 

    alert.opacity = 75 for exemple isn't working

    And is this possible to change the animation to make the alert appear by a slide up or slide down ? 

    Thanks,

    Clément

  6. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 29 Jul 2015 Link to this post

    Hi Clément,

    The Opacity property works with values from 0 to 1, so try setting it in that range the see result. However with the current implementation this would be only initially applied - when you mouse enter and then mouse leave the control the opacity would be set to 0.9. This done from a StoryBoard named DesktopAlertOnMouseLeave inside of the DesktopAlert Styles - you can modify it there as per your needs.

    As for the other question you can check the following article from our help documentation that explains how to change the Show/Hide animation either with single or multiple ones:
    http://docs.telerik.com/devtools/wpf/controls/raddesktopalert/how-to/apply-multiple-animations-for-showing-and-hiding-raddesktopalert

    You can also check this demo from our XAML SDK Repository:
    https://github.com/telerik/xaml-sdk/tree/master/DesktopAlert/ShowingAndHidingUsingAnimationGroup

    As well as you can check the Configurator DesktopAlert example in our WPF Demos where more different animations are demonstrated:
    http://demos.telerik.com/wpf/

    Hope this helps.

    Regards,
    Kalin
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  7. Clément
    Clément avatar
    5 posts
    Member since:
    Jul 2015

    Posted 29 Jul 2015 in reply to Kalin Link to this post

    Is there anything else to import than Telerik.Windows.Controls ?

    Because if I do :

            Dim alert = New RadDesktopAlert
            alert.Header = "Header"
            alert.Content = "Content"
            alert.ShowDuration = 6000
            Dim manager = New RadDesktopAlertManager(AlertScreenPosition.TopRight, New System.Windows.Point(-5, 5))
            manager.ShowAnimation = New FadeAnimation() With
    {
        Key.Direction = AnimationDirection.Out,
        Key.MinOpacity = 0.5,
        Key.MaxOpacity = 0.9,
        Key.SpeedRatio = 0.5
    }
            manager.ShowAlert(alert)

    the part "manager.ShowAnimation(...)" isn't working (FadeAnimation isn't declared and I have 4 errors like this : "Name of field or property being initialized in an object initializer must start with '.'")


     
  8. Clément
    Clément avatar
    5 posts
    Member since:
    Jul 2015

    Posted 29 Jul 2015 in reply to Clément Link to this post

    EDIT : Solved by removing "key"

     

    There is my last question : How to set alert Icon ? I tried :

    alert.Icon = New BitmapImage() With {.UriSource = New Uri("pack://application:,,,/questions1.png")}

    But it's not working (there is no icon when the alert is shown) and code you provide in support is not working too  


     
  9. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 30 Jul 2015 Link to this post

    Hi Clément,

    When setting the Icon you would need to also set the IconColumnWidth property with the desired size reserved for the icon. You can also check the IconMargin property for more precise aligning the icon of RadDesktopAlert.

    Hope this helps.

    Regards,
    Kalin
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WPF is Visual Studio 2017 Ready