windows phone mango - differences between click and tap - windows-phone-7

Can anybody give me more details on this?
I know that tap is coming from gestures, but I'd like to know more on WP7 events model.
For instance how following scenarions work:
stackpanel with tap event and checkbox inside which handles click
container with tap and any framework element also with tap, etc.
Which events have more priority and if is it possible to mask events?
What kind of event bubbling is used here from top to bottom or vice-versa?

If you're using WP7.1 SDK the easiest thing to make things consistent would be to use the Tap event everywhere (it's available on all UIElement derived controls). Tap events are bubbled up from the lowest control in the visual tree until a handler is found.
Then you don't need to worry about if/when Click and Tap will clash.

Related

Nativescript Vue: How to dismiss searchBar keyboard when scrolling ListView?

I have a SearchBar component and a ListView component. When I tap the search bar, the keyboard comes up but it stays up even if the user decides to scroll ListView under it. I can't seem to find either
1) any event on the ListView that I can trigger the search bar to close on when it's scrolling
--or--
2) any event on the search bar that I can check to see if it's not focused , then close it.
Either of those would be sufficient but I can't seem to find any in the documentation.
Both components are independent of each other, you must call dismissSoftInput() on the search bar upon scroll.
Unfortunately the scroll event is not supported out of the box while using ListView. There is an open feature request on Github, which also discusses how you may implement this event with an override & bit of native code in your project. You may also consider using RadListView, supports scroll events out of the box.

After assigning GetViewForAnnotation, Xamarin.Forms class doesn't receive Click event

I have a Xamarin.Forms page with a map containing numerous pins. I've built a custom iOS renderer to change the image of the displayed pin.
Once I assign the GetViewForAnnotation delegate, my Xamarin.Forms class no longer receives the "Clicked" event. I can access it through the custom renderer, I do believe, but what I want to do when the user taps the title of the pin is push another Xamarin.Forms page to the navigation stack, and I don't know how to give control back to my Xamarin.Forms app from within my Xamarin.iOS app.
I have a feeling I'll need this type of logic in a few other places... where I need to handle a CustomRenderer event but then pass control back to the Xamarin.Forms app for navigation or other purposes.
So I have a couple directions I'd like to go:
1 - More straightforward - get my "Clicked" event to fire in the Xamarin.Forms app when the map's pin is clicked, even though the iOS app is handling the creation of the pin via a CustomRenderer
2 - More advanced and customizable - pass control back to my Xamarin.Forms app (maybe raise an event related to the Renderer level?)
I'd prefer at this time to just get my Clicked event back, but I'm guessing that may not work once I assign the GetViewForAnnotation event in the CustomRenderer.
From what I read, you can detect the annotation click within your renderer.
Within your renderer in the OnElementChanged you can get access to the View in the Xamarin.Forms PCL it relates to.
A few possibilities to consider going forward:-
a) Use MessagingCenter to convey messaging between interests (see
here).
b) Use the standard event raising, i.e. public event
EventHandler<someEventArgs> OnSomeEvent through your View in your
PCL.
c) Use an ICommand approach on your View in your PCL if your
more MVVM orientated, and invoke this way instead.
Once you have your notification back through your View / Page, depending on where your doing things, you can then do a normal navigation based on the information you have been given from your platform-specific renderer in the PCL.

How to check if tapped region falls inside a PopUp Control

I am using tap event listener from wp toolkit. In my app I show a pop up screen. I have defined the gesturelister to work on the Grid. In capturing the Tap gesture event, I get the screen coordinates (i.e X and Y) where it happened.
Now i want to know if the Tap happened inside the PopUp control or outside it. How can i achieve this on wp8. I have tried many solutions but none seems to work. Please help on this.
Is the Grid under or over the PopUp Control?
If yes, the solution is pretty simple.
When the click is on the Popup the Grid will not receive it.
When the click is not on the Popup the Grid will receive it.

ListPicker separate templates for Normal and Expanded states

Is is possible to either subscribe to a ModeChanged event or to have a separate template for the Normal and Expanded states of the ListPicker control.
I am specifically looking for a way to have my text wrapped when the ListPicker is expanded (not full-screen) and not wrapped when the ListPicker is in the Normal state.
I am using this in a Windows Phone 7.1 targeted application and the GotFocus, LostFocus, and Tap events are not being fired. Right now, the only event I can look at is the SizeChanged event to look at switching templates by looking at the ListPickerMode status.
The ListPicker supports 2 separate templates, one for each scenario.
Use ItemTemplate for the expanded view.
Use FullModeItemTemplate for the full page view.

Windows Phone Map control has unresponsive pinch zoom

I'm seeing very spotty/unresponsive behavior with the silverlight map control on Windows Phone 7 (Microsoft.Phone.Controls.Map). The map control doesn't seem to pick up a lot of my pinch gestures. Is anyone else seeing this? Is there a way a workaround?
Just as an experiment I hooked up custom gesture listeners to PinchStarted, PinchDelta and PinchCompleted. My event handlers are getting fired every time I pinch, but the Silverlight map control doesn't pick them "most" of the times.
PS. I'm using the most up to date SDK/Toolkits.
After talking to our Microsoft contact we have no answers for the pinch performance problems. The official side stepped our question but and recommend putting a +/- buttons on the map for zooming in and out of the Map. To show the +/- buttons use the ZoomBarVisible property.

Resources