コード例 #1
0
 public static Brush GetContrastBasedPaletteBrush(Color color)
 {
     if (HighContrastHelper.IsHighContrastOn())
     {
         color = ValueHelper.InvertColor(color);
     }
     return((Brush) new SolidColorBrush(color));
 }
コード例 #2
0
 /// <summary>Initializes a new instance of the <see cref="T:System.Windows.Controls.InkPresenter" /> class. </summary>
 // Token: 0x06004F2F RID: 20271 RVA: 0x00163860 File Offset: 0x00161A60
 public InkPresenter()
 {
     this._renderer = new Renderer();
     this.SetStrokesChangedHandlers(this.Strokes, null);
     this._contrastCallback = new InkPresenter.InkPresenterHighContrastCallback(this);
     HighContrastHelper.RegisterHighContrastCallback(this._contrastCallback);
     if (SystemParameters.HighContrast)
     {
         this._contrastCallback.TurnHighContrastOn(SystemColors.WindowTextColor);
     }
     this._constraintSize = Size.Empty;
 }
コード例 #3
0
        //-------------------------------------------------------------------------------
        //
        // Constructors
        //
        //-------------------------------------------------------------------------------

        #region Constructors

        /// <summary>
        /// The constructor of InkPresenter
        /// </summary>
        public InkPresenter()
        {
            // Create the internal Renderer object.
            _renderer = new Ink.Renderer();

            SetStrokesChangedHandlers(this.Strokes, null);

            _contrastCallback = new InkPresenterHighContrastCallback(this);

            // Register rti high contrast callback. Then check whether we are under the high contrast already.
            HighContrastHelper.RegisterHighContrastCallback(_contrastCallback);
            if (SystemParameters.HighContrast)
            {
                _contrastCallback.TurnHighContrastOn(SystemColors.WindowTextColor);
            }

            _constraintSize = Size.Empty;
        }