Esempio n. 1
0
        public static void UpdateUI(SchedulerVisual control)
        {
            for (int i = 1; i < 8; i++)
            {
                Helpers.UIHelper.FindChild <StackPanel>(control.CurrentGrid, "week_" + i).Children.Clear();
            }
            foreach (Models.RouteScheduler item in control.CurrentRouteScheduler)
            {
                DigitTimeView digitTimeView = new DigitTimeView();
                digitTimeView.Margin = new Thickness(2);
                DataConvertors.TimeStampConvertor timeStampConvertor = new DataConvertors.TimeStampConvertor();
                digitTimeView.CurrentTimeToShow = (string)timeStampConvertor.Convert(item.StartTime, null, "2", null);
                string day_of_week = item.DayOfWeek.ToString();

                TextBlock toolTipTextBlock = new TextBlock();
                toolTipTextBlock.Style = null;
                DataConvertors.WindowStartTimeConvertor windowStartTimeConvertor = new DataConvertors.WindowStartTimeConvertor();
                toolTipTextBlock.Text =
                    (string)windowStartTimeConvertor.Convert(new object[] { item.StartTime, item.WindowStartTime }, null, null, null);
                digitTimeView.ToolTip = toolTipTextBlock;

                Helpers.UIHelper.FindChild <StackPanel>(control.CurrentGrid, "week_" + day_of_week).Children.Add(digitTimeView);
            }
        }
Esempio n. 2
0
        private static void CurrentRouteScheduler_PropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            SchedulerVisual control = obj as SchedulerVisual;

            UpdateUI(control);
        }