private void ScheduleChartButton_Click(object sender, RoutedEventArgs e)
        {
            double originalOpacity = Opacity;

            Opacity = 0.5;
            GanttChartDataGrid.UnassignedScheduleChartItemContent = "(Unassigned)"; // Optional
            ObservableCollection <ScheduleChartItem> scheduleChartItems = GanttChartDataGrid.GetScheduleChartItems();
            Window scheduleChartWindow =
                new Window
            {
                Owner   = Application.Current.MainWindow, Title = "Schedule Chart", WindowStartupLocation = WindowStartupLocation.CenterOwner, Width = 640, Height = 480, ResizeMode = ResizeMode.CanResize,
                Content = new ScheduleChartDataGrid
                {
                    Items = scheduleChartItems, DataGridWidth = new GridLength(0.2, GridUnitType.Star),
                    UseMultipleLinesPerRow = true, AreIndividualItemAppearanceSettingsApplied = true, IsAlternatingItemBackgroundInverted = true, UnassignedScheduleChartItemContent = GanttChartDataGrid.UnassignedScheduleChartItemContent     // Optional
                }
            };

            if (themeResourceDictionary != null)
            {
                (scheduleChartWindow.Content as FrameworkElement).Resources.MergedDictionaries.Add(themeResourceDictionary);
            }
            scheduleChartWindow.ShowDialog();
            GanttChartDataGrid.UpdateChangesFromScheduleChartItems(scheduleChartItems);
            GanttChartDataGrid.DisposeScheduleChartItems(scheduleChartItems);
            Opacity = originalOpacity;
        }
Ejemplo n.º 2
0
 private void ScheduleChartWindow_Closed(object sender, EventArgs e)
 {
     GanttChartDataGrid.UpdateChangesFromScheduleChartItems(scheduleChartItems);
     GanttChartDataGrid.DisposeScheduleChartItems(scheduleChartItems);
     scheduleChartItems = null;
 }