Close previous page after clicking Flyout in Xamarin.Forms - xaml

do you know how to set automatically close the previous page after clicking on Flyout Menu?
I don't want to keep this page in memory of my device, because it lags him.
Any ideas?
I try to create the method "button clicked" with this:
await Application.Current.MainPage.Navigation.PopAsync();
It didn't work.

The code you are trying removes the top Page from the navigation stack, in other words it only pops up one page at a time. You can use the INavigation.PushAsync method to add a page to the stack, which opens a new page on the screen, like this:
Application.Current.MainPage = new TestPage();
Usually you don't need to do anything to clear the previous page. The garbage collector will do this automatically for you (not immediately, but after some time depending on some circumstances).

Related

Using puppeteer to automate button clicks for every button at every URL in a web app

I am currently trying to use JS and puppeteer to take a screenshot of every url in my web app, as well as take a screenshot of every button that can be clicked. Is there a way to click each button without specifying the id? Not all of my buttons have an id and even if they did, I wouldn't want to have x number of page.click(id, options) for each button I have (which is quite a lot).
Thanks
I have tried going based off each className (this app is built using react) but this does not work. It will take a screenshot of the same buttons over and over. I believe because if page.click has multiple of the same options, it only chooses the first one and many buttons have the same styling classNames.
You could get an array of each element on a page, go through the elements with a for loop determine if it is a button, then click it. Then for each page you'd have to input each url in an array and then use a for loop to go through it.

NSOpenPanel New Document button not working

I can't seem to get the Open Panel's New Document button to work. Currently I am just using the default application provided Open Panel (iCloud enabled OS X app) which has a New Document button at bottom left of the window.
However I just get a system beep when I click on it, I would expect this button would do the same as File->New menu option but it does nothing other than beep.
How can I either enable this button to simply create a new blank file or remove it altogether.
Finally I figured it out.
It seems the New Document button is somehow hardware to the CMD+N keystrokes. I had reassigned CMD+N to apply Normal style to text and this breaks the New Document button.
Seems odd that the button is not wired to newDocument method on First Responder rather than to a keystroke combination.
EDIT
I logged a Bug ID# 14886108 and it seems it may be fixed in Mavericks

Is it possible to use the back button to move between PivotItems?

Part of my app switches PivotItems automatically when a user clicks on an item in a list. I want to allow the user to press the back button after this action to switch back to the original PivotItem. How could this be achieved? If my understanding is correct the normal BackStack can only be used with pages.
You can override the OnBackKeyPress() function and set e.Cancel to true to cancel the back key press (and navigate to a different PivotItem or whatever).
However: according to the certification requirements:
5.2.4.1 – Back button: previous pages
Pressing the Back button must return the app to the previous page or return to any previous page within the back stack.
So I wouldn't recommend doing something like this - not only is it likely to fail certification, it's also likely to confuse people.

Application hangs on clicking "Choose" button in IKPictureTaker view

I am facing a strange hang issue with IKPictureTaker and on clicking a "Choose" button. I am doing below operation using IKPictureTaker.
When a user wants to change a profile picture, upon clicking "Change Image" button, I display a IKPictureTaker view along with "Choose" button by setting IKPictureTakerAllowsFileChoosingKey to YES.
First time on clicking the "Choose" button, open panel will be displayed allowing user to select an image of his choice.
Next, on clicking the "Set" button, internally I am calling a profile picture upload function of a server in a separate thread and everything works great.
Next if the user tries to do the operation 1) and 2) again application hangs on clicking the "Choose" button.
After investigation I found that this issue is something to do with the background upload operation I am doing with the server.Because if I comment the upload part of code everything looks good.
I don't see any issues with the upload operation performed in the separate thread and it gives up it s runloop once it is done with its upload operation and all UI related operations again taken care in the main thread.
Application hangs only if I click on the "Choose" button. If I select the recent pictures or take a new photo using the camera everything works great.
Is there anyone who faced the same issue? Is it something to do with the NSOpenPanel displayed when we click on the "Choose" button?

OOB NewForm in Dialog loses focus after a few seconds

Working in SharePoint 2010, with SharePoint Designer 2010, I have a DispForm to which I've added a DVWP that displays a filtered view of another relative list. The DVWP has a 'New' link which opens the NewForm for that list in a modal dialog, using OpenPopUpPage (http://msdn.microsoft.com/en-us/library/ff410825.aspx).
After 5 - 12 seconds, the blinking cursor disappears from the first control and the focus switches to the 'Close' button. If the user was trying to type and happens to hit the Enter key when the focus switches to the 'Close' button, the background is no longer darkened and the 'Cancel' button no longer works. The form is still displayed on the screen, and the user can 'Save' but the modal never goes away until the page is refreshed.
If the user notices that the modal has lost focus and clicked back on the form, everything works as it should and all is well.
Observations:
When the control/modal loses focus, the 'Close' button does not trigger a 'focusin' event. But, $(document.activeElement).attr("value") displayed in the console shows that it's the active element.
Questions:
Why is the modal losing focus?
Does anyone have a Javascript/jQuery workaround to capture the event and set the focus back where it was?
Alternately, what if I lock the form and wait for this focus-change to complete, then unlock it and set the focus on the first field? Ideas?
You may be having a problem if the DispForm is also a dialog and you open the modal with your script. It sounds like you are getting a "layered" effect. My guess is that the script managing the dialog is interfering with the modal. Have you tried turning off the dialiogs for the list?
Just so I get some points on this site, the affliction was the asynchronous refresh of the first modal. It was taking the focus away from the layered modal.
Thanks JB for the answer!
I figured out the problem: the DVWP was using Auto-Refresh with the Async Update. This was running every 15 secs, taking the focus away from the modal, then not returning it to the last control.
So, we turned of the auto-refresh and used the callback from the modal close to trigger a click on the manual refresh button instead.