Ejemplo n.º 1
0
        private void AddTimeScale(string caption, bool showHeaders, ScaleType type)
        {
            TimeScaleViewModel timeScale = TimeScaleViewModel.Create();

            timeScale.Caption     = caption;
            timeScale.ShowHeaders = showHeaders;
            timeScale.Type        = type;
            timeScale.IsEnabled   = true;
            TimeScales.Add(timeScale);
        }
Ejemplo n.º 2
0
        private void AddFixedTimeScale(string caption, bool showHeaders, TimeSpan scale)
        {
            TimeScaleViewModel timeScale = TimeScaleViewModel.Create();

            timeScale.Caption     = caption;
            timeScale.Scale       = scale;
            timeScale.ShowHeaders = showHeaders;
            timeScale.Type        = ScaleType.FixedTime;
            timeScale.IsEnabled   = true;
            TimeScales.Add(timeScale);
        }
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            TimeScaleViewModel timeScale = item as TimeScaleViewModel;

            switch (timeScale.Type)
            {
            case ScaleType.WorkDay: return(WorkDayScaleTemplate);

            case ScaleType.WorkHour: return(WorkHourScaleTemplate);

            case ScaleType.FixedTime: return(FixedTimeScaleTemplate);

            default: throw new NotImplementedException();
            }
        }