예제 #1
0
        private static FrameworkElement BuildMediView(MedicationViewModel medication)
        {
            if (medication == null)
            {
                return new TextBlock {
                           Text = "Dont support this Type " + DateTime.Now
                }
            }
            ;
            if (medication.MediType == "StandigeMedikamente")
            {
                //var path = @"E:\PROMOVA\src\trunk_espas_newPrcs\Promova.DynamicXaml\ModernMedication\StandigeMedikamente.xaml";


                //var stream = File.OpenRead(path
                //    );
                //var control = XamlReader.Load(stream);

                //return control as FrameworkElement;


                return(new StandigeMedikamente {
                    DataContext = medication
                });
            }

            return(new TextBlock {
                Text = "Dont support this Type"
            });
        }
    }
예제 #2
0
        public static MedicationEntryViewModel CreateTriggerEntry()
        {
            var dat = new MedicationViewModel {
                MediType = "StandigeMedikamente"
            };

            dat.Fields["Verordnetab"] = DateTime.Now.AddDays(-10);

            var mediEntry = new MedicationEntryViewModel
            {
                Medications =
                    new ObservableCollection <MedicationViewModel> {
                    dat
                }
            };

            return(mediEntry);
        }