17 changed files with 485 additions and 33 deletions
@ -0,0 +1,66 @@
@@ -0,0 +1,66 @@
|
||||
<xctk:WizardPage x:Class="ICSharpCode.Reporting.Addin.ReportWizard.Dialog.BaseSettingsPage" |
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" |
||||
xmlns:System="clr-namespace:System;assembly=mscorlib" |
||||
xmlns:aa="clr-namespace:ICSharpCode.Reporting.Globals;assembly=ICSharpCode.Reporting" |
||||
xmlns:ics="clr-namespace:ICSharpCode.Reporting.Globals;assembly=ICSharpCode.Reporting" |
||||
Title="Base Settings" |
||||
Description="Basic Settings and Layout" |
||||
Background="LightGray"> |
||||
|
||||
<!-- Enter="WizardPage_Enter" |
||||
Leave="WizardPage_Leave"--> |
||||
|
||||
<!-- !xctk:WizardPage x:Class="ICSharpCode.Reporting.Addin.ReportWizard.Dialog.PageWithContext"--> |
||||
<xctk:WizardPage.Resources> |
||||
<ObjectDataProvider x:Key="dataFromEnum" MethodName="GetValues" |
||||
ObjectType="{x:Type System:Enum}"> |
||||
<ObjectDataProvider.MethodParameters> |
||||
<x:Type TypeName="aa:PushPullModel"/> |
||||
</ObjectDataProvider.MethodParameters> |
||||
</ObjectDataProvider> |
||||
</xctk:WizardPage.Resources> |
||||
|
||||
<Grid ShowGridLines="true"> |
||||
<Grid.RowDefinitions> |
||||
<RowDefinition Height="Auto"> </RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
</Grid.RowDefinitions> |
||||
<Grid.ColumnDefinitions> |
||||
<ColumnDefinition></ColumnDefinition> |
||||
<ColumnDefinition></ColumnDefinition> |
||||
<ColumnDefinition></ColumnDefinition> |
||||
<ColumnDefinition></ColumnDefinition> |
||||
</Grid.ColumnDefinitions> |
||||
|
||||
<Label Content="DataModel :"></Label> |
||||
<!--<RadioButton Name="_FormSheet" GroupName="DataModel" Content="FormSheet" Margin="0,5,0,5" Grid.Row="1" ></RadioButton> |
||||
<RadioButton Name="_PushModel" GroupName="DataModel" Content="PushModel" Margin="0,5,0,5" Grid.Row="1" Grid.Column="1"></RadioButton> |
||||
--> |
||||
<ComboBox ItemsSource="{Binding Source={StaticResource dataFromEnum}}" Grid.Column="1" ></ComboBox> |
||||
|
||||
<Label Content="ReportType :" Margin="0,5,0,5" Grid.Row="2"></Label> |
||||
<RadioButton Name="_FormSheetType" GroupName="ReportType" Content="FormSheet" Margin="0,5,0,5" Grid.Row="3" ></RadioButton> |
||||
<RadioButton Name="_DataModelType" GroupName="ReportType" Content="PushModel" Margin="0,5,0,5" Grid.Row="3" Grid.Column="1"></RadioButton> |
||||
|
||||
<Label Content="Report Name :" Margin="0,5,0,5" Grid.Row="4"></Label> |
||||
<TextBox Name="_ReportName" Margin="10,5,0,5" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3"></TextBox> |
||||
|
||||
<Label Content="Filename :" Margin="0,5,0,5" Grid.Row="5"></Label> |
||||
<TextBox Name="_Filename" Margin="10,5,0,5" Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="3"></TextBox> |
||||
|
||||
<Label Content="Page Layout :" Grid.Row="6" Margin="0,5,0,5"></Label> |
||||
<RadioButton Name="_Legal" GroupName="PageLayout" Content="Legal" Grid.Row="7" Margin="0,5,0,5" ></RadioButton> |
||||
<RadioButton Name="_Landscape" GroupName="PageLayout" Content="Landscape" Grid.Row="7" Grid.Column="1" Margin="0,5,0,5"></RadioButton> |
||||
</Grid> |
||||
|
||||
</xctk:WizardPage> |
@ -0,0 +1,63 @@
@@ -0,0 +1,63 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Peter Forstmeier |
||||
* Date: 08.07.2014 |
||||
* Time: 20:26 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using System.Windows; |
||||
using Xceed.Wpf.Toolkit; |
||||
using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels; |
||||
|
||||
namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog{ |
||||
|
||||
/// <summary>
|
||||
/// Interaction logic for PageOne.xamlWizardPage,IHasContext
|
||||
/// </summary>
|
||||
public partial class BaseSettingsPage : WizardPage,IHasContext |
||||
{ |
||||
PageOneContext context; |
||||
|
||||
public BaseSettingsPage() |
||||
{ |
||||
InitializeComponent(); |
||||
this.context = new PageOneContext(); |
||||
} |
||||
|
||||
|
||||
public IWizardContext Context { |
||||
get{ |
||||
UpdateContext(); |
||||
return context;} |
||||
} |
||||
|
||||
public int PageNumber { |
||||
get {return 1;} |
||||
} |
||||
|
||||
|
||||
void WizardPage_Enter(object sender, RoutedEventArgs e) |
||||
{ |
||||
|
||||
Console.Write("Create Context for PageOne"); |
||||
} |
||||
|
||||
void WizardPage_Leave(object sender, RoutedEventArgs e) |
||||
{ |
||||
// NewMethod();
|
||||
} |
||||
|
||||
void UpdateContext() |
||||
{ |
||||
// context.FormSheet = this._FormSheet.IsChecked == true;
|
||||
// context.PushModel = this._PushModel.IsChecked == true;
|
||||
context.ReportName = this._ReportName.Text; |
||||
context.FileName = this._Filename.Text; |
||||
context.Legal = _Legal.IsChecked == true; |
||||
; |
||||
context.Landscape = _Landscape.IsChecked == true; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Peter Forstmeier |
||||
* Date: 16.07.2014 |
||||
* Time: 20:41 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels; |
||||
|
||||
namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog |
||||
{ |
||||
/// <summary>
|
||||
/// Description of IHasContext.
|
||||
/// </summary>
|
||||
public interface IHasContext |
||||
{ |
||||
IWizardContext Context {get;} |
||||
int PageNumber {get;} |
||||
} |
||||
} |
@ -0,0 +1,33 @@
@@ -0,0 +1,33 @@
|
||||
<Window x:Class="ICSharpCode.Reporting.Addin.ReportWizard.Dialog.ReportWizard" |
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" |
||||
xmlns:local="clr-namespace:ICSharpCode.Reporting.Addin.ReportWizard.Dialog" |
||||
Title="{Binding Title}" |
||||
Height="600" Width="600"> |
||||
|
||||
<xctk:Wizard x:Name="_wizard" FinishButtonClosesWindow="True" |
||||
Next="_wizard_Next" |
||||
PageChanged="_wizard_PageChanged" |
||||
Finish="_wizard_Finish" |
||||
CanHelp="False"> |
||||
|
||||
<xctk:WizardPage PageType="Exterior" Title="Welcome to Reporting Wizard" |
||||
Description="This Wizard will walk you though how to do something." /> |
||||
|
||||
<!-- ! <local:BaseSettingsPage ></local:BaseSettingsPage> --> |
||||
|
||||
|
||||
<xctk:WizardPage PageType="Interior" |
||||
Title="Page 1" |
||||
Description="This is the first page in the process." /> |
||||
<xctk:WizardPage PageType="Interior" |
||||
Title="Page 2" |
||||
Description="This is the second page in the process" /> |
||||
<xctk:WizardPage PageType="Interior" |
||||
Title="Last Page" |
||||
Description="This is the last page in the process" |
||||
CanFinish="True" /> |
||||
</xctk:Wizard> |
||||
|
||||
</Window> |
@ -0,0 +1,63 @@
@@ -0,0 +1,63 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Peter Forstmeier |
||||
* Date: 07.07.2014 |
||||
* Time: 20:18 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using System.Windows; |
||||
using Xceed.Wpf.Toolkit; |
||||
using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels; |
||||
using System.Linq; |
||||
|
||||
namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog |
||||
{ |
||||
/// <summary>
|
||||
/// Interaction logic for Window1.xaml
|
||||
/// </summary>
|
||||
public partial class ReportWizard : Window |
||||
{ |
||||
ReportWizardContext context; |
||||
BaseSettingsPage baseSettingsPage; |
||||
|
||||
public ReportWizard(ReportWizardContext context) |
||||
{ |
||||
InitializeComponent(); |
||||
this.context = context; |
||||
baseSettingsPage = new BaseSettingsPage(); |
||||
_wizard.Items.Insert(2,baseSettingsPage); |
||||
|
||||
} |
||||
|
||||
|
||||
void _wizard_Next(object sender, Xceed.Wpf.Toolkit.Core.CancelRoutedEventArgs e) |
||||
{ |
||||
} |
||||
|
||||
|
||||
void _wizard_PageChanged(object sender, RoutedEventArgs e) |
||||
{ |
||||
|
||||
} |
||||
|
||||
void _wizard_Finish(object sender, RoutedEventArgs e) |
||||
{ |
||||
var x = _wizard.Items; |
||||
|
||||
foreach (var element in this._wizard.Items) { |
||||
var isHasContext = element is IHasContext; |
||||
if (isHasContext) { |
||||
|
||||
var hasContext = (IHasContext) element; |
||||
Console.WriteLine(" {0} - {1}",hasContext.PageNumber,element.ToString()); |
||||
} |
||||
} |
||||
|
||||
context.PageOneContext = baseSettingsPage.Context; |
||||
|
||||
} |
||||
|
||||
} |
||||
} |
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Peter Forstmeier |
||||
* Date: 22.07.2014 |
||||
* Time: 19:37 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using ICSharpCode.Reporting.Interfaces; |
||||
using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels; |
||||
|
||||
namespace ICSharpCode.Reporting.Addin.ReportWizard |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ReportGenerator.
|
||||
/// </summary>
|
||||
public class ReportGenerator |
||||
{ |
||||
ReportWizardContext context; |
||||
|
||||
public ReportGenerator(ReportWizardContext context) |
||||
{ |
||||
if (context == null) |
||||
throw new ArgumentNullException("context"); |
||||
this.context = context; |
||||
} |
||||
|
||||
|
||||
} |
||||
} |
@ -0,0 +1,48 @@
@@ -0,0 +1,48 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Peter Forstmeier |
||||
* Date: 08.07.2014 |
||||
* Time: 19:47 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Reporting.Interfaces; |
||||
using ICSharpCode.SharpDevelop.Workbench; |
||||
using ICSharpCode.Reporting.Addin.ReportWizard.Dialog; |
||||
using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels; |
||||
|
||||
namespace ICSharpCode.Reporting.Addin.ReportWizard |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ReportWizardCommand.
|
||||
/// </summary>
|
||||
class ReportWizardCommand: AbstractMenuCommand |
||||
{ |
||||
readonly OpenedFile file; |
||||
|
||||
public ReportWizardCommand (OpenedFile file) { |
||||
if (file == null) |
||||
throw new ArgumentNullException("file"); |
||||
this.file = file; |
||||
} |
||||
|
||||
public override void Run() |
||||
{ |
||||
var wizardViewModel = new ReportWizardContext(); |
||||
var reportWizard = new ICSharpCode.Reporting.Addin.ReportWizard.Dialog.ReportWizard(wizardViewModel); |
||||
|
||||
reportWizard.ShowDialog(); |
||||
if (reportWizard.DialogResult.HasValue && reportWizard.DialogResult.Value){ |
||||
LoggingService.Info("ReportWizard - CreateReport"); |
||||
var rg = new ReportGenerator(wizardViewModel); |
||||
|
||||
} else { |
||||
Canceled = true; |
||||
} |
||||
} |
||||
|
||||
public bool Canceled {get; private set;} |
||||
} |
||||
} |
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Peter Forstmeier |
||||
* Date: 07/12/2014 |
||||
* Time: 18:20 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using Xceed.Wpf.Toolkit; |
||||
|
||||
namespace ICSharpCode.Reporting.Addin.ReportWizard.ViewModels |
||||
{ |
||||
/// <summary>
|
||||
/// Description of PageOneViewModel.
|
||||
/// </summary>
|
||||
public class PageOneContext:IWizardContext |
||||
{ |
||||
public bool FormSheet {get;set;} |
||||
public bool PushModel {get;set;} |
||||
public string ReportName {get;set;} |
||||
public string FileName {get;set;} |
||||
public bool Legal {get;set;} |
||||
public bool Landscape {get;set;} |
||||
} |
||||
} |
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Peter Forstmeier |
||||
* Date: 07/12/2014 |
||||
* Time: 18:10 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
|
||||
namespace ICSharpCode.Reporting.Addin.ReportWizard.ViewModels |
||||
{ |
||||
|
||||
public interface IWizardContext { |
||||
|
||||
} |
||||
/// <summary>
|
||||
/// Description of ReportWizardViewModel.
|
||||
/// </summary>
|
||||
public class ReportWizardContext:IWizardContext |
||||
{ |
||||
|
||||
|
||||
public string Title { |
||||
get{ return "das ist der Title";} |
||||
} |
||||
|
||||
IWizardContext pageOneContext; |
||||
|
||||
public IWizardContext PageOneContext { |
||||
get { |
||||
return pageOneContext; |
||||
} |
||||
set { |
||||
pageOneContext = value; |
||||
} |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue