Cross platform NavigationDrawer/SideMenu? - xamarin

Architecture question: Are there components or a convention to follow to implement a cross platform navigation drawer / side menu? I've found platform specific implementations that aren't similar enough to be implemented consistently in a cross platform way. The MvvmCross iOSSupport library's Xamarin.Sidebar seems to be specific to iOS, as is the stock DrawerLayout on Android, but their implementations seem too different. Does a one size fits all solution exist, or will I have to roll my own?

If you are talking about Xamarin.Forms, this is exactly how MasterDetailPage works. If you ask for Xamarin.Android and Xamarin.iOS the question isn't logically consistent - even if you could display an empty panel by some unified package there is no way that you could add controls to it as it has to be done completely separately (as there are no common controls) and the common package for this cannot be made.

What you are describing is the MasterDetail
The Xamarin.Forms MasterDetailPage is a page that manages two related
pages of information – a master page that presents items, and a detail
page that presents details about items on the master page.

Related

TabbedPage bar glitch

When I open TabbedPage from another TabbedPage in Xamarin.Forms for iOS the right part of bottom bar has that strange glitch/blink. Is there any solution to fix it?
There might be a need to reconsider UX in the app you are working on. Nested tabs are not intuitive and very confusing, beside the technical issues you can run into, here is a summary of notes from the official Xamarin.Forms docs:
It's recommended that a TabbedPage should be populated with
NavigationPage and ContentPageinstances only. This will help to ensure
a consistent user experience across all platforms.
The TabbedPage does not support UI virtualization. Therefore,
performance may be affected if the TabbedPage contains too many child
elements.
While it's acceptable to place a NavigationPage into a TabbedPage,
it's not recommended to place a TabbedPage into a NavigationPage. This
is because, on iOS, a UITabBarController always acts as a wrapper for
the UINavigationController. For more information, see Combined View
Controller Interfaces in the iOS Developer Library.

Xamarin - mixing Forms and Storyboards

Is it possible to mix iOS Storyboards and Xamarin Forms within one application? I have a bunch of views that are easier to be created in Forms, but some which are heavily customized so we would need to create some of them in native code.
I would like to use Storyboards to create the native parts, but can't seem to find a way to navigate from a Forms page to a Storyboard and vice versa.
I don't mind doing it from code, just need to know the direction to look into and if it's even possible.
You can create native views using the concept of Custom Renderers (see links below). The idea is that you create a Xamarin Forms Control that's shared between all platforms and which old common properties (like colors, general data etc), and do the native rendering on the iOS/Android/WP projects.
So, for your storyboard, you can create it usign Xamarin.iOS, and render using a Custom Renderer. The link posted by #GSerg in the comments have some information and examples, but you can take a closer look at the oficial documentation as well:
Introduction to Custom Renderers
Customizing Controls on Each Platform
Customizing Control Rendering in Xamarin.Forms (video)
Also, for more real world examples you can take a look at the Xamarin Forms XLabs project.
Thanks to Rafael Steil's answer. I looked at the links and a few more samples.
Notably:
Custom Renderer Map
Using Xamarin Forms alongside Storyboard
And I created a sample project to show the back-and-forth navigation between Xamarin Forms and pages created in Storyboards. You can find it over here:
Xamarin Forms Mixed with Native

Windows 10 app - SplitView or Pivot?

I create my first app for Windows 10. I will use the app for Windows 10 desktop and phone. Great that one code will run on desktop and phone. In my old application for Windows Phone 8 I use Panorama control with three tabs. But I can not decide which component to use - SplitView or Pivot? For desktop better suited SplitView . For phone better suited - Pivot. Need to choose one solution. What do you advise?
First, your following statement is incorrect.
For desktop better suited SplitView. For phone better suited - Pivot.
SplitView and Pivot are for different purposes -
SplitView consists of two parts - Pane and Content. The Content is where the main content goes. The Pane is really just a drawer. This control is meant to provide a very common drawer navigation pattern to the new UWP apps, similar to many iOS and Android apps.
Note that this control is also very flexible, you can use AdaptiveTrigger to customize its DisplayMode to completely hide the Pane when it's on a phone, and make it always visible when on a desktop machine.
Prior to UWP, the original Metro Design heavily relied on the Panorama control (i.e. the Hub control in UWP) for menu navigation and this later becomes a bit boring since almost all the apps that need a menu, use a Pano. So having a new SplitView will definitely help developers be a bit more creative on the main layout design. And besides, the drawer navigation is so widely used across other platforms and users generally know how to interact with it.
Pivot on the other hand, is simply a swipe-enabled tab control. It's meant to display information at the same level and should never be used like a navigation frame. Leave the navigation bit to the SplitView or the old panorama style Hub control, or whatever creative ways you can come up with.
So to answer your question, you don't have to choose one between them, these two controls can co-exist since one does the navigation and the other shows the information, just like what's in the picture below -

Is possible to do sliding drawer in xamarin cross platform?

I am working in xamarin pcl project , I am trying to keep sliding drawer in my pcl project but i dont know how to do that .
Are you using Xamarin.Forms?
If not, i would advice to use a framework like MvvmCross (https://github.com/MvvmCross/MvvmCross)
This would enable you to split the actual implementation of the drawer / hamburger menu into the different UI projects like iOS and Android(maybe WP8 too).
Since those platforms all behave differently, for example Android uses Fragments which are replaced inside the activity containing your navigation drawer, you should use a custom presenter to determine where you want the specific platform to navigate to. You can find more information on that topic here: http://slodge.blogspot.co.uk/2013/06/presenter-roundup.html

Where do I find the "Collapsible Panel" Cocoa control in Interface Builder?

I'm trying to add a collapsible panel to a panel I added in the Interface Builder, similar to the one found in Office 2008 and XCode itself.
This is the collapsible panel for those that don't know it:
OS X collapsible panel http://grab.by/3Hqv
Any idea how I can add this to my project? Google hasn't been of much help.
This is most often referred to as a "disclosure view" or "disclosure panel" and usually has to come with an intelligent container view (that grows/shrinks/scrolls correctly with multiple disclosure subviews). There is no such control as part of the API. Most developers roll their own while some use third-party open source.
The Omni Frameworks have one such control that works very well (including "tear-off" panels, etc., if I recall correctly). The drawback: it's a large framework and has a lot of other stuff in it as well.
InspectorKit is another. It's more focused (just the control itself and an IB plugin), but the last incarnation I tested did have a few UI issues with the Interface Builder plugin.
I've also written a framework for handling this: SFBInspectors

Resources