Create popup with Rg.Plugins.Popup

1

Does anyone know of any tutorial to create popup in 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).

    
asked by anonymous 25.10.2017 / 11:53

1 answer

3

At SOen you have a answer that can help you.
In this link also has another example.

In short you will:

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

You will use PopupPage xaml within 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 which 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: link

    
25.10.2017 / 13:12