//Customizing PrintPreview for Export to Excel.
        private static void OnPrintGrid(object sender, ExecutedRoutedEventArgs args)
        {
            var dataGrid = args.Source as SfDataGrid;

            if (dataGrid == null)
            {
                return;
            }
            try
            {
                var window = new Preview
                {
                    WindowStartupLocation = WindowStartupLocation.CenterScreen,
                };
                SkinStorage.SetEnableOptimization(window, false);
                SkinStorage.SetVisualStyle(window, "Metro");

                window.PrintPreviewArea.PrintManagerBase = new GridPrintManager(dataGrid);
                window.Grid = dataGrid;
                window.ShowDialog();
            }
            catch (Exception)
            {
            }
        }
Beispiel #2
0
 public MainWindow()
 {
     //SkinStorage.SetEnableOptimization(this, true);
     System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("de");
     InitializeComponent();
     SkinStorage.SetVisualStyle(this, "Office2013");
 }
Beispiel #3
0
        /// <summary>
        /// Helps to create a control for a tile.
        /// </summary>
        /// <param name="controlType"></param>
        /// <param name="tile"></param>
        /// <returns></returns>
        private FrameworkElement CreateControl(Tile tile)
        {
            var    controlType = tile.ControlType;
            string path        = System.IO.Path.GetFullPath(@"Assets\Config\OLAPSample.config");

            switch (controlType)
            {
            case "Chart":
                OlapChart olapChart = new OlapChart()
                {
                    OlapDataManager = OlapDataSourceHelper.GetManager(tile.Report.ReportFileName, BIDashboardModel.Initialize(path))
                };
                olapChart.Loaded += new RoutedEventHandler(olapChart_Loaded);
                return(olapChart);

            case "Grid":
                return(new OlapGrid()
                {
                    Style = (Style)FindResource("olapGridStyle"),
                    OlapDataManager = OlapDataSourceHelper.GetManager(tile.Report.ReportFileName, BIDashboardModel.Initialize(path))
                });

            case "Gauge":
                OlapGauge olapGauge = new OlapGauge()
                {
                    OlapDataManager = OlapDataSourceHelper.GetManager(tile.Report.ReportFileName, BIDashboardModel.Initialize(path))
                };
                SkinStorage.SetVisualStyle(olapGauge, "Office2007Blue");
                return(olapGauge);
            }

            return(null);
        }
Beispiel #4
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="MainWindow" /> class.
        /// </summary>
        public DiagramBuilderDemo()
        {
            this.InitializeComponent();
            Binding exitBinding = new Binding();

            exitBinding.Path = new PropertyPath("Exit");
            exitBinding.Mode = BindingMode.TwoWay;
            this.SetBinding(ExitProperty, exitBinding);
            Binding zoomInBinding = new Binding();

            zoomInBinding.Path = new PropertyPath("ZoomIn");
            this.SetBinding(ZoomInProperty, zoomInBinding);
            Binding zoomOutBinding = new Binding();

            zoomOutBinding.Path = new PropertyPath("ZoomOut");
            this.SetBinding(ZoomOutProperty, zoomOutBinding);
            this.Exit    = new Command(this.OnExitCommand);
            this.ZoomIn  = new Command(this.OnZoomInCommand);
            this.ZoomOut = new Command(this.OnZoomOutCommand);

            SkinStorage.SetVisualStyle(this, "Office2013");
            this.Closing            += this.MainWindowClosing;
            this.DataContextChanged += this.MainWindow_DataContextChanged;
            this.Loaded             += this.MainWindowLoaded;
        }
 void ShowMDXWindow(Object Param)
 {
     mdxEditor       = new MDXEditor(this);
     mdxEditor.Owner = Application.Current.MainWindow;
     SkinStorage.SetVisualStyle(mdxEditor, SkinStorage.GetVisualStyle(Application.Current.MainWindow));
     mdxEditor.ShowDialog();
 }
Beispiel #6
0
 private void BgBrushes_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (BckBrushes.SelectedItem != null)
     {
         SkinStorage.SetMetroPanelBackgroundBrush(this, ((BrushModel)BckBrushes.SelectedItem).Brush);
     }
 }
