Exemplo n.º 1
0
        /// <summary>
        /// Wird aufgerufen wenn die Haupt Tabelle Doppelt geklickt wird.
        /// </summary>
        /// <param name="sender">Der Sender.</param>
        /// <param name="e">Die Argumente.</param>
        private void MainTable_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            DataGridRow row          = ItemsControl.ContainerFromElement((DataGrid)sender, e.OriginalSource as DependencyObject) as DataGridRow;
            Sheet       contextSheet = (Sheet)row.DataContext;

            SheetRevision revision = contextSheet.MakeRevision();

            SheetWindow window = new SheetWindow();

            window.Sheet = contextSheet;

            if (window.ShowDialog() == true)
            {
                if (contextSheet.Revisions.Count > 0 || revision.Entrys.Count > 0)
                {
                    contextSheet.Revisions.Add(revision);
                }
            }
            else
            {
                contextSheet.RestoreRevision(revision);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Wird aufgerufen wenn die Haupt Tabelle Doppelt geklickt wird.
        /// </summary>
        /// <param name="sender">Der Sender.</param>
        /// <param name="e">Die Argumente.</param>
        private void MainTable_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            DataGridRow row = ItemsControl.ContainerFromElement((DataGrid)sender, e.OriginalSource as DependencyObject) as DataGridRow;
              Sheet contextSheet = (Sheet)row.DataContext;

              SheetRevision revision = contextSheet.MakeRevision();

              SheetWindow window = new SheetWindow();
              window.Sheet = contextSheet;

              if (window.ShowDialog() == true)
              {
            if (contextSheet.Revisions.Count > 0 || revision.Entrys.Count > 0)
            {
              contextSheet.Revisions.Add(revision);
            }
              }
              else
              {
            contextSheet.RestoreRevision(revision);
              }
        }