This is a migrated thread and some comments may be shown as answers.

Relating the GUI for an Appointment to the underlying Appoingment's Start and End proeprties

1 Answer 41 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
newbie
Top achievements
Rank 1
newbie asked on 27 Apr 2011, 10:07 PM
I have implemented a class that inherits from the ScheduleView.Appointment class. The only thing that I added to this class is a constructor and 2 properties (Start & End).

When I drag an appointment within the ScheduleView, the Start and End properties (that overload the base class's Start and End properties) are not modified....the break points are never hit.

Since the class that inherits from ScheduleView.Appointment is also going to be wrapping my Model's "Appointment" class...I would really appreciate someone telling me how to get the GUI to update the Start and End properties when you drag the Appointment's start/end points to a new time value.

This is my very very simple appointment class...the start and end properties are never set when I drag an appointment in the ScheduleView:

Public Class TimeZoneAppointment
    Inherits Telerik.Windows.Controls.ScheduleView.Appointment
 
    Private _myModelAppointment As ModelAppointment
 
    Public Overloads Property Start As Date
        Get
            Return MyBase.Start
        End Get
        Set(ByVal value As Date)
            'this will also modify the model appointment's start property
            MyBase.Start = value
        End Set
    End Property
    Public Overloads Property [End] As Date
        Get
            Return MyBase.End
        End Get
        Set(ByVal value As Date)
            'this will also modify the model appointment's end property
            MyBase.End = value
        End Set
    End Property
 
 
 
    Public Sub New(ByVal ma As ModelAppointment)
        MyBase.New()
        _myModelAppointment = ma
         
        MyBase.Start = _myModelAppointment.startDate
        MyBase.End = _myModelAppointment.endDate
 
        Dim recurrencePattern As New RecurrencePattern()
        recurrencePattern.Frequency = RecurrenceFrequency.Weekly
        Dim recurrenceRule As New RecurrenceRule(recurrencePattern)
 
        MyBase.RecurrenceRule = recurrenceRule
 
    End Sub
End Class


Thanks for your time and help!

1 Answer, 1 is accepted

Sort by
0
newbie
Top achievements
Rank 1
answered on 28 Apr 2011, 02:18 PM
I know what's happening.

The ScheduleView.Appointment's Start and End properties are dependency properties so my overloaded versions of them are being bypassed all together.

In order to get around this, I removed my Start and End properties, and added a method that handles the ScheduleView.Appointment's PropertyChanged event. I added my additional logic (that forwards the information to my Model class) in that method.


Tags
ScheduleView
Asked by
newbie
Top achievements
Rank 1
Answers by
newbie
Top achievements
Rank 1
Share this question
or