How to implement facebook like menu (left menu) in windows store app - xaml

Basically, I want to be able to create a menu which on clicking on some button will appear from left (or right) and on clicking anywhere on main screen the user would be able to dissmis the menu. For example the facebook app has something similar on all platforms (so on Windows 8 also).
I have found a solution for Windows phone (http://sviluppomobile.blogspot.cz/2013/08/add-lateral-menus-to-windows-phone.html), which is not the way to go for Windows 8. Maybe I could use some hand made animation for aflyover, which would be in default outside of viewport. However, I guess there must be better or ideally already proofed solution.
Also I found two questions here on SO, which asked for same thing I guess, but no answers there ...
How to do: lateral menu like in "Music" app on Windows 8 / 8.1 and
https://stackoverflow.com/questions/22613421/windows-8-1-apps-left-menu
I know, that it is not the best way on windows platform to implement menu (we have top app bar, right), but our customer just wants this.
I would like to ask for some hints or ideally a code for a native implementation for Windows 8.1 using XAML (C# or VB.NET). Thanks to everybody who will give it a thought.

You'd put a StackPanel with Orientation="Horizontal" in a ScrollViewer. Put three panels in the StackPanel - let's make them Grids and call them: left, middle and right. On SizeChanged events of the ScrollViewer - set the Width and Height of the middle grid to the same values as ActualWidth and ActualHeight of the ScrollViewer and perhaps set the left and right grids to be a little bit narrower to leave space to see a little bit of the middle panel when you scroll to the ends. Make the ScrollViewer scroll horizontally by setting Horizontal/VerticalScrollMode and scroll bar visibilities and make the ScrollViewer snap to your grid panels by setting the HorizontalSnapPointsType and HorizontalSnapPointsAlignment properties. Also set IsHorizontalRailEnabled on the horizontal ScrollViewer to true if you have any vertical ScrollViewers in your panels and make their IsVerticalRailEnabled="true" so only one of them scrolls depending on the manipulation direction. Finally - put a transparent overlay panel as a top child of the middle panel handle the tap events on the overlay to scroll the middle panel back into view when it isn't centered and in the handlers of the menu buttons scroll the horizontal ScrollViewer to the start/end.

Related

UWP menu without hamburger

This is my first UWP app
I have a SplitView. On the right side I want a menu. On the left side I want to be able to load different pages into it(frame)
The only menu I can find have that hamburger in it(AppBarButton).
This app will only run on windows desktop machines so I do not have need of the hamburger and it will be rather useless.
I have spent the last two nights looking for options but all I get are hamburgers.
Can someone please point me to an example of a no hamburger menu or a tutorial of some kind?
I am sure I can figure it out once I know what elements to use, I just need a push in the correct direction.
What you need is a base page (let's call it "HostView") this will simply have a SplitView control with the DisplayMode set to Inline and the IsPaneOpen set to true. You can also set the side panel width by using the OpenPaneLength property.
Your menu buttons go into the SplitView.Pane and you place a Frame control in the SplitView.Content. This frame will navigate to the correct page when a menu item is selected.
If you set the properties as I said above then you will not need a Hamburger menu to open the side panel at all. However, please consider the fact that users will want to resize your app, and they might resize to a very narrow size which means it might not have enough space to display all the content. IN which case you will need to collapse the side panel and show a hamburger menu to open it when needed. You don't have to do this, but it is something to consider.

How to implement the Windows 10 OneNote Menu in Universal Windows Platform app

I would like to implement the OneNote app menu in my own UWP app. In the closed state, the menu only shows the 'hamburger' button, but when clicked a menu pane slides in from the left.
I have tried to use the SplitView, but it doesn't allow me to set the width to 0 when collapsed, always showing a narrow line on the left side. I also considered using the 8.1 Flyout control, but that doesn't see to animate the correct way.
So, what's the correct way to implement the OneNote menu behavior?
You need the SplitView, but don't mess with the width of its pane.
Instead, set the DisplayMode to Inline (or Overlay) and toggle the IsPaneOpen property.

Windows Phone 8.1 Create a Swipeable Scrollable Control

I am trying to create an animation to a control.
So think of the animation and control of a now playing page on most touch screen devices. You see the control (album photo) and swipe either way and get it to slide off the screen and then the next control (album photo) slides on in its place.
I am not asking for you to code me this, but I am having trouble wrapping my head around a way that this could be done.
The control content is always changing, when you swipe one way, an image is removed from the view and then the next is added.
What you need is FlipView control which can get you the interface you described.
Here are some references:
Quickstart: Adding FlipView controls (XAML)
XAML FlipView control sample

Why the WebView is always on top and can't handle focus etc.?

Suppose you have in your Metro application the WebView component taking all the "page" height (except the "title bar" of course). At the left side from the WebView you have some other elements. You also have some buttons in appBar with ListView menus attached to the button press events. Now try to see your ListViews and also try to move focus between the page elements with TAB key ;)
I already have some workarounds.
I just wanted to ask if somebody knows WHY Microsoft did it so?
Thanks.
The WebView has it's own HWND (Window), while your Metro app renders in a second HWND. There is a long history in Windows development regarding windows and overlaps. Usually when a window is in front of another window, the OS only draws the top window pixels.
That's what's happening here. The WebView windows is drawing over top of your other UI elements.

ScrollViewer + ScrollBar arrows

When user clicks on the scroll bar arrow, the content shifts very slow(horizontal offset changes on 16). How can I increase the speed of shifting when I click on arrows?
(SmallChange doesn't work)
Unfortunately, it's quite hard-coded in the scroll viewer.
The only way I know of, is to make a new panel based on the panel that you want to use in the scroll viewer, and implement IScrollInfo for it.
Then, setting this panel as the content of the scroll viewer and setting CanContentScroll to true.
StackPanel implements IScrollInfo but other panels do not.