Create popup with Rg.Plugins.Popup

Asked

Viewed 673 times

1

Does anyone know any tutorial for creating popup on Xamarin.Forms using this plugin, Rg.Plugins.Popup? I need to create a popup and inside it a textbox or textarea with two buttons (Ok and Cancel).

1 answer

3

On Soen has a reply that can help you.
In this link also has another example.


Briefly you will do:

  • Installing the plugin in all projects;
  • Add Popup to the shampoo;
  • Use the methods they provide in the Show/Hide Popup documentation:

You will use the PopupPage xaml inside a popup in an elegant way, as it adds the following methods:

Navigation.PushPopupAsync()
Navigation.PopPopupAsync()
Navigation.PopAllPopupAsync()
Navigation.RemovePopupPageAsync()

The example below (source) will look something like what it will create:

<?xml version="1.0" encoding="utf-8" ?>
<t:SlidePopupView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
                  xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:t="clr-namespace:SlideOverKit" 
                  xmlns:controls="clr-namespace:eFACiLiTYMobile;assembly=eFACiLiTYMobile" x:Class="eFACiLiTYMobile.View.PopupScreens.CallEditEvent">
  <ContentPage.Content>
    <Grid RowSpacing="0" Padding="0">
      <Grid.RowDefinitions> <RowDefinition Height="*" /> </Grid.RowDefinitions>
      <ScrollView BackgroundColor="White" Padding="15,10,15,30" Grid.Row="0" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
        <StackLayout Spacing="10" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
          <Label HeightRequest="90" Text="Build some Awesome SlideOver's" FontSize="24" XAlign="Center" />
          <Button HeightRequest="60" x:Name="DoneButton" Text="Close" />
          <Entry BackgroundColor="Gray" HeightRequest="60" x:Name="txt_entry" Text="Test Application" />
          <Picker x:Name="ac_Siste" VerticalOptions="CenterAndExpand" HorizontalOptions="FillAndExpand" BackgroundColor="Green" />
          <DatePicker x:Name="DPRequestResolutionDate" HorizontalOptions="FillAndExpand" VerticalOptions="CenterAndExpand" Date="{x:Static sys:DateTime.Now}" >
            <DatePicker.Format>yyyy-MM-dd</DatePicker.Format> 
            <DatePicker.MinimumDate><sys:DateTime x:FactoryMethod="Parse"><x:Arguments> <x:String>Jan 1 2000</x:String></x:Arguments></sys:DateTime></DatePicker.MinimumDate>
            <DatePicker.MaximumDate><sys:DateTime x:FactoryMethod="Parse"><x:Arguments><x:String>Dec 31 2050</x:String></x:Arguments></sys:DateTime></DatePicker.MaximumDate>
          </DatePicker>          
          <Button HeightRequest="60" x:Name="ExitButton" Text="Exit"  />     
        </StackLayout>
      </ScrollView>
    </Grid>
  </ContentPage.Content> 
</t:SlidePopupView>

Check the official documentation: https://github.com/rotorgames/Rg.Plugins.Popup/tree/master/src/Demo

  • In fact I had already entered in the rotorgames, but I was not understanding some things.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.