private void UpdateRecentList(Recent recentItem)
        {
            try
            {
                var database = new RecentDatabase();
                database.DeleteRecentByGuid(recentItem);
                database.SaveItem(recentItem);
                var lstRecentDocuments = database.GetItems();

                while (RecentListHelper.RecentList.Any())
                    RecentListHelper.RecentList.RemoveAt(RecentListHelper.RecentList.Count - 1);

                foreach (var item in lstRecentDocuments.OrderByDescending(x => x.Id))
                {
                    RecentListHelper.RecentList.Add(item);
                }
            }
            catch (Exception ex)
            {
				Alert (ex.Message);
            }

        }
		public DocumentDetailPage(Document selecteDocument, string parentName,bool isRecent,int totalPage=10)
		{
		    try
		    {
                NavigationPage.SetHasNavigationBar(this, true);
		        Title = parentName;
		        _totalPage = totalPage;
		        lblPage = new Label()
		        {
		            Text = " Of " + _totalPage,
		            VerticalOptions = LayoutOptions.CenterAndExpand
		        };
		        if (isRecent == false)
		        {
		            var database = new RecentDatabase();
		            database.SaveItem(new Recent()
		            {
		                Ext = selecteDocument.Ext,
		                Name = selecteDocument.Name,
		                CreatedBy = selecteDocument.CreatedBy,
		                CreatedDateTime = selecteDocument.CreatedDateTime,
		                Size = selecteDocument.Size,
		                ModifiedBy = selecteDocument.ModifiedBy,
		                ModifiedDateTime = selecteDocument.ModifiedDateTime,
		                LibraryGuid = selecteDocument.LibraryGuid,
		                RelativePath = selecteDocument.RelativePath
		            });
		        }

		        this.Padding = new Thickness(5, Device.OnPlatform(5, 0, 0), 5, 5);

		        var relativeLayout = new RelativeLayout();
		        _webImage = new Image()
		        {
		            Aspect = Aspect.AspectFill,
		            HorizontalOptions = LayoutOptions.FillAndExpand,
		            VerticalOptions = LayoutOptions.FillAndExpand,
		            Source = getImage(_currentPage)

		        };

		        relativeLayout.Children.Add(_webImage, Constraint.RelativeToParent((parent) =>
		        {
		            return 0;
		        }));

		        top = new StackLayout()
		        {
		            Orientation = StackOrientation.Horizontal

		        };
               		        
				var image = new Image() {Source = "back.png",MinimumWidthRequest = 32,MinimumHeightRequest = 32};
                var tapGestureRecognizer = new TapGestureRecognizer();
                tapGestureRecognizer.Tapped += tapGestureRecognizer_Tapped;
                image.GestureRecognizers.Add(tapGestureRecognizer);
               

		        pkrPage = new Picker() {MinimumHeightRequest = 60, MinimumWidthRequest = 80};
		        for (int i = 1; i <= totalPage; i++)
		        {
		            pkrPage.Items.Add("  " + i + "  ");
		        }
		        pkrPage.SelectedIndex = 0;

		        pkrPage.SelectedIndexChanged += (sender, e) =>
		        {
		            _currentPage = pkrPage.SelectedIndex + 1;
		            DisableButton();
		        };

                top.Children.Add(image);
		        top.Children.Add(pkrPage);
		        top.Children.Add(lblPage);



		        prevButton = new Button {Text = "<", TextColor = Color.FromHex("#666")};
		        nextButton = new Button {Text = ">", TextColor = Color.FromHex("#666")};
		        prevButton.Clicked += prevButton_Clicked;
		        nextButton.Clicked += nextButton_Clicked;

		        relativeLayout.Children.Add(nextButton,
		            Constraint.RelativeToParent((parent) =>
		            {
		                return (parent.Width - 60);
		            }),
		            Constraint.RelativeToParent((parent) =>
		            {
		                return (parent.Height/2);
		            }));

		        relativeLayout.Children.Add(prevButton,
		            Constraint.RelativeToParent((parent) =>
		            {
		                return (0);
		            }),
		            Constraint.RelativeToParent((parent) =>
		            {
		                return (parent.Height/2);
		            }));

		        var mainLayout = new StackLayout()
		        {
		            Orientation = StackOrientation.Vertical,
		            HorizontalOptions = LayoutOptions.FillAndExpand,
		            VerticalOptions = LayoutOptions.FillAndExpand
		        };
		        mainLayout.Children.Add(top);
		        mainLayout.Children.Add(relativeLayout);
		        this.Content = new ScrollView {Content = mainLayout};
		        DisableButton();
		    }
		    catch (Exception ex)
		    {
                DisplayAlert(ex.Message, "Error", "OK");
		    }
		}