Beispiel #7
0
 private void FgBrushes_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (FgBrushes.SelectedItem != null)
     {
         SkinStorage.SetMetroForegroundBrush(this, ((BrushModel)FgBrushes.SelectedItem).Brush);
     }
 }
Beispiel #8
0
        public MainWindow()
        {
            InitializeComponent();
            Binding exitBinding = new Binding();

            exitBinding.Path = new PropertyPath("Exit");
            exitBinding.Mode = BindingMode.TwoWay;
            SetBinding(ExitProperty, exitBinding);
            Binding ZoomInBinding = new Binding();

            ZoomInBinding.Path = new PropertyPath("ZoomIn");
            SetBinding(ZoomInProperty, ZoomInBinding);
            Binding ZoomOutBinding = new Binding();

            ZoomOutBinding.Path = new PropertyPath("ZoomOut");
            SetBinding(ZoomOutProperty, ZoomOutBinding);
            Exit    = new Command(OnExitCommand);
            ZoomIn  = new Command(OnZoomInCommand);
            ZoomOut = new Command(OnZoomOutCommand);

            SkinStorage.SetVisualStyle(this, "Office2013");

            //SfSkinManager.SetVisualStyle(this, VisualStyles.Office2013White);
            //SfSkinManager.ApplyStylesOnApplication = true;
            //ChangeTheme("Metro");
        }
Beispiel #9
0
        public MainWindow()
        {
            InitializeComponent();
#if Framework4_0
            //Enables touch manipulation.
            rte.IsManipulationEnabled = true;
#endif
            rte.FileOpening += (sender, e) =>
            {
                rte.Document = DocxImporting.ConvertToDocumentAdv(e.DocumentStream, e.FormatType);
                PageCount    = rte.Viewer.Pages.Count;
            };

            rte.FileSaving += (sender, e) =>
            {
                DocxExporting.ConvertToDocument(rte.Document, e.DoucmentStream, e.FormatType);
            };

            rte.Loaded += (sender, e) =>
            {
                PageCount = rte.Viewer.Pages.Count;
            };
            rte.LayoutUpdated += (sender, e) =>
            {
                PageCount = rte.Viewer.Pages.Count;
            };
            rte.OpenFailed       += rte_OpenFailed;
            rte.SaveFailed       += rte_SaveFailed;
            rte.RequestNavigate  += rte_RequestNavigate;
            DataContext           = rte;
            pagecount.DataContext = this;
            SkinStorage.SetVisualStyle(this, "Office2013");
        }
Beispiel #10
0
 private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (themecombo.SelectedIndex == 0)
     {
         SkinStorage.SetVisualStyle(this, "Blend");
     }
     else if (themecombo.SelectedIndex == 1)
     {
         SkinStorage.SetVisualStyle(this, "VS2010");
     }
     else if (themecombo.SelectedIndex == 2)
     {
         SkinStorage.SetVisualStyle(this, "Office2007Blue");
     }
     else if (themecombo.SelectedIndex == 3)
     {
         SkinStorage.SetVisualStyle(this, "Office2007Black");
     }
     else if (themecombo.SelectedIndex == 4)
     {
         SkinStorage.SetVisualStyle(this, "Office2007Silver");
     }
     else if (themecombo.SelectedIndex == 5)
     {
         SkinStorage.SetVisualStyle(this, "ShinyRed");
     }
     else if (themecombo.SelectedIndex == 6)
     {
         SkinStorage.SetVisualStyle(this, "ShinyBlue");
     }
 }
Beispiel #11
0
        /// <summary>
        /// Helps to create a control for a tile.
        /// </summary>
        /// <param name="controlType"></param>
        /// <param name="tile"></param>
        /// <returns></returns>
        private FrameworkElement CreateControl(Tile tile)
        {
            var controlType = tile.ControlType;

            switch (controlType)
            {
            case "Chart":
                OlapChart olapChart = new OlapChart()
                {
                    OlapDataManager = OlapDataSourceHelper.GetManager(tile.Report.ReportFileName, GetConnectionString())
                };
                olapChart.Loaded += new RoutedEventHandler(olapChart_Loaded);
                return(olapChart);

            case "Grid":
                return(new OlapGrid()
                {
                    Style = (Style)FindResource("olapGridStyle"),
                    OlapDataManager = OlapDataSourceHelper.GetManager(tile.Report.ReportFileName, GetConnectionString())
                });

            case "Gauge":
                OlapGauge olapGauge = new OlapGauge()
                {
                    OlapDataManager = OlapDataSourceHelper.GetManager(tile.Report.ReportFileName, GetConnectionString())
                };
                SkinStorage.SetVisualStyle(olapGauge, "Office2007Blue");
                return(olapGauge);
            }

            return(null);
        }
