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; }
  • 相关阅读:
    mysql数据库的基本操作:创建数据库、查看数据库、修改数据库、删除数据库
    CentOS7安装python3
    如何修改博客园的标题,文本,表格等的显示样式
    html:常见行内标签,常见块级标签,常见自闭合标签
    drupal 精彩文章
    DRUPAL8模版命名规则
    编写.info文件
    module.inc 模块
    drupal 内容类型
    drupal
  • 原文地址:https://www.cnblogs.com/mrfangzheng/p/1258294.html
Copyright © 2011-2022 走看看