WinRT: prevent ListView from scrolling when partially visible item is tapped - xaml

I have an app that shows entries in a ListView. Some entries are long, some are short. When user clicks (or taps) on a entry, app shows entry page. Pretty standard.
But there's one thing that bothers me a lot. When entry is long (and can't be fully displayed, just because phone screen is not big enough) and user taps at it, ListView automatically scrolls into the end of the entry. This is really annoying and I want it to stop.
I found exactly the same issue, but for WPF. RequestBringIntoView is not available in Windows Runtime.

When someone clicks on an item in the listView disable the listView to lock it but as Hassan has said it is not the best solution but it can save you time.

Related

Why does my AutoSuggestBox open at random?

I have a UWP/xaml application. I use AutoSuggestBox on many screens, often several of them on a screen.
I have a problem where the suggestions for one or more of these controls pop open at unwanted times, usually when a screen first renders. Nobody has clicked or tapped on the control. Furthermore, it appears to be in a weird state in which the suggestion list seems to be floating above the window containing the control, often extending outside of that window.
The problem is not consistent. I've identified a few paths that make it happen frequently, but there doesn't seem to be any explanation as to why it is happening sometimes on some controls but not others.
Frank

Button in UserControl in main page not reacting to pointer in Windows Store apps

To share a common display layout in a Split template Windows Store app, I put a Back button, title TextBlock, and another button in a UserControl, and then use that control in most of my pages. My problem is that in the main page, neither of the buttons will react to pointer activity, be it pointer over or clicking. However, it works fine in any other page. To isolate it, I created a blank app and duplicated the UserControl, but it works in that case.
How can I debug this?
Thanks.
-John
In an "ItemView" page of a "Split" template app, the Grid containing the back button and title must be below the GridView and ListView in the XAML code. Apparently the GridView, with no Grid.Row, and a Grid.RowSpan="2" needs to overlay the first and second rows, and if the button is beneath the GridView, it must assume it is not visible and doesn't need to respond to events. I moved my new user control instance to below the GridView, and the buttons work now.
This whole scheme of overlaying both rows makes no sense to me, but without the Grid.RowSpan="2", the items don't split nicely into two rows for me. I think such odd layout should have a comment explaining it in the template. Perhaps it could save someone else from this same kind of issue.

Navigating to a specific section of a page in windows 8 Javascript App

I am developing a windows 8 app using JavaScript & HTML.
I have a page which has different sections laid horizontally. I have links for these sections in another page. I want the page to load from that specific section (meaning page should start from this section).
I am using a grid template and have a listview in the main page. When i click on any item in a group ,navigate to that page and come back to the main page. I want the main screen to load from the section that i have selected before.The screen should automatically scroll to that section like how it is happening from semantic zoom.
Any help in this regard will be of great use.
Thanks
For the first part, it should be enough to set the scrollLeft property of the container to the offsetLeft property of the element you want to scroll to.
The second part can be achieved by storing the scrollPosition attribute of the ListView before navigating away and setting it to its old value after navigating back.
As Ma_li said, scroll-left is one solution -- especially for non ListView content. The key here is how much of the experience you want to maintain when navigating back. One option (again, for non-listview content) is to find the element you want to be onscreen, and calling scrollIntoView on the element. However, this only brings the item on screen -- it won't bring it all the way to the left (or right, for BIDI languages), it scrolls just enough to et the whole element on screen.
For ListViews, you should use the indexOfFirstVisibleItem (or, indexOfLastVisibleItem) to scroll the listview to the correct location. This is key, because the listview is a virtualized control, this provides the most accurate & reliable method for scrolling the listview position.
Thanks Dominic & ma_il
I tried document.getElementBy("Id").focus() for the 1st Question and it worked. But i am getting a problem in this.
I have four divs Horizontally say "divA divB divC divD"
Data for the divA is coming from cloud. When i click on the link for divD in the main screen. it is not taking me to the corresponding section for the first time as it takes some time to load the divA. when click on the link for divD second time, it takes to the respective section. It is working if i use setInterval() but the DivA is shown for few seconds when the page loads and then scrolls to divD which is not good.

Item below charms bar gets invoked when search is clicked

I have created a page with horizontal layout listview with enough items added to it have a horizontal scrollbar. When you click an item in de listview it navigates to a different page with some details about the clicked item.
Now I have added search functionality to my app by use of the search contract. That's where the problem arises. When you open the charms bar, it overlays over the listview which is good. But when I click the search icon in the charms bar search is opened, but also the listitem's (which is below the charms bar ) click event is getting invoked.
Anyone else who has seen this behaviour? It feels like a bug to me in the charms bar? Hopefully someone has seen this too and has a solution to prevent this behaviour?
Nice try, but whatever you do (Dispatching, Timer...), the click event is raised prior the OnSearchActivated.
Btw, we've "fixed" this problem by providing the view margin of 86 pixels on the right (I measured the Charm bar, and no matter what resolution, it's 86 pixels).
To keep the view symmetric, we also provided 86 pixels on the left.
Tested it yesterday on the RTM version and it seems that this issue is fixed in the RTM version.
Thanks everyone for your input.
One quick thought is that your app is activated from the OnSearchActivated method when the user invokes a search; you could possibly add/remove event handlers in there.

Save Data Between Screens

I have an iPhone app with a form that has terms and conditions. When the user taps on the terms and conditions link, it brings them to another screen within the application that shows them.
Now, when they tap away and come back they lose all of the information they placed into the fields. Is there any way of saving this data in the forms short of storing everything in a dictionary when they leave and when the view reloads filling it back?
Can you use a UIAlertView for the terms and conditions? I've used this in a few apps. Longer text automatically creates a scroll in the alert. This will keep you from needing to leave the screen at all.
You will need to have some way of saving that data when the user leaves the screen using a dictionary or some other means. So the short answer is no.
A longer answer is that you could change how you are navigating to the new screens and prevent this screen from getting dumped when you move on.