Xamarin.Forms - CollectionView and TabbedPage in one view - xamarin.forms

I have a Xamarin Forms app, where I have a CollectionView of Frames. What I want to add now in this view is a TabbedPage, so that the screen in split in half (using Grid) and the left side has the CollectionView and the right side has the TabbedPage.
I tried to create a TabbedPage in a separate xaml file and then add that to my MainPage (where the CollectionView is as well), inside the grid to set its location, but I get the error that this is not possible. Only ContentViews can be set like this.
Does anyone know how to do this?

Thanks to Juan Sturla, the solution was to use the Xamarin Community Toolkit, that can be found here:
https://learn.microsoft.com/en-us/xamarin/community-toolkit/views/tabview

Related

Placing View over TitleBar in Xamarin Forms

Is there any way I can place a ContentView or Grid to cover complete page in Xamarin.Forms?
I need to place it over the TitleBar area without hiding the TitleBar.
I tried to achieve the same using RelativeLayout but it is not working. I am trying to achieve something similar to a popup/modal.
Sadly I can't use any Third Party control in my project or PushModal either.
Ideas?
Adding the sample screen.
You could set in Xaml:
NavigationPage.HasNavigationBar = "False"
If you want to make the content whole page and without hiding the title bar, then you need to make the title bar transparant.Follow this tutorial https://xamgirl.com/transparent-navigation-bar-in-xamarin-forms/
or
If you are trying to achieve popup, consider using this wonderfull plugin https://github.com/rotorgames/Rg.Plugins.Popup

How to make drag and drop in Xamarin forms

I have different controls in my XAML page which consists of charts in Xamarin.Forms. The functionality that I want to achieve is to make a long press on each chart, then drag and drop the chart to another place.
I am taking this as an example : https://canbilgin.wordpress.com/2018/03/17/re-order-listview-items-with-drag-drop-ii/
But I dont have a listview in my XAML page.
How can I achieve this in XF ?
You can set a Draggable View, and put inside your Images / Graphs or whatever.
A good tutorial can be followed here

Xamarin Forms Button set Content

I have a very common problem, but I couldn't find any valid solution.
I want to create a Button able to contain more than a simple Label or Image. In fact, Xamarin Button exposes only Text and Image properties, but in my case I want to construct a more flexible set of controls (e.g. a StackPanel with a list of controls).
I implemented a ContentView acting as a Button after having added TapGestureRecognizer and it works from the pure functional point of view. What I don't like is the missing of all Visual States of a Button.
Therefore, I was thinking how to implement a Custom Renderer of a Button. I would like to expose a ContentPresenter BindableProperty and then set that property to the Button.Content (speaking in UWP terms) in the Renderer class. I think this could be a solution, the problem is that I don't know how to "cast" a Xamarin.ContentPresenter to a UWP.ContentPresenter. Do you have any idea about how to implement a Button able to contain any generic Content?

Xamarin Forms ListView scrolled to top?

I have a InfiniteListView which extend ListView from Xamarin Forms.
I know when you on the last item in the list but how can i figure out if the user scrolled to the top of the list ?
Unfortunately, the Xamarin Forms ListView does not expose a Scrolled event or Position property. So your only option is to use the ItemAppearing and ItemDisappearing events.
When you subscribe to these events, you can figure out if the first cell is appearing again, after it disappeared first. This does not actually give you a 100% correct outcome, since it can happen that only a part of the first cell is shown.
If you want a perfect check that you are at the absolute top, you will have to resort to a custom renderer:
On iOS you can make use of the tableView.contentOffset.y property on the UITableView.
On Android it's a little bit more involved, as there are multiple (but no straightforward) ways to achieve this. See this answer for one possibility. This approach is originally meant for saving and restoring scroll position, so adjust it to your needs.
Other platforms have similar ideas. Check which native control the Xamarin Forms renderer creates, and then search the internet for possible solutions for that specific platform.

How to increase list View's Separator length in Xamarin forms iOS?

I want to increase list View's Separator length(spacing between two cells).
I am not getting how can I do it in xamarin forms by using custom renderer and I am looking for iOS only.
I want to create card view in iOS (by using xamarin forms) just like facebook application.
I Implemented it with frame control.
1.I created one customized cell in List View (Using ViewCell).
Then Added frame in it.
2.Removed Separator in a List View by Using Custom Renderer.
Use HasUnevenRows="True" in your ListView and it should adapt to your item height.

Resources