Disallow closing Rg Plugin popup in Xamarin Forms - xamarin

I am using Rg Plugin popup for popup in Xamarin Forms application. I would like to disallow user from closing this popup. After some time, application will close this popup. Is it possible?
Why I need this: When user opens application for the first time, I would like to show usual start page and on top of it popup. Both are visible: in the middle there is popup and around it usual start page with grey overlay. In popup progress bar will be displayed while fetching data from server. User should not be able to close this popup. When fetching data is over, I would like to refresh start page and close this modal.

As Dinesh kumar pointed out, 2 things need to be done - to disallow clicking on background and to disallow back button:
public MyPopup()
{
InitializeComponent();
CloseWhenBackgroundIsClicked = false;
}
protected override bool OnBackButtonPressed()
{
return true; // Disable back button
}

Related

Slack modal is not cleared from a Updated view

I have modal flow in my Slack App. I have some issues with the end of the flow however.
Basic idea of the flow. You get a Modal, you do a selection, you get another modal, you perform an action and then Modal disappears.
I have tried two different ways both with problems but with different result
Flow 1: response_action: "update"
You press a button on home tab that opens a modal with bot.views.open
You make a selection
In the response I send {response_action: 'update', view: }
User gets the new Modal without any errors. They then click a button.
Now I would like the modal to disappear. So on the result of the action I send {response_action: 'clear'}
Nothing happens :(. I would like the modal to disappear of course :)
Flow 2: bot.views.update
You press a button on home tab that opens a modal with bot.views.open
You make a selection
I create the same view as above but I run bot.views.update{view_id: , view: }
New view comes up however it has an error in the top: We had some trouble connecting. Try again?
Now I would like the modal to disappear. So on the result of the action I send {response_action: 'clear'}
Nothing happens :(. I would like the modal to disappear of course :)
So second flow has annoying error but same result with not disappearing.
Feels like Im missing something here.
Somebody have an Idea what Im missing?

How to close the current Activity when user click Back button

In my project, I have implemented the MvvmCross to display fragment as page.
I have a Main Menu page which has Left drawer. It is defaulted to show Main Page as fragment.
In the main page, I have a drop-down menu in its action-bar. It will launch the respective page when user clicks an item
User clicks an item and it launches the Company info page.
Now, the Company info page is the current page being displayed.
Problem :
How to close the current display page which is company info page when user click the back button? When this page is closed, the main page will be seen.
where to write the logic to handle the back button ?
In Main Menu.cs or Main Page.cs or Company info.cs
public override void OnBackPressed()
{
}
You can call the finish(); method of the activity. Do this in your 'Company' activity. That will close the current activity and returns to the previous (as far as I know).
More Infos about the method: Xamarin Developer

Wicket: Modal Windows and callback functionality

I have a modal window that shows a panel which contains a form that has some textfields and a submit button
on submit an insert into the database occurs and then I have some ajax behaviour that i want to activate on the modal windows containing page on click of the button.
So flow is at present:
click link
modal window appears
user fills out form
user submits form
form data persisted to db
modal window closes
I need it to do this in addition:
activate some ajax behaviour on the page that contains the panel
any help on how best to do this in the wicket way is appreciated.
I resolved this by passing an instance of the page containing the panel to the panel (i.e. - in the constructor), then calling a method on the page from the panel to perform the Ajax update.
I would be interested to see what others have done or to hear if there are issues with the approach I have taken.
Set up a WindowClose callback.
In the WicketStuff project called ModelX (Disclaimer: I'm the developer of that) I have created an IWindowClosedListener interface which has a method:
void windowClosed(Panel panel, AjaxRequestTarget target)
So then any Page or Panel that can open a modal that needs to do something when that modal is closed simply implements that interface and its windowClosed method gets called at the right time.

Google Scripts Deploy as web app- how to disaply different gui form on click event

I built a google gui web app that has basically two gui screens. The first gui screen has some text entry fields and when the user clicks 'submit' it should pull up the second gui screen displaying some results.
my second gui starts off the same as the first:
function displayForm2(hwEntered){
var app = UiApp.createApplication().setHeight('800').setWidth('600');;
var panel = app.createVerticalPanel();
...code and stuff...
app.add(panel);
return app;
}
How do I make it work as a web app?
You should build your 2 GUI in the same Ui instance but on 2 separate panels inside a single vertical panel. Then you just have to setVisible(true) one panel while you setVisible(false) the other one... you can do that either with client handler or server handler, a matter of choice but the client handler is faster and simpler if the button doesn't have other function.
The 'parent panel' (vertical or horizontal) will ensure that each panel will show up at the same place in your display.
You should easily find some explicit examples on this forum

Intercepting urls in Windows Phone Browser

In my app I have two pages: Main Page and Display Page. Each page has a browser control.
On Main Page the source of the browser control is set to a website's homepage. If the user touches a thumbnail, I want it to be shown on Display Page.
How do I grab the address of the link that has been clicked/touched and send it to the browser on Display Page?
WebBrowser control has Navigating and Navigated Events.
In the Navigating handler, you can get the clicked link as e.Uri. get that and cancel the Navigation. then send that link to Display page.
void web_Navigating(object sender, NavigatingEventArgs e)
{
e.Cancel = true;
NavigationService.Navigate(new Uri("/DisplayPage.xaml?TargetUri="+e.Uri.ToString(), UriKind.Relative));
}
Note: By the way, sending the e.Uri is not a suggestible way. I would suggest you create a Static propety in the project and use that for sharing the links among pages.

Resources