AddHandler Event for Outlookbaritem

2 posts, 0 answers
  1. Manikandan
    Manikandan avatar
    15 posts
    Member since:
    Jul 2013

    Posted 01 Aug 2013 Link to this post

    Hi Telerik Team,

    When applied on Outlookbar, the AddHandler event is raised.

    But when i wire it for the outlookbaritem, it is not raised. why?

    Thanks
    Manikandan
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 05 Aug 2013 Link to this post

    Hi Manikandan,

    I am not sure which event you need to subscribe to. However, it is most likely that the RadOutlookBarItem handles that event and this is why you can not catch it in you handler. However, if you try to listen for the already handled events you will be able to hear it.

    Lets say that you need to subscribe to the MouseLeftButtonDown event of the RadOutlookBarItem with x:Name="testItem". This event is internally handled and if you try to subscribe to it in XAML with the default event handler, your handler will not be invoked. This is why you need to subscribe in code like this:
    public MainPage()
    {
        InitializeComponent();
        this.testitem.AddHandler ( RadOutlookBarItem.MouseLeftButtonDownEvent, new MouseButtonEventHandler ( OnMouseDown ), true );
    }
     
    private void OnMouseDown(object sender, MouseButtonEventArgs e)
    {
    }
    Please give this approach a try and let me know if it works for you.

    Regards,
    Pavel R. Pavlov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
Back to Top