Skip to content

Instantly share code, notes, and snippets.

@mrlacey
Created November 8, 2016 03:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrlacey/332747eea39992c1db21a0a8d7e63704 to your computer and use it in GitHub Desktop.
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
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
}
}
}
}
@mrlacey
Copy link
Author

mrlacey commented Nov 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment