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

OutlookBar MouseDown event behavior different depending on size

1 Answer 46 Views
OutlookBar
This is a migrated thread and some comments may be shown as answers.
Brian Pratt
Top achievements
Rank 1
Brian Pratt asked on 25 Oct 2010, 04:31 PM
I'm using MVVM, PRISM with an outlook bar as a Prism region.

I have made a custom command that changes the main region when an OutlookBaritem is mouse down.  (think MS Outlook, when you click on the 'calendar' bar).  When the OutlookBarItems are bars, everything works fine, but when the application first starts, the outlook bars are minimized to buttons.  

What I noticed:
The mouse down event does not fire when the OutlookBarItem is minimized to a button instead of a bar.
Question:
Is this normal behavior?  
If so, this seems like illogical behavior.  A mouse down on a OutlookBarItem should fire regardless of it's display mode.  (I would assume that when minimized, a different template is used, with a button that has a click event instead of a UIElement that has a MouseDown event?)

Thanks, 
Brian

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 28 Oct 2010, 05:16 PM
Hello Brian Pratt,

This behavior is expected at the moment since the minimized items are of type MinimizedOutlookBarItem, which is different from the RadOutlookBarItem. Therefore a simplified approach towards similar scenario can be something similar to this:
public MainPage()
{
    InitializeComponent();
    radOutlookBar.AddHandler(FrameworkElement.MouseLeftButtonDownEvent, new MouseButtonEventHandler(RadOutlookBarItem_MouseLeftButtonDown), true);
}
 
private void RadOutlookBarItem_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
    if ((e.OriginalSource as UIElement).ParentOfType<MinimizedOutlookBarItem>() != null || (e.OriginalSource as UIElement).ParentOfType<RadOutlookBarItem>() != null)
        MessageBox.Show("TheOutllokBarItemWasClicked");
}

I hope you can implement such an approach in your scenario. However, we will be working on the RadOutlookBar in the following months in order to allow the RadOutlookBarItems to access their corresponding  minimized items.

Greetings,
Tina Stancheva
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
OutlookBar
Asked by
Brian Pratt
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or