Mercurial > silverbladetech
annotate Chronosv2/source/Presentation/ViewModel/WindowViewModel.cs @ 10:443821e55f06
Initial cleaned up add from Codeplex files
author | stevenh7776 stevenhollidge@hotmail.com |
---|---|
date | Tue, 21 Feb 2012 17:25:44 +0700 |
parents | |
children | 09d18d6e5f40 |
rev | line source |
---|---|
10
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
1 /* |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
2 The MIT License |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
3 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
4 Copyright (c) 2009-2010. Carlos Guzmán Álvarez. http://chronoswpf.codeplex.com/ |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
5 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
6 Permission is hereby granted, free of charge, to any person obtaining a copy |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
7 of this software and associated documentation files (the "Software"), to deal |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
8 in the Software without restriction, including without limitation the rights |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
10 copies of the Software, and to permit persons to whom the Software is |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
11 furnished to do so, subject to the following conditions: |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
12 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
13 The above copyright notice and this permission notice shall be included in |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
14 all copies or substantial portions of the Software. |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
15 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
22 THE SOFTWARE. |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
23 */ |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
24 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
25 using System; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
26 using System.ComponentModel; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
27 using System.Threading; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
28 using System.Threading.Tasks; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
29 using Chronos.Presentation.Core.ViewModel; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
30 using Chronos.Presentation.Core.Windows; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
31 using NLog; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
32 using nRoute.Components; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
33 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
34 namespace Chronos.Presentation.ViewModel |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
35 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
36 public abstract class WindowViewModel<TEntity> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
37 : NavigationViewModel, IWindowViewModel where TEntity: class, new() |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
38 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
39 #region · Logger · |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
40 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
41 private static Logger Logger = LogManager.GetCurrentClassLogger(); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
42 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
43 #endregion |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
44 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
45 #region · Inner Types · |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
46 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
47 [Serializable] |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
48 protected enum InquiryActionResultType |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
49 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
50 DataFetched, |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
51 RequestedNew, |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
52 DataNotFound |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
53 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
54 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
55 protected sealed class InquiryActionResult<TResult> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
56 where TResult : class |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
57 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
58 #region · Properties · |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
59 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
60 public TResult Data |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
61 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
62 get; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
63 set; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
64 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
65 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
66 public InquiryActionResultType Result |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
67 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
68 get; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
69 set; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
70 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
71 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
72 #endregion |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
73 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
74 #region · Constructors · |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
75 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
76 public InquiryActionResult() |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
77 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
78 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
79 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
80 #endregion |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
81 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
82 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
83 #endregion |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
84 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
85 #region · PropertyChangedEventArgs Cached Instances · |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
86 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
87 private static readonly PropertyChangedEventArgs ViewModeChangedArgs = CreateArgs<WindowViewModel<TEntity>>(x => x.ViewMode); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
88 private static readonly PropertyChangedEventArgs StatusMessageChangedArgs = CreateArgs<WindowViewModel<TEntity>>(x => x.StatusMessage); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
89 private static readonly PropertyChangedEventArgs NotificationMessageChangedArgs = CreateArgs<WindowViewModel<TEntity>>(x => x.NotificationMessage); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
90 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
91 #endregion |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
92 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
93 #region · Events · |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
94 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
95 /// <summary> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
96 /// Occurs when view mode is changed. |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
97 /// </summary> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
98 public event EventHandler ViewModeChanged; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
99 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
100 #endregion |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
101 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
102 #region · Fields · |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
103 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
104 private TEntity originalEntity; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
105 private string statusMessage; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
106 private string notificationMessage; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
107 private TEntity entity; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
108 private ViewModeType viewMode; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
109 private PropertyStateCollection<TEntity> propertyStates; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
110 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
111 #region · Commands · |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
112 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
113 private ActionCommand inquiryCommand; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
114 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
115 #endregion |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
116 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
117 #endregion |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
118 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
119 #region · Properties · |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
120 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
121 /// <summary> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
122 /// Gets the property state collection |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
123 /// </summary> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
124 public PropertyStateCollection<TEntity> PropertyStates |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
125 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
126 get |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
127 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
128 if (this.propertyStates == null) |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
129 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
130 this.propertyStates = new PropertyStateCollection<TEntity>(); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
131 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
132 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
133 return this.propertyStates; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
134 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
135 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
136 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
137 /// <summary> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
138 /// Gets or sets the state of the smart part. |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
139 /// </summary> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
140 /// <value>The state of the smart part.</value> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
141 public ViewModeType ViewMode |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
142 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
143 get { return this.viewMode; } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
144 set |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
145 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
146 if (this.viewMode != value) |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
147 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
148 this.viewMode = value; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
149 try |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
150 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
151 this.OnViewModeChanged(); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
152 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
153 catch |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
154 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
155 #warning TODO: This is done to prevent DataGrid erroros when discarding changes on new records |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
156 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
157 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
158 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
159 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
160 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
161 /// <summary> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
162 /// Gets the inquiry data command |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
163 /// </summary> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
164 public ActionCommand InquiryCommand |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
165 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
166 get |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
167 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
168 if (this.inquiryCommand == null) |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
169 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
170 this.inquiryCommand = new ActionCommand |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
171 ( |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
172 () => OnInquiryData(), |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
173 () => CanInquiryData() |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
174 ); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
175 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
176 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
177 return this.inquiryCommand; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
178 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
179 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
180 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
181 /// <summary> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
182 /// Gets or sets the status message text |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
183 /// </summary> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
184 public string StatusMessage |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
185 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
186 get { return this.statusMessage; } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
187 set |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
188 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
189 if (this.statusMessage != value) |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
190 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
191 this.statusMessage = value; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
192 this.NotifyPropertyChanged(StatusMessageChangedArgs); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
193 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
194 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
195 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
196 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
197 /// <summary> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
198 /// Gets or sets the notification message text |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
199 /// </summary> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
200 public string NotificationMessage |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
201 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
202 get { return this.notificationMessage; } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
203 set |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
204 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
205 if (this.notificationMessage != value) |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
206 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
207 this.notificationMessage = value; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
208 this.NotifyPropertyChanged(NotificationMessageChangedArgs); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
209 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
210 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
211 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
212 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
213 #endregion |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
214 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
215 #region · Protected Properties · |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
216 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
217 /// <summary> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
218 /// Gets or sets the data model. |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
219 /// </summary> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
220 /// <value>The data model.</value> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
221 protected TEntity Entity |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
222 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
223 get { return this.entity; } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
224 private set |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
225 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
226 if (!Object.ReferenceEquals(this.entity, value)) |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
227 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
228 this.entity = value; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
229 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
230 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
231 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
232 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
233 protected TEntity OriginalEntity |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
234 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
235 get { return this.originalEntity; } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
236 set { this.originalEntity = value; } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
237 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
238 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
239 #endregion |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
240 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
241 #region · Constructors · |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
242 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
243 protected WindowViewModel() |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
244 : base() |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
245 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
246 this.InitializePropertyStates(); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
247 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
248 this.Entity = new TEntity(); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
249 this.ViewMode = ViewModeType.ViewOnly; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
250 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
251 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
252 #endregion |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
253 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
254 #region · Command Actions · |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
255 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
256 #region · Inquiry · |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
257 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
258 protected virtual bool CanInquiryData() |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
259 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
260 return (this.ViewMode == ViewModeType.ViewOnly); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
261 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
262 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
263 protected void OnInquiryData() |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
264 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
265 InquiryActionResult<TEntity> result = new InquiryActionResult<TEntity> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
266 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
267 Result = InquiryActionResultType.DataNotFound |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
268 }; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
269 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
270 this.ViewMode = ViewModeType.Busy; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
271 this.StatusMessage = "Obteniendo datos, espere por favor ..."; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
272 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
273 Task task = Task.Factory.StartNew |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
274 ( |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
275 (o) => |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
276 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
277 Logger.Debug("Obteniendo datos '{0}'", this.Entity.ToString()); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
278 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
279 this.OnInquiryAction(result); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
280 }, result |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
281 ); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
282 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
283 task.ContinueWith |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
284 ( |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
285 (t) => |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
286 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
287 Logger.Debug("Error al obtener datos '{0}'", t.Exception.InnerException.ToString()); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
288 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
289 this.OnInquiryActionFailed(); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
290 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
291 Exception exception = null; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
292 this.OriginalEntity = null; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
293 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
294 if (t.Exception.InnerException != null) |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
295 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
296 exception = t.Exception.InnerException; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
297 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
298 else |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
299 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
300 exception = t.Exception; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
301 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
302 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
303 this.NotificationMessage = exception.Message; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
304 }, |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
305 CancellationToken.None, |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
306 TaskContinuationOptions.OnlyOnFaulted | TaskContinuationOptions.AttachedToParent, |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
307 TaskScheduler.FromCurrentSynchronizationContext() |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
308 ); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
309 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
310 task.ContinueWith |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
311 ( |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
312 _ => |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
313 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
314 Logger.Debug("Datos obtenidos correctamente '{0}'", this.Entity.ToString()); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
315 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
316 this.StatusMessage = null; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
317 this.OnInquiryActionComplete(result); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
318 }, |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
319 CancellationToken.None, |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
320 TaskContinuationOptions.OnlyOnRanToCompletion | TaskContinuationOptions.AttachedToParent, |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
321 TaskScheduler.FromCurrentSynchronizationContext() |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
322 ); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
323 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
324 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
325 protected abstract void OnInquiryAction(InquiryActionResult<TEntity> result); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
326 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
327 protected virtual void OnInquiryActionComplete(InquiryActionResult<TEntity> result) |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
328 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
329 switch (result.Result) |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
330 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
331 case InquiryActionResultType.DataNotFound: |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
332 this.OriginalEntity = null; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
333 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
334 this.ResetDataModel(); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
335 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
336 this.ViewMode = ViewModeType.ViewOnly; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
337 break; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
338 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
339 case InquiryActionResultType.RequestedNew: |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
340 throw new InvalidOperationException("Requested New is not valid on this type of ViewModel"); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
341 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
342 case InquiryActionResultType.DataFetched: |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
343 this.ResetDataModel(result.Data); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
344 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
345 this.OriginalEntity = this.entity; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
346 this.ViewMode = ViewModeType.ViewOnly; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
347 break; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
348 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
349 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
350 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
351 protected virtual void OnInquiryActionFailed() |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
352 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
353 this.ViewMode = ViewModeType.ViewOnly; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
354 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
355 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
356 #endregion |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
357 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
358 #endregion |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
359 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
360 #region · Overriden Methods · |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
361 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
362 /// <summary> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
363 /// Called when the related view is being closed. |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
364 /// </summary> |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
365 public override void Close() |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
366 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
367 Logger.Debug("Cerrar ventana '{0}'", this.GetType()); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
368 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
369 if (this.originalEntity != null) |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
370 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
371 this.originalEntity = null; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
372 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
373 if (this.entity != null) |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
374 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
375 this.entity = null; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
376 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
377 if (this.propertyStates != null) |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
378 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
379 this.propertyStates.Clear(); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
380 this.propertyStates = null; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
381 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
382 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
383 this.inquiryCommand = null; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
384 this.statusMessage = null; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
385 this.notificationMessage = null; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
386 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
387 base.Close(); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
388 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
389 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
390 #endregion |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
391 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
392 #region · DataModel Reset Methods · |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
393 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
394 protected void ResetDataModel() |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
395 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
396 Logger.Debug("Resetar model '{0}'", this.GetType()); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
397 this.ResetDataModel(new TEntity()); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
398 Logger.Debug("Model reseteado '{0}'", this.GetType()); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
399 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
400 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
401 protected virtual void ResetDataModel(TEntity model) |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
402 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
403 this.OnResetingDataModel(this.Entity, model); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
404 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
405 this.OriginalEntity = null; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
406 this.Entity = model; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
407 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
408 this.OnResetedDataModel(model); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
409 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
410 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
411 protected virtual void OnResetingDataModel(TEntity oldModel, TEntity newModel) |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
412 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
413 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
414 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
415 protected virtual void OnResetedDataModel(TEntity newModel) |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
416 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
417 this.NotifyAllPropertiesChanged(); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
418 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
419 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
420 #endregion |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
421 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
422 #region · Protected Methods · |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
423 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
424 protected virtual void InitializePropertyStates() |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
425 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
426 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
427 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
428 protected virtual void OnViewModeChanged() |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
429 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
430 if (this.ViewModeChanged != null) |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
431 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
432 this.ViewModeChanged(this, new EventArgs()); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
433 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
434 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
435 this.NotifyPropertyChanged(ViewModeChangedArgs); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
436 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
437 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
438 protected virtual void UpdateAllowedUserActions() |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
439 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
440 this.Invoke |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
441 ( |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
442 () => |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
443 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
444 this.InquiryCommand.RequeryCanExecute(); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
445 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
446 ); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
447 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
448 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
449 protected override void NotifyPropertyChanged(PropertyChangedEventArgs args) |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
450 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
451 if (args != StatusMessageChangedArgs) |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
452 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
453 this.StatusMessage = null; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
454 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
455 if (args != NotificationMessageChangedArgs) |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
456 { |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
457 this.NotificationMessage = null; |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
458 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
459 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
460 this.UpdateAllowedUserActions(); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
461 base.NotifyPropertyChanged(args); |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
462 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
463 |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
464 #endregion |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
465 } |
443821e55f06
Initial cleaned up add from Codeplex files
stevenh7776 stevenhollidge@hotmail.com
parents:
diff
changeset
|
466 } |