private static void OnShutdownPhoenixCommandExecuted(object sender, ExecutedRoutedEventArgs e) { if ( MessageWindowHelpers.Show(null, SharedResources.CloseQuestion, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) { Utils.GetWindow <MainWindow>().AnimateableClose(); } }
private void ShowReport() { ReportUIModel.IsBusyIndicatorHidden = false; try { Utils.EnsureCulture(); var flowDocument = (FlowDocument) Application.LoadComponent( new Uri(string.Format("Templates/{0}.{1}.xaml", _reportFileName, Settings.Default.Culture), UriKind.Relative)); var temp = new WindowBase(false, false, false); flowDocument.FontFamily = temp.FontFamily; flowDocument.FlowDirection = temp.FlowDirection; var reportDocument = new ReportDocument { XamlData = XamlWriter.Save(flowDocument), XpsCompressionOption = CompressionOption.SuperFast }; var data = new ReportData(); data.ReportDocumentValues.Add("ReportedOn", string.Format(ReportPreviewResources.ReportGeneratingDate, DateTime.Now.ToLocalized())); data.ReportDocumentValues.Add("ReportedBy", string.Format(ReportPreviewResources.ReporterFormat, AppContext.Instanse.User.UserName, AppContext.Instanse.User.Name ?? ReportPreviewResources.NoName)); data.ReportDocumentValues.Add("Slogan", ReportPreviewResources.Slogan); data.ReportDocumentValues.Add("ReportTitle", Settings.Default.ReportTitle); data.ReportDocumentValues.Add("ReportDescription", Settings.Default.ReportDescription); data.DataTables.Add(_items.ToDataTable()); var xps = reportDocument.CreateXpsDocument(data); DispatcherHelper.CheckBeginInvokeOnUI(() => ReportUIModel.Document = xps.GetFixedDocumentSequence()); /*} catch (Exception) {*/ } finally { ReportUIModel.IsBusyIndicatorHidden = true; } }
private static void OnOpenSettingsWindowCommandExecuted(object sender, ExecutedRoutedEventArgs e) { new SettingsWindow().ShowDialog(Utils.GetWindow <MainWindow>()); }
private static void OnOpenRolesWindowCommandExecuted(object sender, ExecutedRoutedEventArgs e) { new RolesWindow().ShowDialog(Utils.GetWindow <MainWindow>()); AppContext.Instanse.ReloadCredentials(); Utils.GetWindow <MainWindow>().BindCommands(); }
private static void OnOpenSearchWindowInLogsCommandExecuted(object sender, ExecutedRoutedEventArgs e) { new SearchWindow("InLogs").ShowDialog(Utils.GetWindow <MainWindow>()); }
private static void OnOpenRepositoryMaterialsAndItemsWindowCommandExecuted(object sender, ExecutedRoutedEventArgs e) { new RepositoryMaterialsAndItemsWindow().ShowDialog(Utils.GetWindow <MainWindow>()); }
private static void OnShowNotificationsWindowCommandExecuted(object sender, ExecutedRoutedEventArgs e) { new NotificationsWindow().ShowDialog(Utils.GetWindow <MainWindow>()); }