Click here to Skip to main content
15,886,110 members
Articles / Programming Languages / Visual Basic 10

Generic Multi-Select MVVM ListBox Drag and Drop Helper with Custom Feedback for Silverlight 4.0

Rate me:
Please Sign up or sign in to vote.
4.91/5 (3 votes)
11 Apr 2011CPOL9 min read 53.3K   981   13  
This article focuses on developing an MVVM compatible ListBox-to-ListBox drag/drop helper for Silverlight.
'/* Copyright (c) 2011, Graeme Grant (gragra33@hotmail.com)
' * All rights reserved.
' *
' * Redistribution and use in source and binary forms, with or without
' * modification, are permitted provided that the following conditions are met:
' *
' *   * Redistributions of source code must retain the above copyright
' *     notice, this list of conditions and the following disclaimer.
' * 
' *   * Redistributions in binary form must reproduce the above copyright
' *     notice, this list of conditions and the following disclaimer in the
' *     documentation and/or other materials provided with the distribution.
' * 
' * THIS SOFTWARE IS PROVIDED BY GRAEME GRANT ``AS IS'' AND ANY
' * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
' * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
' * DISCLAIMED. IN NO EVENT SHALL GRAEME GRANT BE LIABLE FOR ANY
' * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
' * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
' * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
' * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
' * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
' * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
' */

Public Class SummaryTagModel : Inherits TagModel

#Region "Constructor"

    Sub New()
        MyBase.new()
    End Sub

#End Region

#Region "Properties"

    Public Const viewsTotalPropertyName As String = "viewsTotal"

    Private _viewsTotal As Integer
    Public Property viewsTotal() As Integer
        Get
            Return _viewsTotal
        End Get
        Set(ByVal value As Integer)
            If _viewsTotal = value Then
                Return
            End If
            _viewsTotal = value
            RaisePropertyChanged(viewsTotalPropertyName)
        End Set
    End Property

    Public Const num_likesTotalPropertyName As String = "num_likesTotal"

    Private _num_likesTotal As Integer
    Public Property num_likesTotal() As Integer
        Get
            Return _num_likesTotal
        End Get
        Set(ByVal value As Integer)
            If _num_likesTotal = value Then
                Return
            End If
            _num_likesTotal = value
            RaisePropertyChanged(num_likesTotalPropertyName)
        End Set
    End Property

#End Region

    Public Overloads Sub SetData(Data As SummaryTagModel)

        With Data
            viewsTotal = .viewsTotal
            num_likesTotal = .num_likesTotal
        End With
        MyBase.SetData(Data)

    End Sub

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
Technical Lead
Australia Australia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions