This project is read-only.

ElementFlow MouseEvents

Apr 21, 2008 at 1:51 PM
Sorry if this is a very beginner question, but I started my WPF experience last night. :-)

Is there a way to get mouse click events on the selected item within the ElementFlow?

I've been able to get them on the itemcontrol and elementflow, but how do I determine if the click was on an item.

Thanks for the help.
Apr 21, 2008 at 9:13 PM

I've been able to get it working by making the TryViewportHitTest method public in ElementFlow.cs.

Is there a better way without modifying the code?
May 5, 2008 at 9:52 PM
Hi there,
Can you describe your scenario to me. I might be able to abstract things out a bit to make the mouse/keyboard events more accessible.
May 6, 2008 at 12:50 AM

In my scenario I would like to act on both double clicks and right mouse clicks on a particular item. The issue that I was seeing was that I could capture the click(s), but I couldn't determine if the click was from itemA or itemB or anywhere else on the itemcontrol.

Thanks for your response and any help you can give. Love the control. Sorry also, if these are dumb requests... FluidKit was the first WPF code that I've ever played with.
May 13, 2008 at 7:13 AM
Has anyone worked out how to do this?  All I need to be able to do is double-click an image in the carousel and perform an action based on the image Tag. 
May 13, 2008 at 12:29 PM

Here's how I did it...

In ElementFlow.cs -  change TryViewportHitTest from private to public.

Here's a simple stub for checking on a MouseDown event in the client app -

        private void _elementFlow_MouseDown(Object sender, System.Windows.Input.MouseButtonEventArgs e)
        {

            Point position = e.GetPosition(this);
            //Get the item selected
            int selection = this._elementFlow.TryViewportHitTest(position);
            if (selection != -1)
            {
                if (e.ClickCount > 1)
                {
                      //Perform DoubleClick Action

                }
            }
        }

May 13, 2008 at 2:45 PM
Hi rralston4, thank you for the reply and suggestion.

I made it public, but get this error when i try to build.

Error 6 'FluidKit.Controls.ElementFlow' does not contain a definition for 'TryViewportHitTest' and no extension method 'TryViewportHitTest' accepting a first argument of type 'FluidKit.Controls.ElementFlow' could be found (are you missing a using directive or an assembly reference?) 

Did you get this at any time?

Cheers

May 13, 2008 at 2:51 PM
You probably need to update your reference to the FluidKit library...  just remove it and re-add
May 13, 2008 at 2:55 PM
Hi rralston4, thank you for the reply and suggestion.

I made it public, but get this error when i try to build.

Error 6 'FluidKit.Controls.ElementFlow' does not contain a definition for 'TryViewportHitTest' and no extension method 'TryViewportHitTest' accepting a first argument of type 'FluidKit.Controls.ElementFlow' could be found (are you missing a using directive or an assembly reference?) 

Did you get this at any time?

Cheers