Click here to Skip to main content
12,299,012 members (47,126 online)
Click here to Skip to main content

Stats

620K views
5.4K downloads
109 bookmarked
Posted

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

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


    Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert

        Dim dbl As Double

        If Double.TryParse(value.ToString, dbl) = True Then
            Return dbl + 5
        Else
            Return value
        End If

    End Function

    Public Function ConvertBack(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack

    End Function
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.

License

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

Share

About the Author

Karl Shifflett
Architect
United States United States

Current passions are: Electron, ES6, Node.js, Angular, Aurelia, hybrid, Socket.IO, MQTT, and IoT.

Still keen on WPF and Prism, but currently Electron and ES6 deliver the same apps with much better performance, and they are cross-platform.

My Github Repros

Just a grain of sand on the worlds beaches.


You may also be interested in...

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