コード例 #1
0
ファイル: FormSample.cs プロジェクト: herohut/elab
        private void button1_Click(object sender, EventArgs e)
        {
            mediControl = new MediControlViewModel
            {
                MedicationEntries =
                    new System.Collections.ObjectModel.ObservableCollection
                    <MedicationEntryViewModel>(
                    CreateSampleEntry(1))
            };


            elementHost1.Child = new MediControl { DataContext = mediControl };
        }
コード例 #2
0
 protected override void SetApplicationItem()
 {
     if (!this.bodyPanel.Controls.Contains(_wpfHost))
     {
         var mediControl = new MediControlViewModel
         {
             MedicationEntries =
                 new System.Collections.ObjectModel.ObservableCollection
                 <MedicationEntryViewModel>(
                 FormSample.CreateSampleEntry(200))
         };
         _mediControl.DataContext = mediControl;
         _wpfHost.Child = _mediControl;
         this.bodyPanel.Controls.Add(_wpfHost);
     }
 }