Click here to Skip to main content
15,878,809 members
Articles / Desktop Programming / WPF

WPF: A Beginner's Guide - Part 6 of n

Rate me:
Please Sign up or sign in to vote.
4.95/5 (93 votes)
5 Apr 2008CPOL23 min read 330.5K   5.2K   263  
An introduction into WPF Styles and Templates.
Imports System
Imports System.Collections.Generic
Imports System.Text

    Public Class SolarSystemObject
        Private m_name As String

        Public Property Name() As String
            Get
                Return m_name
            End Get
            Set(ByVal value As String)
                m_name = value
            End Set
        End Property

        ' In Astronomic Units (AU) 
        Private m_orbit As Double

        Public Property Orbit() As Double
            Get
                Return m_orbit
            End Get
            Set(ByVal value As Double)
                m_orbit = value
            End Set
        End Property

        ' In Km 
        Private m_diameter As Double

        Public Property Diameter() As Double
            Get
                Return m_diameter
            End Get
            Set(ByVal value As Double)
                m_diameter = value
            End Set
        End Property

        Private m_image As Uri

        Public Property Image() As Uri
            Get
                Return m_image
            End Get
            Set(ByVal value As Uri)
                m_image = value
            End Set
        End Property

        Private m_details As String

        Public Property Details() As String
            Get
                Return m_details
            End Get
            Set(ByVal value As String)
                m_details = value
            End Set
        End Property

        Public Sub New(ByVal name As String, ByVal orbit As Double, ByVal diameter As Double, ByVal image As Uri, ByVal details As String)
            Me.m_name = name
            Me.m_orbit = orbit
            Me.m_diameter = diameter
            Me.m_image = image
            Me.m_details = details
        End Sub

        Public Overloads Overrides Function ToString() As String
            Return Me.m_name
        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)


Written By
Software Developer (Senior)
United Kingdom United Kingdom
I currently hold the following qualifications (amongst others, I also studied Music Technology and Electronics, for my sins)

- MSc (Passed with distinctions), in Information Technology for E-Commerce
- BSc Hons (1st class) in Computer Science & Artificial Intelligence

Both of these at Sussex University UK.

Award(s)

I am lucky enough to have won a few awards for Zany Crazy code articles over the years

  • Microsoft C# MVP 2016
  • Codeproject MVP 2016
  • Microsoft C# MVP 2015
  • Codeproject MVP 2015
  • Microsoft C# MVP 2014
  • Codeproject MVP 2014
  • Microsoft C# MVP 2013
  • Codeproject MVP 2013
  • Microsoft C# MVP 2012
  • Codeproject MVP 2012
  • Microsoft C# MVP 2011
  • Codeproject MVP 2011
  • Microsoft C# MVP 2010
  • Codeproject MVP 2010
  • Microsoft C# MVP 2009
  • Codeproject MVP 2009
  • Microsoft C# MVP 2008
  • Codeproject MVP 2008
  • And numerous codeproject awards which you can see over at my blog

Comments and Discussions