SlideOverKit Menu as hamburger menu using FreshMVVM - xamarin.forms

I am new in Xamarin and learning FreshMVVM.
Please can anyone guide me how can I dispaly SlideOverKit: Right Menu as hamburger menu instead on button click using FreshMVVM for MasterDetail form.
Thanks in advance.

I am not sure abut FreshMVVM but all you have to do is to add a ToolbarItem which has an icon of Menu. Than, bind the click command to show the slideOverKit menu.
<ContentPage>
<ContentPage.ToolbarItems>
<ToolbarItem Name="Cart" Command="{Binding GoToCartCommand}" Icon="Icons/cart.png"></ToolbarItem>
</ContentPage.ToolbarItems>
<ContentPage.Content>
<!-- your content goes here -->
</ContentPage.Content>
</ContentPage>

Related

Can I set customised title bar for a master detail Page

I want to have an
-Image button
-logo
-text view
How to set the title bar with these constraints?
You can Add them by Toolbar Items in XAML
<ContentPage.ToolbarItems>
<ToolbarItem Icon="logo.png" Text="Sample" />
</ContentPage.ToolbarItems>
You cannot unless you create your own custom toolbar from scratch using custom renderers.

Button Background is Transparent When Navigating to Page (UWP)

I have a very simple Xamarin Forms application that navigates between two pages.
On the second page (the page being navigated to) the following XAML content exists:
<StackLayout>
<Button Text="TEST" />
</StackLayout>
When the page has this content, the page appears to render correctly. However, if I change the XAML to this:
<StackLayout HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand">
<Button Text="TEST" />
</StackLayout>
The button background appears to be transparent until I hover over the button. It appears that any combination of values for the HorizontalOptions and VerticalOptions properties causes this effect.
Interestingly, if I set the second page as the root page, the button background is not transparent even when the properties are set.
I am using the Prism framework if that makes any difference.
What am I missing? Is this behavior correct?
Should anyone stumble upon this question, I submitted an issue on GitHub (here). It has been confirmed as a bug.

Change 3 dots of secondary toolbar to an icon in xamarin forms

I want to replace the default '3 dots'(that displays the secondary items) to text or icon on the title bar of a page in xamarin forms.
Is this possible and how can I achieve this?
Thank you for the responses in advance.
Making sure to add the method that will handle the Activated event in C#.
In XAML, before the opening tag of your ContentPage.Content, add the code below.
From dots to Text
<ContentPage.ToolbarItems>
<ToolbarItem Text="Hi" Clicked="Clicked_1"/>
<ToolbarItem Text="Hello" Clicked="Clicked_2"/>
</ContentPage.ToolbarItems>
From dots to Icon
<ContentPage.ToolbarItems>
<ToolbarItem Icon="icon.png" Activated="Clicked_3" Text="Icon" Order="Primary"/>
</ContentPage.ToolbarItems>

What is the best way to create the MasterDetailPage menu items in Xamarin.Forms

I'm using a MasterDetailPage in my Xamarin.Forms application.
To creat the menu items, I use buttons
<MasterDetailPage.Master>
<ContentPage Title="Menu">
<StackLayout Orientation="Vertical">
<Button Text="Club-House" Command="{Binding ClubHouseCommand}" />
<Button Text="Parcours" />
<BoxView VerticalOptions="CenterAndExpand" />
<Button Text="A propos" Command="{Binding AProposCommand}" VerticalOptions="End" />
</StackLayout>
</ContentPage>
</MasterDetailPage.Master>
Is there a better way to do it ? I was thinking about something more menuish like MenuItem or else.
Thanks
There is nothing standard for implementing a menu in the Master page.
You can use
ListView
StackLayout
Grid
Or a combination. StackLayout and ListView will most likely be your best options. Personally I go for a StackLayout because it's quicker to code and render than a ListView, which may come with more issues than advantages. However if I have a large menu (which I try to avoid), ListView may be quicker to code. But ListViews are generally meant for dynamically loaded data, not static.
As for the elements, the most common will be
Button
Label
While buttons are designed for clicking, sometimes I move to label's if I don't want to have to undo all the default styling, and use the TapGestureRecognizer.
You can create a new User Control for a menu item, to avoid code replication.
All up, there is no standard. Make it easy to code and understand, and quick to render. How you do that, depends on your requirements.

How to add top right save button nav bar in content page xamarin forms

I have a form page with many fields after editing user have to scroll down all the way down to click save button. Which seems like not user friendly experience i want to move that button at top right position in content page. SO far i found a thing name ToolBarItems in which i can add button but this not helped.
Have you tried adding a ToolbarItem to your page. You can do this in Xaml like so:
<ContentPage.ToolbarItems>
<ToolbarItem Name="Menu1" Activated="OnClick" Order="Primary" Priority="0" />
<ToolbarItem Name="Menu2" Activated="OnClick" Order="Primary" Priority="1" />
</ContentPage.ToolbarItems>
Or if you prefer code behind that can also be done like so:
page.ToolbarItems.Add (new ToolbarItem (....));
Ref: http://codeworks.it/blog/?p=232

Resources