Recently in a conference registration module, you need to use the Schedulercontrol control, some of the learning experience is recorded here.
Customizing the Appointment window
1. Create a new schedulercontrol1_editappointmentformshowing event,
{
E.form = new Customappointmentform (this.schedulercontrol1, e.appointment);//customappointmentform can be any new window of your own.
E.allowresize = false;
}
2.CustomAppointmentForm background needs to add Class Customappointmentform
1 Public classCustomappointmentformcontroller:appointmentformcontroller2 {3 PublicCustomappointmentformcontroller (Schedulercontrol control, appointment apt):Base(Control, APT)4 {5 }6 Public EventPropertyChangedEventHandler properychanged;7 8 protected Override voidApplychangescore ()9 {Ten Base. Applychangescore (); One } A -}
3.CustomAppointmentForm adding constructors
1 PublicCustomappointmentform (Schedulercontrol control, appointment apt)2 {3 if(Control = =NULL|| Apt = =NULL)4 Throw NewArgumentNullException ("Control");5 if(Control = =NULL|| Apt = =NULL)6 Throw NewArgumentNullException ("Apt");7 8 This. Control =control;9 This. Controller =NewCustomappointmentformcontroller (control, APT);Ten This. Apt =apt; One //dateedit1.datetime = Convert.todatetime (a); A //dateedit1.text = A; -Dateedit1.editvalue =DateTime.Now.TimeOfDay; - InitializeComponent (); the}
4. Instantiate the class you just defined and define the required properties
1 Schedulercontrol control;2 Customappointmentformcontroller Controller;3 appointment apt;4 PublicCustomappointmentformcontroller Controller {Get{returnController;} }5 PublicSchedulercontrol Control {Get{returncontrol;} }6 PublicAppointment Appointment {Get{returnApt } }
5. The foreground starts the binding of the new window to the Schedulercontrol control property. (using binding)
1<textblock x:name="Label5"margin="0,0,4,4" 2Horizontalalignment=" Left" 3grid.row="1"grid.column="0" 4text="Start time:"/>
5<dxe:dateedit x:name="DateStart"margin="0,0,4,4" 6grid.row="1"grid.column="1" 7Editvalue="{Binding controller.displaystartdate, mode=twoway}"/>
8<dxe:buttonedit x:name="Timestart"margin="0,0,0,4" 9grid.row="1"grid.column="2" Tenallowdefaultbutton="False" OneMasktype="DateTime"displayformatstring="{Binding Timeeditmask}" Amask="{Binding Timeeditmask}" -Editvalue="{Binding controller.displaystarttime, Converter={staticresource timespantodatetimeconverter}, Mode=TwoWay} " -Isenabled="{Binding IsChecked, Converter={staticresource resourcekey=invertedboolconverter}, Elementname=chkallday}"/>
DEV Schedulercontroller child window appointment instance groping