ActivityIndicator disable controls? - xamarin.forms

I want to have an ActivityIndicator that covers all controls, so the user cant click twice on the buttons. He have to wait for the loading to finish. For example, a login page in an app.
It could be something similar to this example on iOS http://developer.xamarin.com/recipes/ios/standard_controls/popovers/display_a_loading_message/
Thanks.

I'd recommend taking a look at Allan Ritchie's ACR Xamarin Forms library (available as a NuGet package). It has a Loading indicator that displays "above" the form and prevents clicking the underlying form elements.

I haven't tried this. But I might in a couple of days. But in the meantime I can give you my idea.
There is the absolute layout which you can make use of. Create a base page which is inherited by all your content pages and in the base page create the activity indicator with absolute position above. So all other controls falls under it. You can use the isbusy flag to notify property changes so that activity indicator is displayed and when the action is over set the flag to false and which in Turn will hide the activity indicator.
I had seen a sample somewhere which I will try digging up for reference. Probably in git.
For Reference

Related

Is there a Flex event fired after an object is displayed on the screen

I have an Image being loaded dynamically and being added to my larger application.
After the image is loaded, I then want to grab a bitmap of the display for printing purposes.
The issue is that I can't find any events that are guaranteed to be triggered after the image is rendered on the screen.
FlexEvent.CREATION_COMPLETE sounds closest on paper but doesn't appear to do the trick.
To test, I'm adding a breakpoint to the end of a handler triggered by the event, and seeing whether the image is on screen when the breakpoint is triggered.
I'm being forced to use flex 3.3.
Images are a special case--the component can be complete and visible in the display list before the image data itself is loaded and rendered.
For s:Image, take a look at the Image.ready event.
If you're using mx:Image, look at Image.complete instead. (There's also an s:Image.complete--see the flexdoc comments for how it differs from ready.)
MX Image has a complete event, that I think is what you are looking for. FYI, each Class has a section in its language reference page called "Events." It is frequently instructive to go through these and try ones that look likely. http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/Image.html#eventSummary
Have you tried the FlexEvent.SHOW event?
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/core/UIComponent.html#event:show
Edit:
If you can find an event that gets fired after the data is loaded (Event.COMPLETE or FlexEvent.CREATION_COMPLETE or something else), you might be able to get away with doing a callLater() and assuming that the image will be rendered by the next frame. Sort of a hack, but it might be worth a try.

Detecting FR/FF button event in MPMoviePlayerController UI?

Basically long pressing of FR(fast rewind)/FF(fast forward) causes directional scrubbing. But iPod, YouTube app detects short tapping of these buttons and uses it for navigating to previous/next tracks.
How can I archive this feature? Is this possible? Or should I go view-hierarchy hack?
I have solved this with view hierarchy hack. This is not recommended and should be avoided as much as possible. But I note here for further reference. To mark there is no accessible way currently. This hack is applied to only specific version (4.3) of iOS SDK.
Iterate all view hierarchy of -[MPMoviePlayerController view].
Find subclass of UIButton. And add target-action handler to all of them. (you can check for subclass of MPTransportButton)
In handler, you can filter by tags. Only navigation buttons are tagged. Each tag means 1 = play/pause, 2 = previous, 4 = next button.
Take care about this is just an hack. Will not be guaranteed to work or pass on AppStore.
If you have experience of rejection by this method, please comment me. It'll be very appreciated.

popups in asp.net

i want to display the pop ups in asp.net page like how the stack over flow show the pop ups on the top of the site (you get the new answer for the question like that in a orange color) how can i write the code is there any free source code or any reference. thank you
Given below are the steps to achieve what you want.
Have a div (a container) to show your updates
Create a window.setTimeout to execute a JS function (AJAX)
In that function check for updates from server
Finally if there are any updates then show it in the div container
When there are updates then again setTimeout to make it invisible over a period of time (say 3 secs)
To achieve this in a very easy fashion use JS libraries like JQuery.
HTH
Thats not a 'popup', its probably just a standard DIV that has its height and content changed dynamically. You can do a "view source" on the page to locate the item, or use firebug (easier).
After looking, its a div called 'notify-container'.
These days, all that wizzery is generally done with jQuery
The asp.net ajax control toolkit has that. Check it out here.
I think you'll find that's done using a holding container at the top of the page, a timer to periodically query an AJAX enabled method for updates which replaces the content of the container based on the response.

Flex 3 - Force all controls to render at start

When I try to access the hidden TABs of my tab navigator control in action script, it returns a null error. But it works OK if I just activate the control in the user interface once. Obviously the control is not created until I use it. How do I make all the tabs automatically created by default ?
<mx:TabNavigator creationPolicy="all"/>
That should do it. Deferred instanciation is a feature, but sometimes it is a hassle.
The Flex framework is optimizing creation be default (creationPolicy="auto") so if you have a configuration dialog with a lot of tabs, for example, and the most useful tab is the first one, your application does not spend time and memory initializing the tabs that the user never sees.
This makes a lot of difference when dialogs like this never release, and is a good default to go with.
One thing to look at is using a private variable in your dialog/form instead of pushing the data to the control on the hidden page. This style treats the whole form as if it were a component, which it sort of is. To repeat: the MXML form/dialog/canvas is a class, and it can have data and methods in addition to containing other components.
Cheers
On a side note, I've run into the deferred-loading policy in a multi-state application, and circumvented it by forcing all elements to be included and invisible in the initial state. Something to consider, but only as a hack.

Navigation issue in Flex - ViewStack, states or something else?

I have a bit of doubt regarding my application which is being created using Mate framework. The first thing user has to do is to log in, so I created Login.mxml view. After a successful login I need to display the main view with applicationControlBar at the top and a workspace below. At the moment I have two separate views, so if I understand correctly it makes sense using ViewStack.
Thing is, I'd like also to display some kind of panel with buttons on top of the workspace after login - here is screenshot. After clicking on a button the panel should dissapear. To complicate things a little bit more, there is a possibility for this panel to change state. Clicking on a specific button may result in showing progress bar at the bottom of panel.
I feel I should create separate view, MenuDialog.mxml and put there buttons, progress bar and states, but how to display it on the top of the workspace? I hope my problem is clear enough :)
I would make the panel a popUp, with the main application (or the ViewStack's parent container) as the parent of the popUp. You can use the PopUpManager Class to close it based on user actions within the Panel.
Assuming that perhaps you do not want a modal login style panel (which many apps these days eschew) then you should absolutely use states rather than ViewStacks.
States are a much cleaner way to distinguish the various, uh, states that your UI can be in -LOGGED_IN, LOGGED_OUT, etc.
It may take a little to get used to working with states, but once you do, you'll never go back. :-)

Resources