Exemplo n.º 1
0
        /// <summary>
        /// Called when [executeprint].
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The <see cref="System.Windows.Input.ExecutedRoutedEventArgs"/> instance containing the event data.</param>
        private static void OnExecuteprint(object sender, ExecutedRoutedEventArgs args)
        {
            GridDataControl gridDatacontrol = args.Source as GridDataControl;
            var             window          = gridDatacontrol.FindParentElementOfType <MainWindow>();

            gridDatacontrol.ShowPrintDialog((o) =>
            {
                o.Owner = window;
                o.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
            });
        }
Exemplo n.º 2
0
        private static void OnExecuteShowPrintDialog(object sender, ExecutedRoutedEventArgs args)
        {
            ScalingOptions option = ScalingOptions.NoScaling;

            if (args.Parameter != null)
            {
                option = GetScaling(args.Parameter.ToString());
            }

            GridDataControl dataGrid = args.Source as GridDataControl;

            dataGrid.ShowPrintDialog((p) =>
            {
                p.ScalingOptions = option;
                // p.ShowDialog();
            });
        }