Click here to Skip to main content
13,344,281 members (54,977 online)
Click here to Skip to main content


110 bookmarked
Posted 28 Oct 2007

A WPF Problem Solved Two Very Different Ways - Using XAML Only - Using a Custom Control

, 28 Oct 2007
Article on solving a problem using a XAML only approach and then solving that same problem using WPF custom controls.
Public Class CheckListBoxIndicatorItem

#Region " Private Declarations "

    Private _dblOffset As Double
    Private _bolIsSelected As Boolean = False
    Private _lbiRelatedListBoxItem As ListBoxItem

#End Region

#Region " Properties "

    Public Property Offset() As Double
            Return _dblOffset
        End Get
        Set(ByVal Value As Double)
            _dblOffset = Value
        End Set
    End Property

    Public Property IsSelected() As Boolean
            Return _bolIsSelected
        End Get
        Set(ByVal Value As Boolean)
            _bolIsSelected = Value
        End Set
    End Property

    Public Property RelatedListBoxItem() As ListBoxItem
            Return _lbiRelatedListBoxItem
        End Get
        Set(ByVal Value As ListBoxItem)
            _lbiRelatedListBoxItem = Value
        End Set
    End Property

#End Region

#Region " Constructor "

    Public Sub New(ByVal dblOffset As Double, ByVal bolIsSelected As Boolean, ByVal lbiRelatedListBoxItem As ListBoxItem)

        _dblOffset = dblOffset
        _bolIsSelected = bolIsSelected
        _lbiRelatedListBoxItem = lbiRelatedListBoxItem

    End Sub

#End Region

End Class

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

Karl Shifflett
Architect Infragistics
United States United States

I’m a passionate Platform Architect at Infragistics.

I’m a long-time WPF-Prism fanatic who enjoys writing developer tools and line of business applications.

My current front end passions are: XAML platforms (Xamarin.Forms, Xamarin, UWP, and WPF), Electron, ES2015 (ES6), Node.js, Aurelia, and AngularJS (Angular 1.5.x).

For the back end I use what is appropriate for the project: SQL Server and ASP.NET WebAPI, MongoDB, Express, Azure, Firebase, etc.

I am very pragmatic software engineer and strive to write simple, maintainable, and testable code. Simple code allows for solving complex problems in a maintainable way.

My Blog

My Github Repros

My YouTube Videos

Just a grain of sand on the worlds beaches.

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180111.1 | Last Updated 28 Oct 2007
Article Copyright 2007 by Karl Shifflett
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid