Attached properties in WPF

Ratings:
(4)
Views:790
Banner-Img
  • Share this blog:

 

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.

You liked the article?

Like : 0

Vote for difficulty

Current difficulty (Avg): Medium

Recommended Courses

1/15

About Author
Authorlogo
Name
TekSlate
Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.


Stay Updated


Get stories of change makers and innovators from the startup ecosystem in your inbox