Created
November 8, 2016 03:35
-
-
Save mrlacey/332747eea39992c1db21a0a8d7e63704 to your computer and use it in GitHub Desktop.
For creating XAML based solution for limiting which build controls are included in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Windows.UI.Xaml; | |
using Windows.UI.Xaml.Controls; | |
namespace OnlyIn | |
{ | |
public class DebugBuild : ContentControl | |
{ | |
protected override void OnApplyTemplate() | |
{ | |
base.OnApplyTemplate(); | |
var content = this.Content as UIElement; | |
if (content != null) | |
{ | |
#if DEBUG | |
content.Visibility = Visibility.Visible; | |
#else | |
content.Visibility = Visibility.Collapsed; | |
#endif | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Don't use this. Instead use https://gist.github.com/mrlacey/69465b3297726abbd0635e00bb95a5a9