zoukankan      html  css  js  c++  java
  • 如何自定义ToggleSwitch控件样式(转)

    打开Toolkit源码中的Generic.xaml文件可以看到其默认样式,发现接结构组成元素为:

    1. ToggleSwitch

      其中,ToggleSwitch又由以下几个部分组成:

      • Header
      • Content
      • ToogleSwitchButton
    2. ToogleSwitchButton

      ToggleSwitchButton由以若干个Grid和Boder组成,它们分别是:

      • Grid:SwitchRoot
      • Grid:SwitchTrack
      • Grid:SwitchBottom
      • Rectangle:SwitchBackground(包含两个Border,A和B)
      • Border:SwitchThumb
      • Border:ThumbCenter

    我们可以设置其各个元素显示不同的颜色,例如将各元素设为以下颜色:

    • Header.ForeGround – Blue
    • Content.ForeGround — Brown
    • ToggleSwitch.SwitchForeGround —Orange
    • SwitchRoot.Background — Black
    • SwitchTrack.Background — Green
    • SwitchBottom.Background — Green
    • SwitchBackground.BoderA.BorderBrush — Red
    • SwitchBackground.BoderA.BorderBrush — White
    • SwitchThumb.BorderBrush — Gold
    • ThumbCenter.BorderBrush — Aqua
    • ThumbCenter.Background — Chocolate
  • 相关阅读:
    position之属性
    Grid网格布局
    position 属性指定了元素的定位类型
    注册表单
    简单页面
    自我介绍
    正则表达式
    Dom和Bom
    颜色和单位
    伪类和伪元素的区别
  • 原文地址:https://www.cnblogs.com/hebeiDGL/p/2544805.html
Copyright © 2011-2022 走看看