I need to be able to make this kind of dialog box to be displayed when a button is pressed. I am using Acr.UserDialogs for simple dialog boxes but I don't think there is any way to get such a dialog using this library.
Any ideas on how I can do this in Xamarin Forms?
You can use the Popup plugin to display a page modally
You can create your own layout and use this awesome plugin to display your layout as popup
https://github.com/rotorgames/Rg.Plugins.Popup
How To Use --snippet from the link
Open new PopupPage
Task PushAsync(PopupPage page, bool animate = true) // Navigation.PushPopupAsync
Hide last PopupPage
Task PopAsync(bool animate = true) // Navigation.PopPopupAsync
Related
How can you remove the titlebar and buttons in a UWP application? And always start in fullscreen. In WPF this is easy but can't find how to remove the buttons in UWP.
Tre below code in App.Xaml.cs (may be in onlaunched)
To remove the title bar.
CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;
Window.Current.SetTitleBar(null);
To make it full screen (which also removes buttons)
ApplicationView view = ApplicationView.GetForCurrentView();
view.TryEnterFullScreenMode();
Need to import
using Windows.ApplicationModel.Core;
using Windows.UI.ViewManagement;
I'm using ModernUI for WPF (MUI) available on codeplex. It's a nice framework and I have no issues using it as a container for my pages.
I have added a Custom Dialog window but I do not want to use any of the default buttons.
In the init method I have commented out this line:
this.Buttons = new Button[] { this.OkButton, this.CancelButton };
But, a Close button appears instead?
Any ideas?
Thanks
How do I display an image when I click a button ? Like MessageBox.Show, it will open a new window. Unfortunately MessageBox only do it on text. how about images ?
As a suggestion how about if you:
Create a new windows form instead with PictureBox inside.
Load the image on the PictureBox before showing it
Use Form.ShowDialog(this)
Return DialogResult upon clicking the buttons you define in your windows form
we can create image (or) pic to be clickable links by using this code
<a href="http://www.w3.org"><img src="w3c_home.gif"
alt="World Wide Web Consortium Home"
width="72"height="46"border="0"/></a>see in this blog
http://www.facebookliteapp.com/2015/06/facebook-lite-for-Android-pc-laptops.html
In window phone 7.5 . I want to use yes no buttons in message box . But there is no option for yes no buttons in message box. How can i use with yes no buttons or other alternate to show caption (OK =yes and cancel =no)
Please help me.
Thanks in advance.
You can use the Coding4Fun MessagePrompt to create Yes/No message with custom buttons in this way:
MessagePrompt messagePrompt = new MessagePrompt();
messagePrompt.Message = "Some Message.";
Button yesButton = new Button() { Content = "Yes" };
yesButton .Click += new RoutedEventHandler(yesButton _Click);
Button noButton = new Button() { Content = "No" };
noButton .Click += new RoutedEventHandler(noButton _Click);
messagePrompt.ActionPopUpButtons.Add(noButton);
messagePrompt.ActionPopUpButtons.Add(yesButton );
messagePrompt.Show();
Another option is to use the Guide class from the XNA framework. There is a BeginShowMessageBox method giving you the option to pass in whatever strings you wish for the buttons.
The other option is to use MessagePrompt from Coding4fun toolkit and customize according to your needs
Yes, the problem with WP MessageBox is that it only supports the OK and OKCancel MessageBoxButton, which means that you’re limited to either an ok button or an ok and a cancel button. The YesNo and YesNoCancel enumeration values are not supported.
Basically you can try to display a semi-transparent blanking layer over the page content, and then display a custom message box on top of that. Here, you can find a complete sample.
Another option is to use a custom library like Windows Phone Assets.
I'm using WatiN testing tool and i'm writing c#.net scripts. I've a scenario where i need to change the theme of my web page, so to do this i need to click on a image button which opens a ajax popup with the image and "Apply Theme" button which is below the image now i need to click on the button so how to do this please suggest some solution.
So first click your button that throws up the popup, and .WaitUntilExists() for the button inside the popup.
IE.Button("ShowPopup").click()
IE.Button("PopupButtonID").WaitUntilExists()
IE.Button("PopupButtonID").click()
This may not work in the case the button on the popup exists but is hidden from view. In that case you could try the .WaitUntil() and specify an attribute to look for.
IE.Button("ButtonID").WaitUntil("display","")
The Ajax pop-up itself shouldn't pose a problem if you handle the timing of the control loading asynchronously. If you are using the ajax control toolkit, you can solve it like this
int timeout = 20;
for (i=0; i < timeout; i++)
{
bool blocked = Convert.ToBoolean(ie.Eval("Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();"));
if (blocked)
{
System.Threading.Thread.Sleep(200);
}
else
{
break;
}
}
With the control visible you then should be able to access it normally.
Watin 1.1.4 added support for WaitUntil on controls as well, but I haven't used it personally.
// Wait until some textfield is enabled
textfield.WaitUntil("disable", false.ToSting, 10);
I'm not using any ajax control toolkit and in the popup there is no text field as i've mentioned there is only a image and a button below it, which i need to click in order to apply that image as theme.
I wrote a post about how I do ajax synchronization, since I was having problems with WaitUntilExists: http://lebobitz.wordpress.com/2011/03/06/synchronizing-watin-and-ajax-with-jquery/