Esempio n. 1
0
        public void ShowTimelineAxisEvents(TimelineAxis axis)
        {
            EventModelManager manager = _eventModelManager;

            var list = manager.GetEventModel(axis.Id);
            var eventListViewerViewModel = new EventViewerViewModel()
            {
                DataList = new List <EventViewerItemViewModel>()
            };

            foreach (var item in list)
            {
                eventListViewerViewModel.DataList.Add(new EventViewerItemViewModel()
                {
                    StartDateTime = item.StartDateTime,
                    EndDateTime   = item.EndDateTime,
                    Name          = item.Title,
                });
            }

            CommonLightBox  lightBox = new CommonLightBox();
            EventListViewer viewer   = new EventListViewer();

            viewer.DataContext = eventListViewerViewModel;

            lightBox.LightBoxKind = CommonLightBox.CommonLightBoxKind.CancelOnly;
            lightBox.BindUIElement(viewer);
            lightBox.Owner = Application.Current.MainWindow;

            if (ShowDialogManager.ShowDialog(lightBox) == true)
            {
                StartDateTime = viewer.JumpDateTime;
            }
        }
        private Border GenerateBorder(TimelineAxis model, double x, double y)
        {
            var border = VacantBorder(model.Width);
            border.DataContext = model;
            Canvas.SetTop(border, y);
            Canvas.SetLeft(border, x);

            TextBlock block = new TextBlock()
            {
                VerticalAlignment = System.Windows.VerticalAlignment.Center,
                HorizontalAlignment = System.Windows.HorizontalAlignment.Center,
                Foreground = Brushes.Black,
                Text = model.HeaderName,
            };

            border.Child = block;

            return border;
        }
Esempio n. 3
0
        private Border GenerateBorder(TimelineAxis model, double x, double y)
        {
            var border = VacantBorder(model.Width);

            border.DataContext = model;
            Canvas.SetTop(border, y);
            Canvas.SetLeft(border, x);


            TextBlock block = new TextBlock()
            {
                VerticalAlignment   = System.Windows.VerticalAlignment.Center,
                HorizontalAlignment = System.Windows.HorizontalAlignment.Center,
                Foreground          = Brushes.Black,
                Text = model.HeaderName,
            };

            border.Child = block;

            return(border);
        }
        public void ShowTimelineAxisEvents(TimelineAxis axis)
        {
            EventModelManager manager = _eventModelManager;

            var list = manager.GetEventModel(axis.Id);
            var eventListViewerViewModel = new EventViewerViewModel() { DataList = new List<EventViewerItemViewModel>() };

            foreach (var item in list)
            {
                eventListViewerViewModel.DataList.Add(new EventViewerItemViewModel()
                {
                    StartDateTime = item.StartDateTime,
                    EndDateTime = item.EndDateTime,
                    Name = item.Title,
                });
            }

            CommonLightBox lightBox = new CommonLightBox();
            EventListViewer viewer = new EventListViewer();

            viewer.DataContext = eventListViewerViewModel;

            lightBox.LightBoxKind = CommonLightBox.CommonLightBoxKind.CancelOnly;
            lightBox.BindUIElement(viewer);
            lightBox.Owner = Application.Current.MainWindow;

            if (ShowDialogManager.ShowDialog(lightBox) == true)
            {
                StartDateTime = viewer.JumpDateTime;
            }
        }