zoukankan      html  css  js  c++  java
  • UWP开发学习笔记3

    获取可视化状态列表

    private void Button_Click(object sender, RoutedEventArgs e)
    {
        //获取CheckBox控件可视化树中的子元素数量
        int count = VisualTreeHelper.GetChildrenCount(ckbox);
        if (count > 0)
        {
            //获取CheckBox控件模板中的根元素
            FrameworkElement rootElement = VisualTreeHelper.GetChild(ckbox, 0) as FrameworkElement;
            if (rootElement != null)
            {
                //获取状态组列表
                var groups = VisualStateManager.GetVisualStateGroups(rootElement);
                foreach (VisualStateGroup group in groups)
                {
                    Debug.WriteLine("状态组:" + group.Name);
                    foreach (VisualState vs in group.States)
                    {
                        Debug.WriteLine("	状态:" + vs.Name);
                    }
                }
            }
        }
    }
  • 相关阅读:
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    netty中Pipeline的ChannelHandler执行顺序案例详解
    Pi-设置无线
    Pi1-Centos
    gitlab升级
    ansible
    我也玩Jenkins
  • 原文地址:https://www.cnblogs.com/wzwyc/p/10228345.html
Copyright © 2011-2022 走看看