Posts

Showing posts from September, 2020

Xamarin Forms : How to Show PopUp Page In Xamarin Forms

Image
   How to Show PopUp Page In Xamarin Forms  Step 1 We need Third Page Plugin to achieve same. Go to Manage Nuget Packages - > Search for Rg.Plugins.Popup Once Installed in Project We need to configure same in Android and IOS Projects  In Android   - Go to MainActivity.cs Code:    Rg.Plugins.Popup. Popup .Init( this , savedInstanceState); In IOS –  Go to  - AppDelegate.cs Code : Rg.Plugins.Popup. Popup .Init(); Now Back to Main Project (PCL) Step – 1   Add Page in Project Once Added Page Change the Tag of Page Default Page  : Need to Replace ContentPage with Pages:PopupPage < ContentPage  xmlns ="http://xamarin.com/schemas/2014/forms" Change To < pages : PopupPage  xmlns ="http://xamarin.com/schemas/2014/forms" Step – 2 Add Class Reference to Page Code xmlns : animations ="clr-namespace:Rg.Plugins.Popup.Animations;assembly=Rg.Plugins.Popup" xmlns : pages ="clr-namespace:Rg.Plugins.Popup.Pages;a...

Xamarin Forms : Find Control of MainPage from any Class or Page

Image
  Xamarin Forms : Find Control of MainPage from any Class or Page E.g. If you have Menu on MainPage and you need to apply Rights from User Validation Class. How do you access Control / Button of Menu from the class Add caption Code : Button  button =  null ; button = ( Button ) App .Current.MainPage.FindByName( "btnStkRpt_CustCsgSumm" ); if  (button !=  null ) {   button.IsEnabled =  true ;   button.IsVisible =  true ; }   Note : This will find control on mainpage (Startup Page or Current Main Page)