Xamarin Forms - Hide Burger Menu - c#

Since the release of XF 3.2, it provided the ability to create your own custom TitleBar. This feature works well but I have a couple of problems that I am hoping someone can help me with.
I am trying to hide the Burger Menu icon, but so far I have not been able to.
I can hide the Back Button by doing the following:
NavigationPage.HasBackButton="False"
This does however still leave a slight vertical bar on the left side of the TitleBar, so if someone knows how to also remove that then great.
I was expecting the same code to also hide the Burger Menu icon but this is still present so I'm hoping someone can help me to remove this.
Alternatively, if anyone knows of a way I can either change the icon (to use my own) or to change the colour of it (as it is always white and I want it to be black), then that would be great.
Cheers...

For anyone using Shell you can hide the hamburger button and implicitly disable the flyout menu using:
Globally inside AppShell (or whatever named), also you can change the hamburger icon
<Shell>
...
FlyoutBehavior="Disabled"
FlyoutIcon="flyouticon.png"
..
</Shell>
Or hide it only in some pages:
<ContentPage>
...
Shell.FlyoutBehavior="Disabled"
</ContentPage>

Related

In C# WPF window, adding button for topmost beside standard window buttons

I'd like add a button for changing window state to topmost to the built-in window buttons such as maximize, minimize, and close [please refer to this pic.]
However, I'm having hard time finding the way out as WPF seems not to provide such an API. I even thought using the icon next to the window title functioning as the button for topmost, but looks not feasible.
Is there anyway like using .dll or could I inherit the window class and add the button and corresponding event handler anyhow?
Thanks.
It will be very difficult as you can see below link:
How to add an extra button to the window's title bar?
To make things easy, you should consider implementing a custom window for that. This window will have custom buttons including Close,Minimize,Maximize along with any other buttons as well.

Create wizard some clarification

I want to create simple wizard with 3 pages
Page 1 have just next button
Page 2 have next and previous
Page 3 have previous and finish
I have created the pages and add to them needed buttons and in the events I have call to the next pages, for instance in page one in the button click I added the following code
private void Button_Click(object sender, RoutedEventArgs e)
{
p2 = new Page2();
NavigationService.Navigate(p2);
}
In the main window cs I have changed the inheritance to NavigationWindow instead of Window and in the xaml also. Currently its working but I have 3 questions.
The pages which displayed is part of the main window, how can i avoid it, since when I run it the buttons place is not like I put in the designer? It was changed.
The button currently in the Grid, should I put them in different control (the button place should be like any wizard in the left buttom of the page) ?
How can I avoid the navigation arrows in the page right upper screen?
Thanks!
To answer your questsions in reverse,
3. How can I avoid the navigation arrows in the page upper right screen?
I have an opensource library http://winchrome.codeplex.com/ that re-styles navigation windows in several ways. For example these are all NavigationWindow s
In short you just style the NavigationWindow to only show the parts you want.
2.The button currently in the Grid, should I put them in different control (the button place should be like any wizard in the left buttom of the page) ?
If you look at the styles from WinChrome then you will see that it is just a case of rebuiliding the UI as you want and providing a ContentPresenter to hold your pages. e.g. the VS2012 style applies lots of styles on the window but avoids adding back and forward buttons., whereas the Win7 style rebuilds the back and forwards in a Win7 Style.
If you do this however you will need a means of passing your enabled or visible states to the buttons outside the pages. Take a look at http://www.codeproject.com/Articles/8197/Designer-centric-Wizard-control for how to do this in Winforms. In WPF you could either derive from your Pages to create WizardPage classes with CanBack, CanNext or IsFinish properties, or alteratively define attached properties to do the same (There are examples of how to do this in VS2012.cs where we define the glow color)
And finally
1. The pages which displayed is part of the main window, how can i avoid it, since when I run it the buttons place is not like I put in the designer? It was changed.
I'd need to see some code to comment on how you've done it, but if you look at any of the demo programs in WinChrome then you can see how I've done it without problems.
Good luck!

devcomponents ribbon bar quick access toolbar

I trying to use the Quick access toolbar on Dev Components Ribbon Bar, it works fine if I set it in the designer.
But if I change the 'CanCustomize' flag on a 'BaseItem' on the form load event the customize dialog does NOT pick this up.
I wondered if there is a command I can call to tell the ribbon bar to redefine itself?
or if I have to redefine the ribbon bar entirely?
I have tried calling RecalcLayout as beloww
BaseItem.CanCustomize = false
RibbonBar.RecalcLayout()
but it does not work.
Hi have figured out what works for this.
BaseItem.visible = false
this will stop it from being shown on the QAT, but it will still be visible on the customize menu, i still want to stop some of these being shown, but have NOT figured that out yet.

C# Custom Border Titlebar Menu

I have created C# winforms with custom border and titlebar. I have disabled the controlbox (ControlBox = false) on the forum but it seems to also disable the system context menu that appears when you right click the titlebar. Is it possible to have the context menu while settings the controlbox to false?
Short answer as far as i know No
Long answer you cant use the context menu as it is part of the control box itself
#System.Object has right, context menu is part of the control box, but if you really want to have it, you can write it your own, as I see the default titlebar context menu in windows7(restore, size,move,exit,etc..) is no big deal.
OR
You could rewrite your project in c# WPF, there is no much difference. And if you're planning more complex design, it should pay off in the long run.

Overlapping Window/Page or Custom messagebox?

I want to preface this by saying I'm a noob with WPF/.net programming.
Here is my question that requires a bit of guidance. I have a window and I load pages in and out as my navigation. On one particular page, when the user clicks on one of the items (button for example), I need to display a small form to gather more information. I'm not sure what the best approach is... what I would love (but do not know where to begin even searching for this solution) would be to open a popup balloon style window with a few textboxes and a submit button.
Other options I've explored would be to use a separate page. Save off the current page and load a new page with these textboxes and a submit button. Or to use a custom messagebox instead (least favorite option).
I would like this new extra info page to blend in with rest of the app so that the main page is still visible in the background. Any suggestions??
You can use WPF's Popup control
<Popup>
<!-- Your Content Here -->
</Popup>
Personally I have issues with WPF's Popup, so have my own custom UserControl that works like a Popup.
I ended up using modal window (ShowDialog) method for this.

Categories

Resources