Beispiel #12
0
 private void DockingManager_LayoutUpdated(object sender, EventArgs e)
 {
     if (m_layoutflag)
     {
         SkinStorage.SetVisualStyle(this, "Office2007Blue");
         m_layoutflag = false;
     }
 }
Beispiel #13
0
 private void MtFont_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (MtFont.SelectedItem != null)
     {
         var fontFamily = new FontFamily(MtFont.SelectedItem.ToString());
         SkinStorage.SetMetroFontFamily(this, fontFamily);
     }
 }
Beispiel #14
0
 public MainWindow()
 {
     //SkinStorage.SetEnableOptimization(this, true);
     InitializeComponent();
     SkinStorage.SetVisualStyle(this, "Office2013");
     this.Title    = "Syncfusion Essential Report Designer";
     this.Loaded  += MainWindow_Loaded;
     this.Closing += new System.ComponentModel.CancelEventHandler(MainWindow_Closing);
 }
        /// <summary>
        /// Sets the text.
        /// </summary>
        public void SetText()
        {
            TreeViewItem item = treeViewControlslist.SelectedItem as TreeViewItem;

            if (item != null)
            {
                TextBox1.Text = item.Header + " - " + SkinStorage.GetVisualStyle(this).ToString() + " Skin";
            }
        }
Beispiel #16
0
 public Shell(IEventAggregator eventAggregatorr, AppMenuViewModel viewModel)
 {
     InitializeComponent();
     SkinStorage.SetVisualStyle(this, "Blend");
     this.eventAgg = eventAggregatorr;
     //Subscribe to the skin changed event.
     this.DataContext = viewModel;
     this.eventAgg.GetEvent <SkinChangedEvent>().Subscribe(SkinChangedHandler);
 }
Beispiel #17
0
        /// <summary>
        /// Handles the 1 event of the Button_Click control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            Button button1 = sender as Button;

            if (tabcheck.IsChecked == true)
            {
                SkinStorage.SetVisualStyle(tabcontrol, button1.Tag.ToString());
            }
            if (treecheck.IsChecked == true)
            {
                SkinStorage.SetVisualStyle(treeview, button1.Tag.ToString());
            }
            if (editcheck.IsChecked == true)
            {
                SkinStorage.SetVisualStyle(integers, button1.Tag.ToString());
                SkinStorage.SetVisualStyle(doubles, button1.Tag.ToString());
                SkinStorage.SetVisualStyle(updown, button1.Tag.ToString());
                SkinStorage.SetVisualStyle(masked, button1.Tag.ToString());
                SkinStorage.SetVisualStyle(currency, button1.Tag.ToString());
                SkinStorage.SetVisualStyle(percents, button1.Tag.ToString());
            }
            if (autocheck.IsChecked == true)
            {
                SkinStorage.SetVisualStyle(autocomplete, button1.Tag.ToString());
                SkinStorage.SetVisualStyle(fontcombo, button1.Tag.ToString());
                SkinStorage.SetVisualStyle(datetime, button1.Tag.ToString());
            }
            if (fontcheck.IsChecked == true)
            {
                SkinStorage.SetVisualStyle(fontlist, button1.Tag.ToString());
                SkinStorage.SetVisualStyle(scrolls, button1.Tag.ToString());
            }
            if (groupcheck.IsChecked == true)
            {
                SkinStorage.SetVisualStyle(groupbar, button1.Tag.ToString());
            }
            if (calendarcheck.IsChecked == true)
            {
                SkinStorage.SetVisualStyle(calendaredit, button1.Tag.ToString());
            }
            if (clockcheck.IsChecked == true)
            {
                SkinStorage.SetVisualStyle(clockcontrol, button1.Tag.ToString());
            }
            if (colorcheck.IsChecked == true)
            {
                SkinStorage.SetVisualStyle(colorpicker, button1.Tag.ToString());
            }
            if (gallerycheck.IsChecked == true)
            {
                SkinStorage.SetVisualStyle(Gallery1, button1.Tag.ToString());
            }
            if (microcheck.IsChecked == true)
            {
                SkinStorage.SetVisualStyle(microsoftcontrol, button1.Tag.ToString());
            }
        }
