DEV Schedulercontroller child window appointment instance groping

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.