zoukankan      html  css  js  c++  java
  • Dependency property changed example

    public double ScaleFactor
    {
        get { return (double)GetValue(ScaleFactorProperty); }
        set { SetValue(ScaleFactorProperty, value); }
    }
    
    // Using a DependencyProperty as the backing store for ScaleFactor.  This enables animation, styling, binding, etc...
    public static readonly DependencyProperty ScaleFactorProperty =
        DependencyProperty.Register("ScaleFactor", typeof(double), typeof(ToolBlockControl), 
    new UIPropertyMetadata(1.0,new PropertyChangedCallback(ScaleFactorChangedCallBack))); private static void ScaleFactorChangedCallBack(DependencyObject obj, DependencyPropertyChangedEventArgs args) { var toolBlockControl = obj as ToolBlockControl; double scaleFactor = (double)args.NewValue; toolBlockControl.Width = toolBlockControl.mActualWidth * scaleFactor; toolBlockControl.Height = toolBlockControl.mActualHeight * scaleFactor; }
  • 相关阅读:
    英文字母打字速度测试游戏代码
    JS写一个JS解释器
    JS中try.. catch..的用法
    使用HTML CSS和JavaScript创建图像动画
    6个强大的CSS选择器
    TypeScript 3.9稳定版本新增功能
    10个JavaScript代码片段,使你更加容易前端开发。
    BZOJ.3811.玛里苟斯(线性基)
    Bluestein's Algorithm
    AGC 002E.Candy Piles(博弈论)
  • 原文地址:https://www.cnblogs.com/mrfangzheng/p/1258294.html
Copyright © 2011-2022 走看看