Skip to content

Commit

Permalink
Adds DesignMode class
Browse files Browse the repository at this point in the history
Provides a static boolean that can be checked by application authors whether their app is running in a tool considered to be a designer or previewer. Tool authors can set this value to true whenever the app is running in that context or not.

Resolves xamarin#1731
  • Loading branch information
therealjohn committed Feb 8, 2018
1 parent ff40c5b commit e156398
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Xamarin.Forms.Core/DesignMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Xamarin.Forms.Core
{
public static class DesignMode
{
/// <summary>
/// Enables you to detect whether your app is running in a visual designer or previewer.
/// Applications should not set this property. Instead, this is used by tools that will run an
/// application in a visual designer or previewer.
/// </summary>
/// <remarks>
/// A public setter to allow for third-party tools to enable this.
/// </remarks>
public static bool DesignModeEnabled { get; set; }
}
}

0 comments on commit e156398

Please sign in to comment.