Beispiel #18
0
 protected override void Invoke(object parameter)
 {
     if (this.Target != null && this.AssociatedObject != null)
     {
         if (this.AssociatedObject is ComboBox)
         {
             string VisualStyle = (this.AssociatedObject as ComboBox).SelectedItem.ToString();
             SkinStorage.SetVisualStyle(this.Target, VisualStyle);
         }
     }
 }
        public ReportEditer(string reportPath, bool showRibbon, bool showReportData, bool showRuler, bool showProperties)
        {
            InitializeComponent();
            this.Closing += new System.ComponentModel.CancelEventHandler(MainWindow_Closing);
            SkinStorage.SetVisualStyle(this, "Office2013");

            this.Loaded        += new RoutedEventHandler(ReportEditer_Loaded);
            this.ReportPath     = reportPath;
            this.ShowRibbon     = showRibbon;
            this.ShowProperties = showProperties;
            this.ShowRuler      = showRuler;
            this.ShowReportData = showReportData;
        }
Beispiel #20
0
        private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var c = (sender as ComboBox).SelectedItem;

            if (this.AssociatedObject != null && this.Target != null)
            {
                SkinStorage.SetVisualStyle(this.AssociatedObject, c.ToString());
                this.Dispatcher.BeginInvoke(new Action(() =>
                {
                    SkinStorage.SetVisualStyle(this.Target, c.ToString());
                }), DispatcherPriority.ApplicationIdle);
            }
        }
Beispiel #21
0
 /// <summary>
 /// Change the visual style of an object
 /// </summary>
 /// <param name="o">The object that needs to have a style overhaul</param>
 internal static void ChangeStyle(DependencyObject o)
 {
     try
     {
         SkinStorage.SetVisualStyle(o, Properties.Settings.Default.VisualStyle);
         SkinStorage.SetMetroBrush(o, new SolidColorBrush(Properties.Settings.Default.MetroColor));
         ((ChromelessWindow)o).BorderThickness = new Thickness(Properties.Settings.Default.BorderThickness);
         ((ChromelessWindow)o).CornerRadius    = new CornerRadius(0, 0, 0, 0);
     }
     catch (Exception ex)
     {
         SkinStorage.SetVisualStyle(o, "Metro");
         MessageBox.Show(ex.Message, "DeviceLog", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
Beispiel #22
0
        private void ComboBoxAdv_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ComboBoxItemAdv item;
            MainWindow      samplewindow = VisualUtils.FindAncestor((Visual)this, typeof(MainWindow)) as MainWindow;
            ComboBoxAdv     combo        = sender as ComboBoxAdv;

            if (combo != null && samplewindow != null)
            {
                if (combo.SelectedItem != null)
                {
                    item = combo.SelectedItem as ComboBoxItemAdv;
                    SkinStorage.SetVisualStyle(samplewindow, item.Content.ToString());
                }
            }
        }
Beispiel #23
0
        private void ComboBoxAdv_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ComboBoxItemAdv  item;
            WindowCollection windows      = Application.Current.Windows;
            Window           samplewindow = windows[0];
            ComboBoxAdv      combo        = sender as ComboBoxAdv;

            if (combo != null)
            {
                if (combo.SelectedItem != null)
                {
                    item = combo.SelectedItem as ComboBoxItemAdv;
                    SkinStorage.SetVisualStyle(samplewindow, item.Content.ToString());
                }
            }
        }
        /// <summary>
        /// Handles the Click event of the Button control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;

            SkinStorage.SetVisualStyle(this, button.Tag.ToString());
            if (button.Tag.ToString() == "Transparent")
            {
                rect.Fill           = Brushes.Transparent;
                expander.Background = Brushes.Transparent;
            }
            else
            {
                rect.Fill           = Brushes.White;
                expander.Background = Brushes.White;
            }
            TabControlArea.SelectedIndex = index;
            SetText();
        }
