Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Disable the Screenshot Functionality in Windows Phone 8.1 Apps

DZone's Guide to

Disable the Screenshot Functionality in Windows Phone 8.1 Apps

· Java Zone ·
Free Resource

Verify, standardize, and correct the Big 4 + more– name, email, phone and global addresses – try our Data Quality APIs now at Melissa Developer Portal!

Intro

In Windows Phone 8.1, anyone can take a screenshot by pressing the power button and the volume-up key at the same time. A customer was concerned about privacy in their enterprise app and asked me if they could disable this functionality for Windows Phone 8.1 (both WinRT and Silverlight apps). I researched this and found that this could be accomplished with the following code listed below:

For Windows Phone 8.1 Silverlight Apps

public MainPage()
{
    this.InitializeComponent();

    if (this.CanSetScreenCaptureEnabled())
    {
       this.SetScreenCaptureEnabled(false);
    }

}

For Windows Phone 8.1 Runtime Apps

public MainPage()
{
    this.InitializeComponent();
    ApplicationView.GetForCurrentView().IsScreenCaptureEnabled = false; 
}

Wrap-Up

I hope this helps someone else out there that runs into the same problem!


Developers! Quickly and easily gain access to the tools and information you need! Explore, test and combine our data quality APIs at Melissa Developer Portal – home to tools that save time and boost revenue. Our APIs verify, standardize, and correct the Big 4 + more – name, email, phone and global addresses – to ensure accurate delivery, prevent blacklisting and identify risks in real-time.

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}