private void PushCommandToHistory(IHistoryCommand command) { ActionHistory.Push(command); //command.Do(); //commandStack[currentCommand] = (command); //currentCommand++; //commandRedoStack.Clear(); }
private void MenuItemShowProperties_Click(object sender, RoutedEventArgs e) { //MessageBox.Show("Not implemented!", "Notice", MessageBoxButton.OK, MessageBoxImage.Asterisk); var window = new TablePropertiesWindow(); window.SetTarget(this); window.RowCount = RowCount; window.RowHeight = RowHeight; GridLength col0Width = TableGrid.ColumnDefinitions[0].Width, col1Width = TableGrid.ColumnDefinitions[1].Width, col2Width = TableGrid.ColumnDefinitions[2].Width; if (window.ShowDialog() == true) { ActionHistory.Push(new TablePropertiesCommand(this)); Canvas.SetLeft(this, window.Vector2DPosition.ValueInPixel.X); Canvas.SetTop(this, window.Vector2DPosition.ValueInPixel.Y); //SpanContent.Text = window.TextCaption; RowCount = window.RowCount; RowHeight = window.RowHeight; XlsColumn = (string)window.XLSColumn.XLSColumsList.SelectedValue; SpanFontFamily = window.FontChooser.SelectedFontFamily; SpanFontSize = Helper.ToEmSize(window.FontChooser.SelectedFontSize, MainWindow.DpiY); SpanFontWeight = window.FontChooser.SelectedFontWeight; SpanFontStyle = window.FontChooser.SelectedFontStyle; TextFontFamily = window.FontChooser2.SelectedFontFamily; TextFontSize = Helper.ToEmSize(window.FontChooser2.SelectedFontSize, MainWindow.DpiY); TextFontWeight = window.FontChooser2.SelectedFontWeight; TextFontStyle = window.FontChooser2.SelectedFontStyle; TableGrid.Children.Clear(); TableGrid.ColumnDefinitions.Clear(); TableGrid.RowDefinitions.Clear(); UpdateTableDefinition(window.RowCount, window.RowHeight, col0Width, col1Width, col2Width); FillTable(); if (LayoutWindow.instance != null) { LayoutWindow.instance.IsChanged = true; } } }
private void MenuItemShowProperties_Click(object sender, RoutedEventArgs e) { var window = new ItemPropertiesWindow(); window.SetTarget(this); //window.SetTarget(CaptionInfo.Convert(new UIElement[] { SpanContent }).ElementAt<CaptionInfo>(0), this); if (window.ShowDialog() == true) { ActionHistory.Push(new TextSpanPropertiesCommand(this)); Canvas.SetLeft(this, window.Vector2DPosition.ValueInPixel.X); Canvas.SetTop(this, window.Vector2DPosition.ValueInPixel.Y); SpanContent.Text = window.TextCaption; XlsColumn = (string)window.XLSColumn.XLSColumsList.SelectedValue; SpanFontFamily = window.FontChooser.SelectedFontFamily; SpanFontSize = Helper.ToEmSize(window.FontChooser.SelectedFontSize, MainWindow.DpiY); SpanFontWeight = window.FontChooser.SelectedFontWeight; SpanFontStyle = window.FontChooser.SelectedFontStyle; //LayoutWindow.instance.IsChanged = true; } }