Xamarin.Forms - Slide-Up Panel App
Tags: slideuppaneldetai, xamarin, xamarinforms
Published: 2019-11-13 17:20:31

---
title: Xamarin.Forms - Slide-Up Panel App
published: true
date: 2019-07-21 18:08:00 UTC
tags: Slideup Panel. Detai,Xamarin,Xamarin.Forms
canonical_url: https://logeshpalani.blogspot.com/2019/07/xamarinforms-slide-up-panel-app.html
---

 **Introduction**  
**                     This article demonstrates how to enable slide-up panel in Xamarin.Forms application. This means if the user drags the panel from down to up, it shows title, image, description and more. Similarly, the user can drag the panel from up to down and it will show only the title and set the custom behavior of it. These features are not listed by default in a Xamarin.Forms application. So, we need to install a plug-in for this.**  
  
 **NuGet Package - Search Xamarin.Forms **  

- DK.SlideUpPanel
- Reactive.Fody

**Xamarin.Android Output**  

[![](https://1.bp.blogspot.com/-J-0zjOxVT8k/XTSoKoupqiI/AAAAAAAAOug/IL6CZYftCHkrb_saB2k5W4D0d2RuoGrcACLcBGAs/s320/Result.gif)](https://1.bp.blogspot.com/-J-0zjOxVT8k/XTSoKoupqiI/AAAAAAAAOug/IL6CZYftCHkrb_saB2k5W4D0d2RuoGrcACLcBGAs/s1600/Result.gif)
  

  

  

Let's start.  
  

**Step 1:**  
                You can create Xamarin.Forms app by going to File \>\> New \>\> Visual C# \>\> Cross-Platform \>\>Cross Platform App (Xamarin.Native or Xamarin.Forms), give the application name, and click OK.  
  
 (Eg- Project name: SlidingDemo)  
  
 
[![](https://1.bp.blogspot.com/-st2Uh1cw__c/XTSoX6S_5dI/AAAAAAAAOuk/zYPlKrA2NPsGpevM71Sqaij7pgiuvs9vACLcBGAs/s320/Creating%2BApp.png)](https://1.bp.blogspot.com/-st2Uh1cw__c/XTSoX6S_5dI/AAAAAAAAOuk/zYPlKrA2NPsGpevM71Sqaij7pgiuvs9vACLcBGAs/s1600/Creating%2BApp.png)
  

  

**Step 2**  
                After the project creation, add the following NuGet package to your project.  

- DK.SlideUpPanel
- Reactive.Fody
For that, open Solution Explorer and select your solution. Right-click and select "manage Nuget Package for the Solution". In the popup window, open "Browse " tab and browse "DK.SlideUpPanel","Reactive.Fody" and select the following NuGet packages and select yours then install it. 

  

  

**Step 3**
                Afterwards, Add ViewModels Folder. For that, open Solution Explorer \>\>SlidingDemo(PCL) \>\> right click and select _Add followed by selecting New Folder named ViewModels._

Open Solution Explorer \>\>SlidinDemo(PCL)\>\>right-click and select _Add folloed by selecting New Item. In the popup window select class. In this way, you can create a new class._

In this step, add a new class named AbstractViewModels.cs and add the following code.  
  

**C# Code**
<script src="https://gist.github.com/logeshpalani98/ca840df930def8dde0f5a82c4b34a0ab.js"></script>  

Next, add another class named TestPageAllXamlViewModel.cs and insert the code given below.
  

**C# Code **

  

  

<script src="https://gist.github.com/logeshpalani98/74dfced0448c6c1b4e6a9933e3fdbd7f.js"></script>  

**Step 4**
                Open Solution Explorer \>\> SlidingDemo(PCL) \>\> double-click to open MainPage.Xaml page and You can add assembly and XAML code to your project. Here is the code.

- _SlidingUpPanel.MainiView - MainView Layout._
- _SlidingUpPanel.HideTitleView - we need to show Title of Sliding Panel on Hidden Mode, so enable true._
- _SlidingUpPanel.HideNavBar - we need to show NavBar on Hidden Mode, so enable true or false._
- _SlidingUpPanel.HeaderView - It's the header view of Sliding panel._
- _SlidingUpPanel.PictureView -It's the Picture view of Sliding panel._
- _SlidingUpPanel.BodyView - It's the body view of sliding panel._
- _SlidingUpPanel.PanelRatio - Set the panel ratio of sliding panel._

**XAML Code**  
  

  

<script src="https://gist.github.com/logeshpalani98/fc26d2148aec1a2ac8894a07f22588dc.js"></script>  

**Step 5**
                Next, open Solution Explorer \>\> SlidingDemo(PCL) \>\> click open desgin view of MainPage.Xaml.cs and here is the code for this page. 

- PrimaryFloatingButton - In this the floating button shows on before we slidingup
 - SecondaryFloatingButton - In this the floating Button shows on after we slidingup

**C# Code Behind**

<script src="https://gist.github.com/logeshpalani98/8a4adf2b8fae6479d06b1f624f2b8150.js"></script>  

  

**Step 6**
                Add FodyWeavers.xml file. For that, open Solution Explorer \>\>SlidingDemo(PCL)\>\> Right-click and select _New Item. _ In the popup window, select Xml file named FodyWeavers.xml and click ok. Copy and Paste this file to all projects( Xamarin.Android, Xamarin.IOS).  
  
 Add the Following Code.

**XML code**  
  

<script src="https://gist.github.com/logeshpalani98/d58407f9fb6ca7f735a06032dde5df7b.js"></script>  

**Step 7**
                Now, go to "Build" menu and click "Configure Manager". Here, you can configure startup projects. Click F5 or start to build and run your application.

After a few seconds, the app will start running on Android simulator or emulator and we will see your app working successfully.

[![](https://1.bp.blogspot.com/-J-0zjOxVT8k/XTSoKoupqiI/AAAAAAAAOug/7KPGm2yVMtQO6VHN2NfJbaeckEl2Q-q7QCEwYBhgL/s320/Result.gif)](https://1.bp.blogspot.com/-J-0zjOxVT8k/XTSoKoupqiI/AAAAAAAAOug/7KPGm2yVMtQO6VHN2NfJbaeckEl2Q-q7QCEwYBhgL/s1600/Result.gif)
  

Finally, we have successfully created a Xamarin.Forms SlidingDemo application using DK.SlideUpPanel plugin.

Please download the source code from [here](https://github.com/logeshpalani98/SlideUpPanel/).