zoukankan      html  css  js  c++  java
  • WPF笔记(2)Control和pannel

      Control    

     WPF中的控件都是从Control派生而来。类层次如下:

    Object
           DispatcherObject (abstract)
                    DependencyObject
                               Visual (abstract)
                                         UIElement
                                                FrameworkElement
                                                          Control

                                                                 ContentControl
                                                                       ButtonBase (abstract)
                                                                            Button
                                                                        Window

    从上图中可以看出ButtonBase和Window都是从ContentControl继承而来,因此他们的Content属性都可以放置其他从UIElement继承来的对象。Button控件是WPF控件的原型(archetypal )控件。

         Margin和Padding

    Margin属性(defined by FrameworkElement)影响的是控件的外部空间(exterior)。

    Padding属性(defined by Control)影响的是控件的内部控件(interior)。

         Panel
         WPF定义了几个面板类。我们可以将控件或者其他元素在这上面进行布局。类层次关系如下:

    UIElement
        FrameworkElement
             Panel (abstract)
                    Canvas
                    DockPanel
                    Grid
                    StackPanel
                    UniformGrid
                    WrapPanel

                                                          

  • 相关阅读:
    【Selenium】selenium中隐藏元素如何定位?
    【Mock】【接口测试】【面试】mock-server 环境搭建—加分项!
    【Mock】mock基础、简单的单元测试代码练习。
    【WebDriver】WebDriver 常用操作
    【Loadrunner】Loadrnner 参数化策略
    ES6系列_11之Set和WeakSet数据结构
    ES6系列_10之Symbol在对象中的作用
    ES6系列_9之对象
    ES6系列_8之函数和数组
    ES6系列_7之箭头函数和扩展
  • 原文地址:https://www.cnblogs.com/jyz/p/1291684.html
Copyright © 2011-2022 走看看