Beispiel #25
0
        /// <summary>
        /// Represents the Skin changed event handler. Selects the appropriate skin based on the parameter passed while publishing the event.
        /// </summary>
        /// <param name="SkinName">The Skin Name</param>
        void SkinChangedHandler(string SkinName)
        {
            switch (SkinName)
            {
            case "Blue":
                SkinStorage.SetVisualStyle(this, "Office2007Blue");
                break;

            case "Black":
                SkinStorage.SetVisualStyle(this, "Office2007Black");
                break;

            case "Silver":
                SkinStorage.SetVisualStyle(this, "Office2007Silver");
                break;

            case "Blend":
                SkinStorage.SetVisualStyle(this, "Blend");
                break;
            }
        }
Beispiel #26
0
 /// <summary>
 /// Change the visual style of an object
 /// </summary>
 /// <param name="o">The object that needs to have a style overhaul</param>
 internal static void ChangeStyle(DependencyObject o)
 {
     try
     {
         SkinStorage.SetVisualStyle(o, Properties.Settings.Default.VisualStyle);
         SkinStorage.SetMetroBrush(o, new SolidColorBrush(Properties.Settings.Default.MetroColor));
         if (!(o is ChromelessWindow window))
         {
             return;
         }
         window.BorderThickness       = new Thickness(Properties.Settings.Default.BorderThickness);
         window.CornerRadius          = new CornerRadius(0, 0, 0, 0);
         window.Opacity               = Properties.Settings.Default.WindowOpacity / 100;
         window.ResizeBorderThickness = new Thickness(Properties.Settings.Default.WindowResizeBorder);
     }
     catch (Exception ex)
     {
         SkinStorage.SetVisualStyle(o, "Metro");
         MessageBox.Show(ex.Message, "DeadPix", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
        protected override void OnAttached()
        {
            AssociatedObject.MouseLeftButtonDown += (sender, e) =>
            {
                if (e.Source.GetType() == typeof(MainWindow))
                {
                    AssociatedObject.DragMove();
                }
            };

            MainWindow mainwindow = AssociatedObject as MainWindow;

            if (mainwindow != null)
            {
                mainwindow.Loaded += (sender2, e2) =>
                {
                    mainwindow.combo.SelectionChanged += (sender3, e3) =>
                    {
                        SkinStorage.SetVisualStyle(AssociatedObject, ((sender3 as ComboBoxAdv).SelectedItem as ComboBoxItemAdv).Content.ToString());
                    };
                };
            }
        }
Beispiel #28
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                SkinStorage.SetVisualStyle(this, "Metro");
                if (tipo == true)
                {
                    //MessageBox.Show("1");
                    //viewer.Reset();
                    string xnameReporte = carpeta;
                    string usuario      = UserServer;
                    string contraseña   = UserServerPass;

                    viewer.ReportPath             = xnameReporte;
                    viewer.ReportServerUrl        = Server;
                    viewer.ProcessingMode         = ProcessingMode.Remote;
                    viewer.ReportServerCredential = new System.Net.NetworkCredential(usuario, contraseña);
                    List <DataSourceCredentials> crdentials = new List <DataSourceCredentials>();

                    foreach (var dataSource in viewer.GetDataSources())
                    {
                        DataSourceCredentials credn = new DataSourceCredentials();
                        credn.Name     = dataSource.Name;
                        credn.UserId   = "*****@*****.**";
                        credn.Password = "******";
                        crdentials.Add(credn);
                    }
                    viewer.SetDataSourceCredentials(crdentials);
                    viewer.RefreshReport();
                }
                //if (tipo == false) Navegador.Visibility = Visibility.Hidden;
            }
            catch (Exception w)
            {
                MessageBox.Show("error al cargar reporte:" + w);
            }
        }
        public void PropertyGridLoaded(PropertiesViewModel model)
        {
            DockingManager dockingmanager = (((App.Current.MainWindow as ShellView).Docking.Content as DockingAdapterView).DockingAdapter.Content as Grid).Children[0] as Syncfusion.Windows.Tools.Controls.DockingManager;

            VisualStyle = (dockingmanager != null) ? SkinStorage.GetVisualStyle(dockingmanager) : "Default";
        }
 public ReportView()
 {
     InitializeComponent();
     SkinStorage.SetVisualStyle(this, "Metro");
 }