Example #1
0
 public ReportViewer()
 {
     InitializeComponent();
     EventManager.RegisterClassHandler(typeof(ReportViewer), FlexDocumentViewport.DocumentLoadErrorEvent,
                                       new RoutedDocumentLoadErrorEventHandler(OnDocumentLoadError));
     resetUI();
     Width        = AppSettings.Instance.WindowSize.Width;
     Height       = AppSettings.Instance.WindowSize.Height;
     SizeChanged += onSizeChanged;
     try
     {
         var theme = FlexEnum.FromName <RecommendedThemeSet>(AppSettings.Instance.Theme);
         ThemePrimitive.SetTheme(this, theme.Value);
     }
     catch
     {
         AppSettings.Instance.Theme = "Cyan";
     }
     foreach (var arg in from arg in Environment.GetCommandLineArgs()
              let fi = new FileInfo(arg)
                       where fi.Exists
                       where string.Equals(fi.Extension, ".FLEX",
                                           StringComparison.CurrentCultureIgnoreCase)
                       select arg)
     {
         Loaded += (Sender, Args) =>
         {
             OpenDocument(arg);
         };
     }
 }
Example #2
0
 private void ApplyDarkTheme(object s, RoutedEventArgs e)
 {
     ThemePrimitive.SetDocumentTheme(this, DocumentThemes.DarkDocumentTheme);
 }
Example #3
0
 private void themeSelected(AccentedMaterialSet theme)
 {
     ThemePrimitive.SetTheme(this, theme);
     AppSettings.Instance.Theme = theme.SerializationKey;
 }
Example #4
0
 private void PrinterFriendly(object s, RoutedEventArgs e)
 {
     ThemePrimitive.SetDocumentTheme(this, DocumentThemes.PrinterFriendlyDocumentTheme);
 }