• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

Attached properties in WPF

 

Attached properties in WPF

In General when we work with WPF we use the control hierarchies work with WPF we use the control hierarchies when we are creating. In general when we create any other control i.e in parent control are child controls will get the required properties of parent control attached to it
These properties of parent controls attached to its child controls are known as attached properties.
Doc Panels
This control is used to place the controls on the borders of the window or on the top order or left border or bottom border etc…

 

Example

Screenshot_7

 

 

Menu

Every Menu Item within the Menu will contain Items collection. Any menu we want to create within the menu control or in any of the Menu. Item we create a new window within your application

                      ↓

Create a doc panel control with the name document 1

                    ↓

Create a menu control with the name Menu 1

                    ↓

Select Menu1 go to properties window

                    ↓

set vertical alignment as top

                    ↓

Click on Items collection ellipses button

          ↓

Then click on Add

                    ↓

à One menu Item is created select this menu Item

          ↓

Select this Menu Item

              ↓

Go to properties at right side

                    ↓

Type sile in header and name properties

            ↓

similarly one more menu Item and Edit

        ↓

 

Select the Menu Item File

         ↓

Go to properties

          ↓

click on Items collection

             ↓

you get one more collection editor window

       ↓

In that create two sub menus

    ↓

New, open

     ↓

Click on OK

   ↓

Select Menu Item Edit

        ↓

Click on Items collection

          ↓

another collection Editor will be opened

              ↓

Similarly create sub menus cut, copy, paste in the

      ↓

Click on OK

Wrap panel Control

This control is used to provide flexibility to the user so that when user increases or decreases width & height of the window. The controls present in this wrap panel will be wrapped automatically to the right side of the window or the bottom of the window

Eg:  With wrap panel

Screenshot_8

 

 

 

Create a new window within the application

      ↓

Create wrap panel

      ↓

create all the controls within the wrap panel

      ↓

Run the application and check

      ↓

When you increase or decrease the size of the window, the controls will be wrapped accordingly and arranged within the window.

Summary
Review Date
Reviewed Item
Attached properties in WPF
Author Rating
5

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on Attached properties in WPF"

Leave a Message

Your email address will not be published. Required fields are marked *

Site Disclaimer, Copyright © 2016 - All Rights Reserved.