Click here to Skip to main content
13,797,304 members
Click here to Skip to main content


557 bookmarked
Posted 24 Feb 2008
Licenced CPOL

WPF Diagram Designer - Part 3

, 29 Feb 2008
Connecting items
using System.Windows;
using System.Windows.Controls;

namespace DiagramDesigner
    // Implements ItemsControl for ToolboxItems    
    public class Toolbox : ItemsControl
        // Defines the ItemHeight and ItemWidth properties of
        // the WrapPanel used for this Toolbox
        public Size ItemSize
            get { return itemSize; }
            set { itemSize = value; }
        private Size itemSize = new Size(50, 50);

        // Creates or identifies the element that is used to display the given item.        
        protected override DependencyObject GetContainerForItemOverride()
            return new ToolboxItem();

        // Determines if the specified item is (or is eligible to be) its own container.        
        protected override bool IsItemItsOwnContainerOverride(object item)
            return (item is ToolboxItem);

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Austria Austria
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web06 | 2.8.181207.3 | Last Updated 29 Feb 2008
Article Copyright 2008 by sukram
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid