From d1a18587d863e94471244f92150d1713be256a91 Mon Sep 17 00:00:00 2001 From: Peter Forstmeier Date: Wed, 20 Aug 2014 20:40:05 +0200 Subject: [PATCH] GoPrevious,Goback --- .../ReportWizard/Dialog/BaseSettingsPage.xaml | 1 - .../Dialog/BaseSettingsPage.xaml.cs | 13 +++---- .../ReportWizard/Dialog/PullModelPage.xaml | 12 +++---- .../ReportWizard/Dialog/PullModelPage.xaml.cs | 1 + .../ReportWizard/Dialog/PushDataReport.xaml | 12 ++++--- .../src/ReportWizard/Dialog/ReportWizard.xaml | 32 +++++------------ .../ReportWizard/Dialog/ReportWizard.xaml.cs | 36 ++++++++++++++++++- .../src/ReportWizard/Dialog/WelcomePage.xaml | 5 ++- 8 files changed, 66 insertions(+), 46 deletions(-) diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml index cd40ceb109..77b5cb1baf 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml @@ -4,7 +4,6 @@ xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:sdr="clr-namespace:ICSharpCode.Reporting.Globals;assembly=ICSharpCode.Reporting" - Name="Base" Title="Base Settings" Description="Basic Settings and Layout" PageType="Interior" diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml.cs index 783c62370e..9033813118 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml.cs @@ -25,8 +25,6 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog{ public BaseSettingsPage() { InitializeComponent(); - - _DataModel.SelectedItem = PushPullModel.FormSheet; _DataModel.SelectedItem = PushPullModel.FormSheet; _ReportType.SelectedItem = ReportType.FormSheet; _image.Source = WizardHelper.GetWizardIcon(); @@ -60,30 +58,29 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog{ var cbo = (ComboBox) sender; var pushPullModel = (PushPullModel)cbo.SelectedItem; - + switch (pushPullModel) { case PushPullModel.PushData: { this._ReportType.SelectedItem = ReportType.DataReport; this.CanFinish = false; - this.CanSelectNextPage = true; - NextPage = new PushDataReport(); - NextPage.PreviousPage = this; + this.CanSelectNextPage = true; break; } case PushPullModel.PullData: { CanSelectNextPage = true; - NextPage = new PullModelPage(); - NextPage.PreviousPage = this; + this.CanFinish = false; break; } case PushPullModel.FormSheet: { this.CanFinish = true; + CanSelectNextPage = false; this._ReportType.SelectedItem = ReportType.FormSheet; break; } } + } } } \ No newline at end of file diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PullModelPage.xaml b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PullModelPage.xaml index cddd7668bb..9705a42681 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PullModelPage.xaml +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PullModelPage.xaml @@ -4,14 +4,14 @@ xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:sdr="clr-namespace:ICSharpCode.Reporting.Globals;assembly=ICSharpCode.Reporting" - CanSelectPreviousPage="true" + Description="Create PullData Report" + CanSelectPreviousPage="true" CanSelectNextPage="false" CanCancel="true" - CanFinish="false" - PageType="Interior" -> + CanFinish="false" + PageType="Interior"> - + \ No newline at end of file diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PullModelPage.xaml.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PullModelPage.xaml.cs index 5ca804078e..ad85345e5b 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PullModelPage.xaml.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PullModelPage.xaml.cs @@ -39,6 +39,7 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog public WizardPageType ReportPageType { get { return WizardPageType.PullModelPage;} } + #endregion } } \ No newline at end of file diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml index 9b37c4d891..9a30f432ee 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml @@ -6,17 +6,19 @@ xmlns:sdr="clr-namespace:ICSharpCode.Reporting.Globals;assembly=ICSharpCode.Reporting" Name="PushData" Title="SharpDevelop Reporting" - Description="Welcome to Sharpdevelop Reporting Wizard" + Description="Create Columns for a PusData Report" PageType="Interior" - CanFinish="true" - CancelButtonVisibility="Visible"> + CanFinish="true" + CancelButtonVisibility="Visible" + CanSelectPreviousPage="true" + CanSelectNextPage="false"> - + - + + CanHelp="False" + PageChanged="_wizard_PageChanged" + Next="_wizard_Next"> - + - + - + + + - - - - - - - - - \ No newline at end of file diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/ReportWizard.xaml.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/ReportWizard.xaml.cs index 448dcceea5..19489041ab 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/ReportWizard.xaml.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/ReportWizard.xaml.cs @@ -12,6 +12,7 @@ using System.Drawing.Imaging; using System.IO; using System.Windows; using System.Windows.Media.Imaging; +using ICSharpCode.Reporting.Globals; using ICSharpCode.SharpDevelop; using Xceed.Wpf.Toolkit; using ICSharpCode.Reporting.Addin.ReportWizard.Dialog; @@ -46,7 +47,6 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog void UpdateContext(IHasContext hc) { - switch (hc.ReportPageType) { case WizardPageType.BaseSettingsPage:{ context.PageOneContext = hc.Context; @@ -59,5 +59,39 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog } } } + + + void _wizard_Next(object sender, Xceed.Wpf.Toolkit.Core.CancelRoutedEventArgs e) + { + var current = this._wizard.CurrentPage; + if (current.Name.Equals("BaseSettings")) { + var hasContext = current as IHasContext; + if (hasContext != null) { + var pushPullModel = ((PageOneContext)hasContext.Context).DataModel; + switch (pushPullModel) { + case PushPullModel.PushData: { + current.NextPage = (WizardPage)_wizard.Items[2]; + break; + } + + case PushPullModel.PullData: { + current.NextPage = (WizardPage)_wizard.Items[3]; + break; + } + + case PushPullModel.FormSheet: { + break; + } + } + } + } + + Console.WriteLine("CurrentPage {0}",current.Name); + + } + void _wizard_PageChanged(object sender, RoutedEventArgs e) + { + var x = _wizard.CurrentPage; + } } } \ No newline at end of file diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/WelcomePage.xaml b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/WelcomePage.xaml index d1ac41d115..83b4d4a1e4 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/WelcomePage.xaml +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/WelcomePage.xaml @@ -13,6 +13,9 @@ CancelButtonVisibility="Visible"> - + + + + \ No newline at end of file