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); }; } }
private void ApplyDarkTheme(object s, RoutedEventArgs e) { ThemePrimitive.SetDocumentTheme(this, DocumentThemes.DarkDocumentTheme); }
private void themeSelected(AccentedMaterialSet theme) { ThemePrimitive.SetTheme(this, theme); AppSettings.Instance.Theme = theme.SerializationKey; }
private void PrinterFriendly(object s, RoutedEventArgs e) { ThemePrimitive.SetDocumentTheme(this, DocumentThemes.PrinterFriendlyDocumentTheme); }