|
26
|
1 |
using System; |
|
|
2 |
using System.Windows; |
|
|
3 |
using System.Windows.Controls; |
|
|
4 |
using System.Windows.Documents; |
|
|
5 |
using System.Windows.Ink; |
|
|
6 |
using System.Windows.Input; |
|
|
7 |
using System.Windows.Media; |
|
|
8 |
using System.Windows.Media.Animation; |
|
|
9 |
using System.Windows.Shapes; |
|
27
|
10 |
using Iri.Modernisation.Controls.ViewModel; |
|
|
11 |
using Iri.Modernisation.BaseMVVM.Commands; |
|
|
12 |
namespace Iri.Modernisation.Controls.View |
|
26
|
13 |
{ |
|
|
14 |
public partial class HeaderProductionChapter : UserControl |
|
|
15 |
{ |
|
27
|
16 |
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
public bool Selected |
|
|
22 |
{ |
|
|
23 |
get { return (bool)GetValue(SelectedProperty); } |
|
|
24 |
set |
|
|
25 |
{ |
|
|
26 |
SetValue(SelectedProperty, value); |
|
|
27 |
|
|
|
28 |
} |
|
|
29 |
|
|
|
30 |
} |
|
|
31 |
|
|
|
32 |
// Using a DependencyProperty as the backing store for Selected. This enables animation, styling, binding, etc... |
|
|
33 |
public static readonly DependencyProperty SelectedProperty = |
|
|
34 |
DependencyProperty.Register("Selected", typeof(bool), typeof(HeaderProductionChapter), new PropertyMetadata(false)); |
|
|
35 |
|
|
|
36 |
|
|
|
37 |
|
|
26
|
38 |
public HeaderProductionChapter() |
|
|
39 |
{ |
|
|
40 |
// Required to initialize variables |
|
|
41 |
InitializeComponent(); |
|
27
|
42 |
EditionController.Text = Iri.Modernisation.Lang.LangResource.EditingLabel; |
|
|
43 |
IndexController.Text = Iri.Modernisation.Lang.LangResource.IndexingLabel; |
|
38
|
44 |
EnrichmentController.Text = Iri.Modernisation.Lang.LangResource.EnrichmentLabel; |
|
27
|
45 |
// Commands.ActivePart.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(ActivePart_Executed); |
|
|
46 |
EditionController.HeaderProductionPartFinished += new EventHandler<HeaderProductionPartControlerEventArgs>(EditionController_HeaderProductionPartFinished); |
|
|
47 |
IndexController.HeaderProductionPartFinished += new EventHandler<HeaderProductionPartControlerEventArgs>(IndexController_HeaderProductionPartFinished); |
|
38
|
48 |
|
|
|
49 |
EditionController.Clicked += new EventHandler(EditionController_Clicked); |
|
|
50 |
IndexController.Clicked += new EventHandler(IndexController_Clicked); |
|
|
51 |
Commands.HeaderProduction.IndexFinishedOk.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(IndexFinishedOk_Executed); |
|
|
52 |
Commands.HeaderProduction.EditFinishedOk.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(EditFinishedOk_Executed); |
|
|
53 |
} |
|
|
54 |
|
|
|
55 |
void IndexFinishedOk_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) |
|
|
56 |
{ |
|
|
57 |
if (DataContext == e.Source) |
|
|
58 |
IndexController.Finish(); |
|
|
59 |
} |
|
|
60 |
|
|
|
61 |
void EditFinishedOk_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) |
|
|
62 |
{ |
|
|
63 |
if(DataContext == e.Source) |
|
|
64 |
EditionController.Finish(); |
|
|
65 |
} |
|
|
66 |
|
|
|
67 |
void IndexController_Clicked(object sender, EventArgs e) |
|
|
68 |
{ |
|
|
69 |
((HeaderProductionChapterVM)DataContext).IndexClick(); |
|
|
70 |
} |
|
|
71 |
|
|
|
72 |
|
|
|
73 |
|
|
|
74 |
void EditionController_Clicked(object sender, EventArgs e) |
|
|
75 |
{ |
|
|
76 |
((HeaderProductionChapterVM)DataContext).EditClick(); |
|
27
|
77 |
} |
|
|
78 |
|
|
|
79 |
void IndexController_HeaderProductionPartFinished(object sender, HeaderProductionPartControlerEventArgs e) |
|
|
80 |
{ |
|
|
81 |
((HeaderProductionChapterVM)DataContext).Indexing = true; |
|
38
|
82 |
VisualStateManager.GoToState(EnrichmentController, "Finished", true); |
|
27
|
83 |
} |
|
|
84 |
|
|
|
85 |
void EditionController_HeaderProductionPartFinished(object sender, HeaderProductionPartControlerEventArgs e) |
|
|
86 |
{ |
|
|
87 |
((HeaderProductionChapterVM)DataContext).Editing = true; |
|
38
|
88 |
|
|
27
|
89 |
} |
|
38
|
90 |
|
|
|
91 |
|
|
|
92 |
|
|
26
|
93 |
} |
|
|
94 |
} |