Reminder and Commands

2 posts, 0 answers
  1. Eric Schoenholzer
    Eric Schoenholzer avatar
    138 posts
    Member since:
    Mar 2004

    Posted 17 Feb 2012 Link to this post


    Is it possible (or good idea) to use the Reminder in a ICommand CanExecute method, specially Notify()?

    I'm using a RadContextMenu and the command are dependent of Trial or not Trial.

    Or how you would use the reminder in a such scenario?
    (I'm not using MVVM, so calling Notify would be ok for me)


  2. Todor
    Todor avatar
    772 posts

    Posted 21 Feb 2012 Link to this post

    Hi Eric,

    Thank you for your question.

    The CanExecute method is used to determine whether a command can be executed, and it shouldn't have any side effects like displaying a trial reminder notification, which is what reminder's Notify method does. This is why the Notify method should be in the Execute method when used with commands. In CanExecute you can use the IsTrialExpired property to correctly determine whether the command should be executable or not. I have attached a sample project with an example. Please note, that we have just made some changes in the ContextMenu logic, so in order to make the sample project run correctly, you will have to download our latest internal build from the Downloads section of you account.

    All the best,
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
Back to Top