kokokok
kokokok

Reputation: 1102

How to place SplitView in the header of a phone in UWP?

I am using SplitView in a desktop app. It works fine. Now, I want to use it in a phone with Windows 10. I want to avoid the permanent vertical panel because of the small screen of a phone. I would like to hide the this bar, like for example Calendar App of Windows Mobile 10 does.Is it possible? I cannot find the property.

Upvotes: 1

Views: 1121

Answers (3)

nicruo
nicruo

Reputation: 516

Just created a sample project for others to follow while doing SplitView in both mobile and desktop: https://github.com/nicruo/Splitview-UWP

Upvotes: 0

jicler
jicler

Reputation: 823

Just set DisplayMode property to "Overlay".

DisplayMode="Overlay"

Upvotes: 2

Joseph
Joseph

Reputation: 1074

You can keep a device type enumeration to keep track of the devices,ie wether its a phone or tablet like this

public enum DeviceTypeEnum
{
    Phone = 1,
    Tablet = 2
} 

You can identify whether its a tablet or phone using the following code

var  deviceType = ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons") ? DeviceTypeEnum.Phone : DeviceTypeEnum.Tablet; 

Now using the devicetype property you can do whatever applicable to phone and tablet.

In your case you could write a enum to visibility converter which be visible if the device type is tablet.

Upvotes: 0

Related Questions