<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>caliburnmicro Issue Tracker Rss Feed</title><link>http://caliburnmicro.codeplex.com/workitem/list/basic</link><description>caliburnmicro Issue Tracker Rss Description</description><item><title>Created Unassigned: Remove IHaveDisplayName from IScreen and Screen [315]</title><link>http://caliburnmicro.codeplex.com/workitem/315</link><description>I don&amp;#39;t see why &amp;#96;IScreen&amp;#96; inherits &amp;#96;IHaveDisplayName&amp;#96;.  &lt;br /&gt;Most of the time, you &amp;#42;don&amp;#39;t&amp;#42; want to set the title of a window from the ViewModel, just like you normally wouldn&amp;#39;t set the title of the button from the VM.&lt;br /&gt;&lt;br /&gt;This interface is incredibly easy to implement, so there is really no reason to implement it by default.&lt;br /&gt;Right now, I have to basically re-implement &amp;#96;Screen&amp;#96; without that interface to stop it from hijacking and overwriting the title defined in XAML. Furthermore, the current default &amp;#40;the type of the view model&amp;#41; is never a good value for a title.&lt;br /&gt;&lt;br /&gt;I see not a single reason for having that interface implemented in &amp;#96;Screen&amp;#96;.&lt;br /&gt;</description><author>dhilgarth</author><pubDate>Wed, 22 May 2013 13:29:22 GMT</pubDate><guid isPermaLink="false">Created Unassigned: Remove IHaveDisplayName from IScreen and Screen [315] 20130522012922P</guid></item><item><title>Commented Unassigned: Result turned into a Task using ExecuteAsync is not passed through IoC. [314]</title><link>http://caliburnmicro.codeplex.com/workitem/314</link><description>We have the option to use the original coroutines or using C&amp;#35;5 async&amp;#47;await.&lt;br /&gt;&lt;br /&gt;However, taking a class based on IResult and calling AsResult on it to return a Task for async&amp;#47;await doesn&amp;#39;t pass it through IoC.BuildUp to inject properties &amp;#40;IWindowManager etc.&amp;#41;.&lt;br /&gt;&lt;br /&gt;For consistency could we pass it through IoC.BuildUp before execution or is there some other reason for this&amp;#63;&lt;br /&gt;Comments: Sorry, yes I mean ExecuteAsync&amp;#40;&amp;#41;.</description><author>cshepherd</author><pubDate>Wed, 22 May 2013 08:36:01 GMT</pubDate><guid isPermaLink="false">Commented Unassigned: Result turned into a Task using ExecuteAsync is not passed through IoC. [314] 20130522083601A</guid></item><item><title>Edited Unassigned: Result turned into a Task using ExecuteAsync is not passed through IoC. [314]</title><link>http://caliburnmicro.codeplex.com/workitem/314</link><description>We have the option to use the original coroutines or using C&amp;#35;5 async&amp;#47;await.&lt;br /&gt;&lt;br /&gt;However, taking a class based on IResult and calling AsResult on it to return a Task for async&amp;#47;await doesn&amp;#39;t pass it through IoC.BuildUp to inject properties &amp;#40;IWindowManager etc.&amp;#41;.&lt;br /&gt;&lt;br /&gt;For consistency could we pass it through IoC.BuildUp before execution or is there some other reason for this&amp;#63;&lt;br /&gt;</description><author>tibel</author><pubDate>Wed, 22 May 2013 08:01:52 GMT</pubDate><guid isPermaLink="false">Edited Unassigned: Result turned into a Task using ExecuteAsync is not passed through IoC. [314] 20130522080152A</guid></item><item><title>Commented Unassigned: Result turned into a Task using ExecuteAsync is not passed through IoC. [314]</title><link>http://caliburnmicro.codeplex.com/workitem/314</link><description>We have the option to use the original coroutines or using C&amp;#35;5 async&amp;#47;await.&lt;br /&gt;&lt;br /&gt;However, taking a class based on IResult and calling AsResult on it to return a Task for async&amp;#47;await doesn&amp;#39;t pass it through IoC.BuildUp to inject properties &amp;#40;IWindowManager etc.&amp;#41;.&lt;br /&gt;&lt;br /&gt;For consistency could we pass it through IoC.BuildUp before execution or is there some other reason for this&amp;#63;&lt;br /&gt;Comments: As there is no _AsTask&amp;#40;&amp;#41;_ method, I assume you mean _ExecuteAsync&amp;#40;&amp;#41;_.</description><author>tibel</author><pubDate>Wed, 22 May 2013 08:01:33 GMT</pubDate><guid isPermaLink="false">Commented Unassigned: Result turned into a Task using ExecuteAsync is not passed through IoC. [314] 20130522080133A</guid></item><item><title>Commented Unassigned: Result turned into a Task using ExecuteAsync is not passed through IoC. [314]</title><link>http://caliburnmicro.codeplex.com/workitem/314</link><description>We have the option to use the original coroutines or using C&amp;#35;5 async&amp;#47;await.&lt;br /&gt;&lt;br /&gt;However, taking a class based on IResult and calling AsResult on it to return a Task for async&amp;#47;await doesn&amp;#39;t pass it through IoC.BuildUp to inject properties &amp;#40;IWindowManager etc.&amp;#41;.&lt;br /&gt;&lt;br /&gt;For consistency could we pass it through IoC.BuildUp before execution or is there some other reason for this&amp;#63;&lt;br /&gt;Comments: In standard CM Coroutines the IResult doesn&amp;#39;t pass through IoC.BuildUp until it&amp;#39;s been yielded.&amp;#10;&amp;#10;If you use AsTask&amp;#40;&amp;#41; then it never goes through this. CM seems to wrap the Result in a new Task and I think that it could be passed through IoC.BuildUp in there. Otherwise, you can&amp;#39;t really use Results interchangeably with either method. For instance, I have a ShowDialogResult that needs the IWindowManager injected. At the moment I&amp;#39;d have to pass this in through the constructor from the VM or manually pass the result to IoC.BuildUp before calling &amp;#39;await&amp;#39; on it.</description><author>cshepherd</author><pubDate>Fri, 17 May 2013 13:17:07 GMT</pubDate><guid isPermaLink="false">Commented Unassigned: Result turned into a Task using ExecuteAsync is not passed through IoC. [314] 20130517011707P</guid></item><item><title>Commented Unassigned: Result turned into a Task using ExecuteAsync is not passed through IoC. [314]</title><link>http://caliburnmicro.codeplex.com/workitem/314</link><description>We have the option to use the original coroutines or using C&amp;#35;5 async&amp;#47;await.&lt;br /&gt;&lt;br /&gt;However, taking a class based on IResult and calling AsResult on it to return a Task for async&amp;#47;await doesn&amp;#39;t pass it through IoC.BuildUp to inject properties &amp;#40;IWindowManager etc.&amp;#41;.&lt;br /&gt;&lt;br /&gt;For consistency could we pass it through IoC.BuildUp before execution or is there some other reason for this&amp;#63;&lt;br /&gt;Comments: What you want to &amp;#34;buildUp&amp;#34;&amp;#63;&amp;#10;&amp;#10;When calling AsResult&amp;#40;&amp;#41; on a Task you get a wrapper to use it in a coroutine.&amp;#10;When calling AsTask&amp;#40;&amp;#41; on a IResult you get a wrapper to use it with async&amp;#47;await.&amp;#10;&amp;#10;The wrapper needs no buildup and the instance you wrap should be buildup already, I think.</description><author>tibel</author><pubDate>Fri, 17 May 2013 10:30:55 GMT</pubDate><guid isPermaLink="false">Commented Unassigned: Result turned into a Task using ExecuteAsync is not passed through IoC. [314] 20130517103055A</guid></item><item><title>Created Unassigned: Result turned into a Task using ExecuteAsync is not passed through IoC. [314]</title><link>http://caliburnmicro.codeplex.com/workitem/314</link><description>We have the option to use the original coroutines or using C&amp;#35;5 async&amp;#47;await.&lt;br /&gt;&lt;br /&gt;However, taking a class based on IResult and calling AsResult on it to return a Task for async&amp;#47;await doesn&amp;#39;t pass it through IoC.BuildUp to inject properties &amp;#40;IWindowManager etc.&amp;#41;.&lt;br /&gt;&lt;br /&gt;For consistency could we pass it through IoC.BuildUp before execution or is there some other reason for this&amp;#63;&lt;br /&gt;</description><author>cshepherd</author><pubDate>Thu, 16 May 2013 16:21:20 GMT</pubDate><guid isPermaLink="false">Created Unassigned: Result turned into a Task using ExecuteAsync is not passed through IoC. [314] 20130516042120P</guid></item><item><title>Created Task: Modifying the IoC api for testability / usability [313]</title><link>http://caliburnmicro.codeplex.com/workitem/313</link><description>The service locator, IoC, is inherently hard to test and it&amp;#39;s public facing API is sloppy. This is because not all lambda&amp;#39;s are wrapped for easy consumption.&lt;br /&gt;&lt;br /&gt;My proposal is to add following missing Methods&lt;br /&gt;&lt;br /&gt;&amp;#96;&amp;#96;&amp;#96;&lt;br /&gt;IEnumerable&amp;#60;T&amp;#62; GetAll&amp;#60;T&amp;#62;&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;Void BuildUp&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#96;&amp;#96;&amp;#96;&lt;br /&gt;&lt;br /&gt;I would also like to change BuildUp to BuildUpInstance. This would be in line with the GetInstance and GetAllInstances lambda&amp;#39;s However as this is a public facing method it could be considered a breaking change.&lt;br /&gt;&lt;br /&gt;Finally I would like to change the XML docs of the Lambda&amp;#39;s to make it clear that they are points of configuration, and to use the methods were ServiceLocation is required.&lt;br /&gt;&lt;br /&gt;This would enable a better user and testing story. It would also mean that better exceptions could be thrown if any of the delegates are null as this usually means they have not been set up correctly.&lt;br /&gt;&lt;br /&gt;</description><author>McDonnellDean</author><pubDate>Tue, 14 May 2013 20:35:25 GMT</pubDate><guid isPermaLink="false">Created Task: Modifying the IoC api for testability / usability [313] 20130514083525P</guid></item><item><title>Commented Issue: PropertyChangedBase.NotifyPropertyChange always dispatch handlers on the UI thread [291]</title><link>http://caliburnmicro.codeplex.com/workitem/291</link><description>The current implementation of the PropertyChangedBase.NotifyPropertyChanged always dispatches events handlers on the UI thread. Such behavior is pretty much extreme, and not intuitive.&lt;br /&gt;I am aware of the fact that some pieces of code could rely on such a feature &amp;#40;see &amp;#91;this issue&amp;#93;&amp;#40;http&amp;#58;&amp;#47;&amp;#47;caliburnmicro.codeplex.com&amp;#47;workitem&amp;#47;286&amp;#41; about ActionMessage&amp;#41;, but in such cases the handlers should be responsible to ensure thread affinity, not the caller.&lt;br /&gt;&lt;br /&gt;The current behavior can lead to unexpected and hard to track UI slow-downs, expecially in case the new C&amp;#35; async feature is used.&lt;br /&gt;&lt;br /&gt;I reamember that early versions of the Xaml engine &amp;#40;CTP or alike&amp;#41; did not ensure thread affinity for property change notification, is this the reason for such a choice&amp;#63;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Comments: If this design tries to address the lacking of thread-affinity support in platforms other than WPF, then I think that such code should be platform-specific, and avoided in WPF. On the contrary, if it is a way to avoid some pitfalls of multithreading, I would like to be able to disable this feature, without being forced to modify the sources and recompile everything.&amp;#10;&amp;#10;Maybe, adding a static boolean property to _PropertyChangedBase_ &amp;#40;let&amp;#39;s call it _EnforceThreadAffinity_&amp;#41; to enable&amp;#47;disable this feature, could suffice&amp;#58; the standard behaviour for all platform would be the same, but the developer can decide to configure CM so that it does not interfere &amp;#40;and I happily take advantage of both CM standard classes and WPF thread-affinity model &amp;#58;&amp;#41;&amp;#41;.&amp;#10;&amp;#10;On a final note, it would be better in my opinion to mark the function&amp;#10;&amp;#96;&amp;#96;&amp;#96;&amp;#10;void OnPropertyChanged&amp;#40;PropertyChangedEventArgs e&amp;#41;&amp;#10;&amp;#96;&amp;#96;&amp;#96;&amp;#10;as protected &amp;#40;and maybe virtual&amp;#41;, otherwise, it is not possible to override the current behavior even through inheritance &amp;#40;there is no way to raise the _PropertyChanged_ event, without using the dispatcher&amp;#41;. In case you want to avoid that developers accidentally use the _OnPropertyChanged_ directly, it is possible to mark it with a&amp;#10;&amp;#96;&amp;#96;&amp;#96;&amp;#10; &amp;#91;EditorBrowsable&amp;#40;EditorBrowsableState.Never&amp;#41;&amp;#93;&amp;#10;&amp;#96;&amp;#96;&amp;#96;</description><author>BladeWise</author><pubDate>Tue, 14 May 2013 14:37:26 GMT</pubDate><guid isPermaLink="false">Commented Issue: PropertyChangedBase.NotifyPropertyChange always dispatch handlers on the UI thread [291] 20130514023726P</guid></item><item><title>Commented Issue: PropertyChangedBase.NotifyPropertyChange always dispatch handlers on the UI thread [291]</title><link>http://caliburnmicro.codeplex.com/workitem/291</link><description>The current implementation of the PropertyChangedBase.NotifyPropertyChanged always dispatches events handlers on the UI thread. Such behavior is pretty much extreme, and not intuitive.&lt;br /&gt;I am aware of the fact that some pieces of code could rely on such a feature &amp;#40;see &amp;#91;this issue&amp;#93;&amp;#40;http&amp;#58;&amp;#47;&amp;#47;caliburnmicro.codeplex.com&amp;#47;workitem&amp;#47;286&amp;#41; about ActionMessage&amp;#41;, but in such cases the handlers should be responsible to ensure thread affinity, not the caller.&lt;br /&gt;&lt;br /&gt;The current behavior can lead to unexpected and hard to track UI slow-downs, expecially in case the new C&amp;#35; async feature is used.&lt;br /&gt;&lt;br /&gt;I reamember that early versions of the Xaml engine &amp;#40;CTP or alike&amp;#41; did not ensure thread affinity for property change notification, is this the reason for such a choice&amp;#63;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Comments: In general this sort of implementation detail will always make somebody unhappy. I was not around for the original decision but I can understand why it was made.&amp;#10;&amp;#10;The main candidates for INPC scaffolding are ViewModels and thread affinity is not guarantied in all places. Ultimately I find it is easier to spin off a thread manually that it is to have to sync back to the dispatcher over and over.&amp;#10;&amp;#10;I personally would not like to see this changed as it means that users would have to explicitly handle UI thread syncing in some cases, but not all. This is messy in my opinion, it is better that all INPC work is done on the UI thread and you can commonly override it as needed.</description><author>McDonnellDean</author><pubDate>Tue, 14 May 2013 12:36:30 GMT</pubDate><guid isPermaLink="false">Commented Issue: PropertyChangedBase.NotifyPropertyChange always dispatch handlers on the UI thread [291] 20130514123630P</guid></item><item><title>Commented Unassigned: [Dev Question] Action guard method re-evaluation [312]</title><link>http://caliburnmicro.codeplex.com/workitem/312</link><description>I wanted to get opinions from the dev&amp;#39;s on items like below see https&amp;#58;&amp;#47;&amp;#47;caliburnmicro.codeplex.com&amp;#47;discussions&amp;#47;442668 for original source.&lt;br /&gt;&lt;br /&gt;On the one hand something like this could be integrated into Caliburn.Micro proper, on the other hand it could make more sense for the original author to package it up as an recipe.&lt;br /&gt;&lt;br /&gt;Thoughts&amp;#63;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Every now and then, there is a new user that asks how to trigger availability update for action guards implemented as methods. I am aware that such methods are re-evaluated every time a parameter changes, but there are some cases where the evaluation of a guard depends on both  the parameters and the internal state of the class providing the action. In such a scenario, it can be useful to have a way to forcefully request an availability update on the action.&lt;br /&gt;&lt;br /&gt;I decided to provide a possible solution, involving a simple naming convention and the use of specific events&amp;#58; consider and action called &amp;#39;Execute&amp;#40;...&amp;#41;&amp;#39; and the associated method guard &amp;#39;CanExecute&amp;#40;...&amp;#41;&amp;#39;&amp;#59; my idea is to modify the PrepareContext implementation to check for the existence of a specific event, called &amp;#39;ReEvaluateCanExecute&amp;#39; and, if available, attach to it and invoke UpdateAvailability whenever the event is invoked.&lt;br /&gt;Since PrepareContext is an extensibility point, this feature can be easily added, without modifying the current CM code base.&lt;br /&gt;&lt;br /&gt;The actual implementation is provided below&amp;#58;&lt;br /&gt;&amp;#96;&amp;#96;&amp;#96; C&amp;#35;&lt;br /&gt;namespace ActionGuardSample&lt;br /&gt;&amp;#123;&lt;br /&gt;    &amp;#35;region Namespaces&lt;br /&gt;    using System&amp;#59;&lt;br /&gt;    using System.ComponentModel&amp;#59;&lt;br /&gt;    using System.Linq&amp;#59;&lt;br /&gt;    using System.Reflection&amp;#59;&lt;br /&gt;    using Caliburn.Micro&amp;#59;&lt;br /&gt;    using Action &amp;#61; System.Action&amp;#59;&lt;br /&gt;&lt;br /&gt;    &amp;#35;endregion&lt;br /&gt;&lt;br /&gt;    &amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;&lt;br /&gt;    &amp;#47;&amp;#47;&amp;#47;     Static class used to provide Caliburn Micro extensions.&lt;br /&gt;    &amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;&lt;br /&gt;    public static class CaliburnMicroExtensions&lt;br /&gt;    &amp;#123;&lt;br /&gt;        &amp;#35;region Static Methods&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47;     Prepares the context.&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;param name&amp;#61;&amp;#34;context&amp;#34;&amp;#62;The context.&amp;#60;&amp;#47;param&amp;#62;&lt;br /&gt;        private static void PrepareContext&amp;#40;ActionExecutionContext context&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            ActionMessage.SetMethodBinding&amp;#40;context&amp;#41;&amp;#59;&lt;br /&gt;            if &amp;#40;context.Target &amp;#33;&amp;#61; null &amp;#38;&amp;#38; context.Method &amp;#33;&amp;#61; null&amp;#41;&lt;br /&gt;            &amp;#123;&lt;br /&gt;                var targetType &amp;#61; context.Target.GetType&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                var guardName &amp;#61; string.Format&amp;#40;&amp;#34;Can&amp;#123;0&amp;#125;&amp;#34;, context.Method.Name&amp;#41;&amp;#59;&lt;br /&gt;                var guard &amp;#61; TryFindGuardMethod&amp;#40;context&amp;#41;&amp;#59;&lt;br /&gt;                if &amp;#40;guard &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                &amp;#123;&lt;br /&gt;                    var inpc &amp;#61; context.Target as INotifyPropertyChanged&amp;#59;&lt;br /&gt;                    if &amp;#40;inpc &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                        return&amp;#59;&lt;br /&gt;                    guard &amp;#61; targetType.GetMethod&amp;#40;string.Format&amp;#40;&amp;#34;get_&amp;#123;0&amp;#125;&amp;#34;, guardName&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                    if &amp;#40;guard &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                        return&amp;#59;&lt;br /&gt;                    var handler &amp;#61; &amp;#40;PropertyChangedEventHandler&amp;#41;null&amp;#59;&lt;br /&gt;                    handler &amp;#61; &amp;#40;&amp;#40;s, e&amp;#41; &amp;#61;&amp;#62;&lt;br /&gt;                               &amp;#123;&lt;br /&gt;                                   if &amp;#40;string.IsNullOrEmpty&amp;#40;e.PropertyName&amp;#41; &amp;#124;&amp;#124; e.PropertyName &amp;#61;&amp;#61; guardName&amp;#41;&lt;br /&gt;                                   &amp;#123;&lt;br /&gt;                                       &amp;#40;&amp;#40;Action&amp;#41;&amp;#40;&amp;#40;&amp;#41; &amp;#61;&amp;#62;&lt;br /&gt;                                                 &amp;#123;&lt;br /&gt;                                                     var message &amp;#61; context.Message&amp;#59;&lt;br /&gt;                                                     if &amp;#40;message &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                                                         inpc.PropertyChanged -&amp;#61; handler&amp;#59;&lt;br /&gt;                                                     else&lt;br /&gt;                                                         message.UpdateAvailability&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                                                 &amp;#125;&amp;#41;&amp;#41;.OnUIThread&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                                   &amp;#125;&lt;br /&gt;                               &amp;#125;&amp;#41;&amp;#59;&lt;br /&gt;                    inpc.PropertyChanged &amp;#43;&amp;#61; handler&amp;#59;&lt;br /&gt;                    context.Disposing &amp;#43;&amp;#61; &amp;#40;s, e&amp;#41; &amp;#61;&amp;#62; inpc.PropertyChanged -&amp;#61; handler&amp;#59;&lt;br /&gt;                    context.Message.Detaching &amp;#43;&amp;#61; &amp;#40;s, e&amp;#41; &amp;#61;&amp;#62; inpc.PropertyChanged -&amp;#61; handler&amp;#59;&lt;br /&gt;                    context.CanExecute &amp;#61; &amp;#40;&amp;#41; &amp;#61;&amp;#62; &amp;#40;bool&amp;#41;guard.Invoke&amp;#40;context.Target, MessageBinder.DetermineParameters&amp;#40;context, guard.GetParameters&amp;#40;&amp;#41;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                &amp;#125;&lt;br /&gt;                else&lt;br /&gt;                &amp;#123;&lt;br /&gt;                    var updateEventName &amp;#61; string.Format&amp;#40;&amp;#34;ReEvaluate&amp;#123;0&amp;#125;&amp;#34;, guardName&amp;#41;&amp;#59;&lt;br /&gt;                    var updateEvent &amp;#61; targetType.GetEvent&amp;#40;updateEventName&amp;#41;&amp;#59;&lt;br /&gt;                    if &amp;#40;updateEvent &amp;#33;&amp;#61; null&amp;#41;&lt;br /&gt;                    &amp;#123;&lt;br /&gt;                        var target &amp;#61; context.Target&amp;#59;&lt;br /&gt;                        EventHandler handler &amp;#61; null&amp;#59;&lt;br /&gt;                        handler &amp;#61; &amp;#40;s, e&amp;#41; &amp;#61;&amp;#62; &amp;#40;&amp;#40;Action&amp;#41;&amp;#40;&amp;#40;&amp;#41; &amp;#61;&amp;#62;&lt;br /&gt;                                                      &amp;#123;&lt;br /&gt;                                                          var message &amp;#61; context.Message&amp;#59;&lt;br /&gt;                                                          if &amp;#40;message &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                                                              updateEvent.RemoveEventHandler&amp;#40;target, handler&amp;#41;&amp;#59;&lt;br /&gt;                                                          else&lt;br /&gt;                                                              message.UpdateAvailability&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                                                      &amp;#125;&amp;#41;&amp;#41;.OnUIThread&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                        updateEvent.AddEventHandler&amp;#40;target, handler&amp;#41;&amp;#59;&lt;br /&gt;                        context.Disposing &amp;#43;&amp;#61; &amp;#40;s, e&amp;#41; &amp;#61;&amp;#62; updateEvent.RemoveEventHandler&amp;#40;target, handler&amp;#41;&amp;#59;&lt;br /&gt;                        context.Message.Detaching &amp;#43;&amp;#61; &amp;#40;s, e&amp;#41; &amp;#61;&amp;#62; updateEvent.RemoveEventHandler&amp;#40;target, handler&amp;#41;&amp;#59;&lt;br /&gt;                    &amp;#125;&lt;br /&gt;&lt;br /&gt;                    context.CanExecute &amp;#61; &amp;#40;&amp;#41; &amp;#61;&amp;#62; &amp;#40;bool&amp;#41;guard.Invoke&amp;#40;context.Target, MessageBinder.DetermineParameters&amp;#40;context, guard.GetParameters&amp;#40;&amp;#41;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                &amp;#125;&lt;br /&gt;            &amp;#125;&lt;br /&gt;        &amp;#125;&lt;br /&gt;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47;     Tries to find the guard method.&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;param name&amp;#61;&amp;#34;context&amp;#34;&amp;#62;The context.&amp;#60;&amp;#47;param&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;returns&amp;#62;The guard method.&amp;#60;&amp;#47;returns&amp;#62;&lt;br /&gt;        private static MethodInfo TryFindGuardMethod&amp;#40;ActionExecutionContext context&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            var name &amp;#61; string.Format&amp;#40;&amp;#34;Can&amp;#123;0&amp;#125;&amp;#34;, context.Method.Name&amp;#41;&amp;#59;&lt;br /&gt;            var method &amp;#61; context.Target.GetType&amp;#40;&amp;#41;.GetMethod&amp;#40;name&amp;#41;&amp;#59;&lt;br /&gt;            if &amp;#40;method &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                return null&amp;#59;&lt;br /&gt;            if &amp;#40;method.ContainsGenericParameters&amp;#41;&lt;br /&gt;                return null&amp;#59;&lt;br /&gt;            if &amp;#40;typeof&amp;#40;bool&amp;#41; &amp;#33;&amp;#61; method.ReturnType&amp;#41;&lt;br /&gt;                return null&amp;#59;&lt;br /&gt;            var methodParameters &amp;#61; method.GetParameters&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            var contextMethodParameters &amp;#61; context.Method.GetParameters&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            if &amp;#40;methodParameters.Length &amp;#61;&amp;#61; 0&amp;#41;&lt;br /&gt;                return method&amp;#59;&lt;br /&gt;            if &amp;#40;methodParameters.Length &amp;#33;&amp;#61; contextMethodParameters.Length&amp;#41;&lt;br /&gt;                return null&amp;#59;&lt;br /&gt;            return methodParameters.Zip&amp;#40;contextMethodParameters, &amp;#40;x, y&amp;#41; &amp;#61;&amp;#62; x.ParameterType &amp;#61;&amp;#61; y.ParameterType&amp;#41;.Any&amp;#40;x &amp;#61;&amp;#62; &amp;#33;x&amp;#41; &amp;#63; null &amp;#58; method&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47;     Enables support for action guard methods re-evaluation, through a specific event naming convention.&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;&lt;br /&gt;        public static void EnableActionGuardMethodReEvaluateSupport&amp;#40;&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            ActionMessage.PrepareContext &amp;#61; PrepareContext&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;        &amp;#35;endregion&lt;br /&gt;    &amp;#125;&lt;br /&gt;&amp;#125;&lt;br /&gt;&amp;#96;&amp;#96;&amp;#96;&lt;br /&gt;You can download a working sample &amp;#91;here&amp;#93;&amp;#40;http&amp;#58;&amp;#47;&amp;#47;www.mediafire.com&amp;#47;&amp;#63;irqiiq9bvbn41x4&amp;#41;.&lt;br /&gt;Comments: As I said, it is quite easy to plumb this code as an extension, but I feel that it could be part of the CM code base, since it places action guards on pair with property guards, solving a huge limitation&amp;#58; action guards are updated only if a parameter changes, and there is no clean way to force an update from the view-model &amp;#40;raising a property changed for a parameter is a possible workaround, but feels quite dirty...&amp;#41;.</description><author>BladeWise</author><pubDate>Mon, 13 May 2013 11:20:44 GMT</pubDate><guid isPermaLink="false">Commented Unassigned: [Dev Question] Action guard method re-evaluation [312] 20130513112044A</guid></item><item><title>Edited Unassigned: [Dev Question] Action guard method re-evaluation [312]</title><link>http://caliburnmicro.codeplex.com/workitem/312</link><description>I wanted to get opinions from the dev&amp;#39;s on items like below see https&amp;#58;&amp;#47;&amp;#47;caliburnmicro.codeplex.com&amp;#47;discussions&amp;#47;442668 for original source.&lt;br /&gt;&lt;br /&gt;On the one hand something like this could be integrated into Caliburn.Micro proper, on the other hand it could make more sense for the original author to package it up as an recipe.&lt;br /&gt;&lt;br /&gt;Thoughts&amp;#63;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Every now and then, there is a new user that asks how to trigger availability update for action guards implemented as methods. I am aware that such methods are re-evaluated every time a parameter changes, but there are some cases where the evaluation of a guard depends on both  the parameters and the internal state of the class providing the action. In such a scenario, it can be useful to have a way to forcefully request an availability update on the action.&lt;br /&gt;&lt;br /&gt;I decided to provide a possible solution, involving a simple naming convention and the use of specific events&amp;#58; consider and action called &amp;#39;Execute&amp;#40;...&amp;#41;&amp;#39; and the associated method guard &amp;#39;CanExecute&amp;#40;...&amp;#41;&amp;#39;&amp;#59; my idea is to modify the PrepareContext implementation to check for the existence of a specific event, called &amp;#39;ReEvaluateCanExecute&amp;#39; and, if available, attach to it and invoke UpdateAvailability whenever the event is invoked.&lt;br /&gt;Since PrepareContext is an extensibility point, this feature can be easily added, without modifying the current CM code base.&lt;br /&gt;&lt;br /&gt;The actual implementation is provided below&amp;#58;&lt;br /&gt;&amp;#96;&amp;#96;&amp;#96; C&amp;#35;&lt;br /&gt;namespace ActionGuardSample&lt;br /&gt;&amp;#123;&lt;br /&gt;    &amp;#35;region Namespaces&lt;br /&gt;    using System&amp;#59;&lt;br /&gt;    using System.ComponentModel&amp;#59;&lt;br /&gt;    using System.Linq&amp;#59;&lt;br /&gt;    using System.Reflection&amp;#59;&lt;br /&gt;    using Caliburn.Micro&amp;#59;&lt;br /&gt;    using Action &amp;#61; System.Action&amp;#59;&lt;br /&gt;&lt;br /&gt;    &amp;#35;endregion&lt;br /&gt;&lt;br /&gt;    &amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;&lt;br /&gt;    &amp;#47;&amp;#47;&amp;#47;     Static class used to provide Caliburn Micro extensions.&lt;br /&gt;    &amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;&lt;br /&gt;    public static class CaliburnMicroExtensions&lt;br /&gt;    &amp;#123;&lt;br /&gt;        &amp;#35;region Static Methods&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47;     Prepares the context.&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;param name&amp;#61;&amp;#34;context&amp;#34;&amp;#62;The context.&amp;#60;&amp;#47;param&amp;#62;&lt;br /&gt;        private static void PrepareContext&amp;#40;ActionExecutionContext context&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            ActionMessage.SetMethodBinding&amp;#40;context&amp;#41;&amp;#59;&lt;br /&gt;            if &amp;#40;context.Target &amp;#33;&amp;#61; null &amp;#38;&amp;#38; context.Method &amp;#33;&amp;#61; null&amp;#41;&lt;br /&gt;            &amp;#123;&lt;br /&gt;                var targetType &amp;#61; context.Target.GetType&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                var guardName &amp;#61; string.Format&amp;#40;&amp;#34;Can&amp;#123;0&amp;#125;&amp;#34;, context.Method.Name&amp;#41;&amp;#59;&lt;br /&gt;                var guard &amp;#61; TryFindGuardMethod&amp;#40;context&amp;#41;&amp;#59;&lt;br /&gt;                if &amp;#40;guard &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                &amp;#123;&lt;br /&gt;                    var inpc &amp;#61; context.Target as INotifyPropertyChanged&amp;#59;&lt;br /&gt;                    if &amp;#40;inpc &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                        return&amp;#59;&lt;br /&gt;                    guard &amp;#61; targetType.GetMethod&amp;#40;string.Format&amp;#40;&amp;#34;get_&amp;#123;0&amp;#125;&amp;#34;, guardName&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                    if &amp;#40;guard &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                        return&amp;#59;&lt;br /&gt;                    var handler &amp;#61; &amp;#40;PropertyChangedEventHandler&amp;#41;null&amp;#59;&lt;br /&gt;                    handler &amp;#61; &amp;#40;&amp;#40;s, e&amp;#41; &amp;#61;&amp;#62;&lt;br /&gt;                               &amp;#123;&lt;br /&gt;                                   if &amp;#40;string.IsNullOrEmpty&amp;#40;e.PropertyName&amp;#41; &amp;#124;&amp;#124; e.PropertyName &amp;#61;&amp;#61; guardName&amp;#41;&lt;br /&gt;                                   &amp;#123;&lt;br /&gt;                                       &amp;#40;&amp;#40;Action&amp;#41;&amp;#40;&amp;#40;&amp;#41; &amp;#61;&amp;#62;&lt;br /&gt;                                                 &amp;#123;&lt;br /&gt;                                                     var message &amp;#61; context.Message&amp;#59;&lt;br /&gt;                                                     if &amp;#40;message &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                                                         inpc.PropertyChanged -&amp;#61; handler&amp;#59;&lt;br /&gt;                                                     else&lt;br /&gt;                                                         message.UpdateAvailability&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                                                 &amp;#125;&amp;#41;&amp;#41;.OnUIThread&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                                   &amp;#125;&lt;br /&gt;                               &amp;#125;&amp;#41;&amp;#59;&lt;br /&gt;                    inpc.PropertyChanged &amp;#43;&amp;#61; handler&amp;#59;&lt;br /&gt;                    context.Disposing &amp;#43;&amp;#61; &amp;#40;s, e&amp;#41; &amp;#61;&amp;#62; inpc.PropertyChanged -&amp;#61; handler&amp;#59;&lt;br /&gt;                    context.Message.Detaching &amp;#43;&amp;#61; &amp;#40;s, e&amp;#41; &amp;#61;&amp;#62; inpc.PropertyChanged -&amp;#61; handler&amp;#59;&lt;br /&gt;                    context.CanExecute &amp;#61; &amp;#40;&amp;#41; &amp;#61;&amp;#62; &amp;#40;bool&amp;#41;guard.Invoke&amp;#40;context.Target, MessageBinder.DetermineParameters&amp;#40;context, guard.GetParameters&amp;#40;&amp;#41;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                &amp;#125;&lt;br /&gt;                else&lt;br /&gt;                &amp;#123;&lt;br /&gt;                    var updateEventName &amp;#61; string.Format&amp;#40;&amp;#34;ReEvaluate&amp;#123;0&amp;#125;&amp;#34;, guardName&amp;#41;&amp;#59;&lt;br /&gt;                    var updateEvent &amp;#61; targetType.GetEvent&amp;#40;updateEventName&amp;#41;&amp;#59;&lt;br /&gt;                    if &amp;#40;updateEvent &amp;#33;&amp;#61; null&amp;#41;&lt;br /&gt;                    &amp;#123;&lt;br /&gt;                        var target &amp;#61; context.Target&amp;#59;&lt;br /&gt;                        EventHandler handler &amp;#61; null&amp;#59;&lt;br /&gt;                        handler &amp;#61; &amp;#40;s, e&amp;#41; &amp;#61;&amp;#62; &amp;#40;&amp;#40;Action&amp;#41;&amp;#40;&amp;#40;&amp;#41; &amp;#61;&amp;#62;&lt;br /&gt;                                                      &amp;#123;&lt;br /&gt;                                                          var message &amp;#61; context.Message&amp;#59;&lt;br /&gt;                                                          if &amp;#40;message &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                                                              updateEvent.RemoveEventHandler&amp;#40;target, handler&amp;#41;&amp;#59;&lt;br /&gt;                                                          else&lt;br /&gt;                                                              message.UpdateAvailability&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                                                      &amp;#125;&amp;#41;&amp;#41;.OnUIThread&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                        updateEvent.AddEventHandler&amp;#40;target, handler&amp;#41;&amp;#59;&lt;br /&gt;                        context.Disposing &amp;#43;&amp;#61; &amp;#40;s, e&amp;#41; &amp;#61;&amp;#62; updateEvent.RemoveEventHandler&amp;#40;target, handler&amp;#41;&amp;#59;&lt;br /&gt;                        context.Message.Detaching &amp;#43;&amp;#61; &amp;#40;s, e&amp;#41; &amp;#61;&amp;#62; updateEvent.RemoveEventHandler&amp;#40;target, handler&amp;#41;&amp;#59;&lt;br /&gt;                    &amp;#125;&lt;br /&gt;&lt;br /&gt;                    context.CanExecute &amp;#61; &amp;#40;&amp;#41; &amp;#61;&amp;#62; &amp;#40;bool&amp;#41;guard.Invoke&amp;#40;context.Target, MessageBinder.DetermineParameters&amp;#40;context, guard.GetParameters&amp;#40;&amp;#41;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                &amp;#125;&lt;br /&gt;            &amp;#125;&lt;br /&gt;        &amp;#125;&lt;br /&gt;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47;     Tries to find the guard method.&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;param name&amp;#61;&amp;#34;context&amp;#34;&amp;#62;The context.&amp;#60;&amp;#47;param&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;returns&amp;#62;The guard method.&amp;#60;&amp;#47;returns&amp;#62;&lt;br /&gt;        private static MethodInfo TryFindGuardMethod&amp;#40;ActionExecutionContext context&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            var name &amp;#61; string.Format&amp;#40;&amp;#34;Can&amp;#123;0&amp;#125;&amp;#34;, context.Method.Name&amp;#41;&amp;#59;&lt;br /&gt;            var method &amp;#61; context.Target.GetType&amp;#40;&amp;#41;.GetMethod&amp;#40;name&amp;#41;&amp;#59;&lt;br /&gt;            if &amp;#40;method &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                return null&amp;#59;&lt;br /&gt;            if &amp;#40;method.ContainsGenericParameters&amp;#41;&lt;br /&gt;                return null&amp;#59;&lt;br /&gt;            if &amp;#40;typeof&amp;#40;bool&amp;#41; &amp;#33;&amp;#61; method.ReturnType&amp;#41;&lt;br /&gt;                return null&amp;#59;&lt;br /&gt;            var methodParameters &amp;#61; method.GetParameters&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            var contextMethodParameters &amp;#61; context.Method.GetParameters&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            if &amp;#40;methodParameters.Length &amp;#61;&amp;#61; 0&amp;#41;&lt;br /&gt;                return method&amp;#59;&lt;br /&gt;            if &amp;#40;methodParameters.Length &amp;#33;&amp;#61; contextMethodParameters.Length&amp;#41;&lt;br /&gt;                return null&amp;#59;&lt;br /&gt;            return methodParameters.Zip&amp;#40;contextMethodParameters, &amp;#40;x, y&amp;#41; &amp;#61;&amp;#62; x.ParameterType &amp;#61;&amp;#61; y.ParameterType&amp;#41;.Any&amp;#40;x &amp;#61;&amp;#62; &amp;#33;x&amp;#41; &amp;#63; null &amp;#58; method&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47;     Enables support for action guard methods re-evaluation, through a specific event naming convention.&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;&lt;br /&gt;        public static void EnableActionGuardMethodReEvaluateSupport&amp;#40;&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            ActionMessage.PrepareContext &amp;#61; PrepareContext&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;        &amp;#35;endregion&lt;br /&gt;    &amp;#125;&lt;br /&gt;&amp;#125;&lt;br /&gt;&amp;#96;&amp;#96;&amp;#96;&lt;br /&gt;You can download a working sample &amp;#91;here&amp;#93;&amp;#40;http&amp;#58;&amp;#47;&amp;#47;www.mediafire.com&amp;#47;&amp;#63;irqiiq9bvbn41x4&amp;#41;.&lt;br /&gt;</description><author>McDonnellDean</author><pubDate>Sun, 12 May 2013 11:50:42 GMT</pubDate><guid isPermaLink="false">Edited Unassigned: [Dev Question] Action guard method re-evaluation [312] 20130512115042A</guid></item><item><title>Created Unassigned: [Dev Question] Action guard method re-evaluation [312]</title><link>http://caliburnmicro.codeplex.com/workitem/312</link><description>I wanted to get opinions from the dev&amp;#39;s on items like below.&lt;br /&gt;&lt;br /&gt;On the one hand something like this could be integrated into Caliburn.Micro proper, on the other hand it could make more sense for the original author to package it up as an recipe.&lt;br /&gt;&lt;br /&gt;Thoughts&amp;#63;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Every now and then, there is a new user that asks how to trigger availability update for action guards implemented as methods. I am aware that such methods are re-evaluated every time a parameter changes, but there are some cases where the evaluation of a guard depends on both  the parameters and the internal state of the class providing the action. In such a scenario, it can be useful to have a way to forcefully request an availability update on the action.&lt;br /&gt;&lt;br /&gt;I decided to provide a possible solution, involving a simple naming convention and the use of specific events&amp;#58; consider and action called &amp;#39;Execute&amp;#40;...&amp;#41;&amp;#39; and the associated method guard &amp;#39;CanExecute&amp;#40;...&amp;#41;&amp;#39;&amp;#59; my idea is to modify the PrepareContext implementation to check for the existence of a specific event, called &amp;#39;ReEvaluateCanExecute&amp;#39; and, if available, attach to it and invoke UpdateAvailability whenever the event is invoked.&lt;br /&gt;Since PrepareContext is an extensibility point, this feature can be easily added, without modifying the current CM code base.&lt;br /&gt;&lt;br /&gt;The actual implementation is provided below&amp;#58;&lt;br /&gt;&amp;#96;&amp;#96;&amp;#96; C&amp;#35;&lt;br /&gt;namespace ActionGuardSample&lt;br /&gt;&amp;#123;&lt;br /&gt;    &amp;#35;region Namespaces&lt;br /&gt;    using System&amp;#59;&lt;br /&gt;    using System.ComponentModel&amp;#59;&lt;br /&gt;    using System.Linq&amp;#59;&lt;br /&gt;    using System.Reflection&amp;#59;&lt;br /&gt;    using Caliburn.Micro&amp;#59;&lt;br /&gt;    using Action &amp;#61; System.Action&amp;#59;&lt;br /&gt;&lt;br /&gt;    &amp;#35;endregion&lt;br /&gt;&lt;br /&gt;    &amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;&lt;br /&gt;    &amp;#47;&amp;#47;&amp;#47;     Static class used to provide Caliburn Micro extensions.&lt;br /&gt;    &amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;&lt;br /&gt;    public static class CaliburnMicroExtensions&lt;br /&gt;    &amp;#123;&lt;br /&gt;        &amp;#35;region Static Methods&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47;     Prepares the context.&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;param name&amp;#61;&amp;#34;context&amp;#34;&amp;#62;The context.&amp;#60;&amp;#47;param&amp;#62;&lt;br /&gt;        private static void PrepareContext&amp;#40;ActionExecutionContext context&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            ActionMessage.SetMethodBinding&amp;#40;context&amp;#41;&amp;#59;&lt;br /&gt;            if &amp;#40;context.Target &amp;#33;&amp;#61; null &amp;#38;&amp;#38; context.Method &amp;#33;&amp;#61; null&amp;#41;&lt;br /&gt;            &amp;#123;&lt;br /&gt;                var targetType &amp;#61; context.Target.GetType&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                var guardName &amp;#61; string.Format&amp;#40;&amp;#34;Can&amp;#123;0&amp;#125;&amp;#34;, context.Method.Name&amp;#41;&amp;#59;&lt;br /&gt;                var guard &amp;#61; TryFindGuardMethod&amp;#40;context&amp;#41;&amp;#59;&lt;br /&gt;                if &amp;#40;guard &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                &amp;#123;&lt;br /&gt;                    var inpc &amp;#61; context.Target as INotifyPropertyChanged&amp;#59;&lt;br /&gt;                    if &amp;#40;inpc &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                        return&amp;#59;&lt;br /&gt;                    guard &amp;#61; targetType.GetMethod&amp;#40;string.Format&amp;#40;&amp;#34;get_&amp;#123;0&amp;#125;&amp;#34;, guardName&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                    if &amp;#40;guard &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                        return&amp;#59;&lt;br /&gt;                    var handler &amp;#61; &amp;#40;PropertyChangedEventHandler&amp;#41;null&amp;#59;&lt;br /&gt;                    handler &amp;#61; &amp;#40;&amp;#40;s, e&amp;#41; &amp;#61;&amp;#62;&lt;br /&gt;                               &amp;#123;&lt;br /&gt;                                   if &amp;#40;string.IsNullOrEmpty&amp;#40;e.PropertyName&amp;#41; &amp;#124;&amp;#124; e.PropertyName &amp;#61;&amp;#61; guardName&amp;#41;&lt;br /&gt;                                   &amp;#123;&lt;br /&gt;                                       &amp;#40;&amp;#40;Action&amp;#41;&amp;#40;&amp;#40;&amp;#41; &amp;#61;&amp;#62;&lt;br /&gt;                                                 &amp;#123;&lt;br /&gt;                                                     var message &amp;#61; context.Message&amp;#59;&lt;br /&gt;                                                     if &amp;#40;message &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                                                         inpc.PropertyChanged -&amp;#61; handler&amp;#59;&lt;br /&gt;                                                     else&lt;br /&gt;                                                         message.UpdateAvailability&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                                                 &amp;#125;&amp;#41;&amp;#41;.OnUIThread&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                                   &amp;#125;&lt;br /&gt;                               &amp;#125;&amp;#41;&amp;#59;&lt;br /&gt;                    inpc.PropertyChanged &amp;#43;&amp;#61; handler&amp;#59;&lt;br /&gt;                    context.Disposing &amp;#43;&amp;#61; &amp;#40;s, e&amp;#41; &amp;#61;&amp;#62; inpc.PropertyChanged -&amp;#61; handler&amp;#59;&lt;br /&gt;                    context.Message.Detaching &amp;#43;&amp;#61; &amp;#40;s, e&amp;#41; &amp;#61;&amp;#62; inpc.PropertyChanged -&amp;#61; handler&amp;#59;&lt;br /&gt;                    context.CanExecute &amp;#61; &amp;#40;&amp;#41; &amp;#61;&amp;#62; &amp;#40;bool&amp;#41;guard.Invoke&amp;#40;context.Target, MessageBinder.DetermineParameters&amp;#40;context, guard.GetParameters&amp;#40;&amp;#41;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                &amp;#125;&lt;br /&gt;                else&lt;br /&gt;                &amp;#123;&lt;br /&gt;                    var updateEventName &amp;#61; string.Format&amp;#40;&amp;#34;ReEvaluate&amp;#123;0&amp;#125;&amp;#34;, guardName&amp;#41;&amp;#59;&lt;br /&gt;                    var updateEvent &amp;#61; targetType.GetEvent&amp;#40;updateEventName&amp;#41;&amp;#59;&lt;br /&gt;                    if &amp;#40;updateEvent &amp;#33;&amp;#61; null&amp;#41;&lt;br /&gt;                    &amp;#123;&lt;br /&gt;                        var target &amp;#61; context.Target&amp;#59;&lt;br /&gt;                        EventHandler handler &amp;#61; null&amp;#59;&lt;br /&gt;                        handler &amp;#61; &amp;#40;s, e&amp;#41; &amp;#61;&amp;#62; &amp;#40;&amp;#40;Action&amp;#41;&amp;#40;&amp;#40;&amp;#41; &amp;#61;&amp;#62;&lt;br /&gt;                                                      &amp;#123;&lt;br /&gt;                                                          var message &amp;#61; context.Message&amp;#59;&lt;br /&gt;                                                          if &amp;#40;message &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                                                              updateEvent.RemoveEventHandler&amp;#40;target, handler&amp;#41;&amp;#59;&lt;br /&gt;                                                          else&lt;br /&gt;                                                              message.UpdateAvailability&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                                                      &amp;#125;&amp;#41;&amp;#41;.OnUIThread&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                        updateEvent.AddEventHandler&amp;#40;target, handler&amp;#41;&amp;#59;&lt;br /&gt;                        context.Disposing &amp;#43;&amp;#61; &amp;#40;s, e&amp;#41; &amp;#61;&amp;#62; updateEvent.RemoveEventHandler&amp;#40;target, handler&amp;#41;&amp;#59;&lt;br /&gt;                        context.Message.Detaching &amp;#43;&amp;#61; &amp;#40;s, e&amp;#41; &amp;#61;&amp;#62; updateEvent.RemoveEventHandler&amp;#40;target, handler&amp;#41;&amp;#59;&lt;br /&gt;                    &amp;#125;&lt;br /&gt;&lt;br /&gt;                    context.CanExecute &amp;#61; &amp;#40;&amp;#41; &amp;#61;&amp;#62; &amp;#40;bool&amp;#41;guard.Invoke&amp;#40;context.Target, MessageBinder.DetermineParameters&amp;#40;context, guard.GetParameters&amp;#40;&amp;#41;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                &amp;#125;&lt;br /&gt;            &amp;#125;&lt;br /&gt;        &amp;#125;&lt;br /&gt;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47;     Tries to find the guard method.&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;param name&amp;#61;&amp;#34;context&amp;#34;&amp;#62;The context.&amp;#60;&amp;#47;param&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;returns&amp;#62;The guard method.&amp;#60;&amp;#47;returns&amp;#62;&lt;br /&gt;        private static MethodInfo TryFindGuardMethod&amp;#40;ActionExecutionContext context&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            var name &amp;#61; string.Format&amp;#40;&amp;#34;Can&amp;#123;0&amp;#125;&amp;#34;, context.Method.Name&amp;#41;&amp;#59;&lt;br /&gt;            var method &amp;#61; context.Target.GetType&amp;#40;&amp;#41;.GetMethod&amp;#40;name&amp;#41;&amp;#59;&lt;br /&gt;            if &amp;#40;method &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                return null&amp;#59;&lt;br /&gt;            if &amp;#40;method.ContainsGenericParameters&amp;#41;&lt;br /&gt;                return null&amp;#59;&lt;br /&gt;            if &amp;#40;typeof&amp;#40;bool&amp;#41; &amp;#33;&amp;#61; method.ReturnType&amp;#41;&lt;br /&gt;                return null&amp;#59;&lt;br /&gt;            var methodParameters &amp;#61; method.GetParameters&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            var contextMethodParameters &amp;#61; context.Method.GetParameters&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            if &amp;#40;methodParameters.Length &amp;#61;&amp;#61; 0&amp;#41;&lt;br /&gt;                return method&amp;#59;&lt;br /&gt;            if &amp;#40;methodParameters.Length &amp;#33;&amp;#61; contextMethodParameters.Length&amp;#41;&lt;br /&gt;                return null&amp;#59;&lt;br /&gt;            return methodParameters.Zip&amp;#40;contextMethodParameters, &amp;#40;x, y&amp;#41; &amp;#61;&amp;#62; x.ParameterType &amp;#61;&amp;#61; y.ParameterType&amp;#41;.Any&amp;#40;x &amp;#61;&amp;#62; &amp;#33;x&amp;#41; &amp;#63; null &amp;#58; method&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47;     Enables support for action guard methods re-evaluation, through a specific event naming convention.&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;&lt;br /&gt;        public static void EnableActionGuardMethodReEvaluateSupport&amp;#40;&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            ActionMessage.PrepareContext &amp;#61; PrepareContext&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;        &amp;#35;endregion&lt;br /&gt;    &amp;#125;&lt;br /&gt;&amp;#125;&lt;br /&gt;&amp;#96;&amp;#96;&amp;#96;&lt;br /&gt;You can download a working sample &amp;#91;here&amp;#93;&amp;#40;http&amp;#58;&amp;#47;&amp;#47;www.mediafire.com&amp;#47;&amp;#63;irqiiq9bvbn41x4&amp;#41;.&lt;br /&gt;</description><author>McDonnellDean</author><pubDate>Sun, 12 May 2013 11:49:32 GMT</pubDate><guid isPermaLink="false">Created Unassigned: [Dev Question] Action guard method re-evaluation [312] 20130512114932A</guid></item><item><title>Closed Unassigned: AppBootstrapper: .Configure() not reliable if marked as async, Windows Phone [311]</title><link>http://caliburnmicro.codeplex.com/workitem/311</link><description>Hi all,&lt;br /&gt;&lt;br /&gt;I had to mark the .Configure method of the bootstrapper as async since there is some file system access going on.&lt;br /&gt;&lt;br /&gt;Now, every 3-10 launches the app will not come up correctly as CM does not bind the view model in time.&lt;br /&gt;&lt;br /&gt;I know, because I introduced a static property on the bootstrapper that is set once .Configure&amp;#40;&amp;#41; has run to the end. I checked that property in the code-behind of the first page &amp;#40;RootPageView.xaml&amp;#41;. It sometimes comes up as unset.&lt;br /&gt;&lt;br /&gt;The first page of the app comes up very quickly &amp;#40;no content, no code-behind&amp;#41;. It&amp;#39;s only used to jump into the application &amp;#40;cannot change this&amp;#41;.&lt;br /&gt;&lt;br /&gt;Do you have any suggestions&amp;#63;&lt;br /&gt;&lt;br /&gt;Can I put async Func&amp;#60;Task&amp;#60;T&amp;#62;&amp;#62; into the container so that I do not have to resolve the types in the bootstrapper itself&amp;#63; An example would be appreciated.&lt;br /&gt;&lt;br /&gt;Or should I handle the async dependency myself somewhere in the app&amp;#63;&lt;br /&gt;&lt;br /&gt;I appended the precise code.&lt;br /&gt;&lt;br /&gt;Windows Phone 8, CM 1.4.x and 1.5.x&lt;br /&gt;&lt;br /&gt;The code&amp;#58;&lt;br /&gt;&amp;#96;&amp;#96;&amp;#96;&lt;br /&gt;        protected override async void Configure&amp;#40;&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            container &amp;#61; new PhoneContainer&amp;#40;RootFrame&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            container.RegisterPhoneServices&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            var state &amp;#61; await AppState.Retrieve&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            if &amp;#40;state &amp;#33;&amp;#61; null&amp;#41; &amp;#47;&amp;#47; Not set in designer&lt;br /&gt;            &amp;#123;&lt;br /&gt;                var settings &amp;#61; state.GetCurrentSettings&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                if &amp;#40;settings &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                &amp;#123;&lt;br /&gt;                    var firstSettings &amp;#61; state.KnownServerLogins.First&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                    await state.SetCurrentSettings&amp;#40;firstSettings&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                    settings &amp;#61; state.GetCurrentSettings&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                &amp;#125;&lt;br /&gt;&lt;br /&gt;                var context &amp;#61; new AppContext&amp;#40;state, &amp;#40;&amp;#41; &amp;#61;&amp;#62; new HttpClientWP8&amp;#40;&amp;#41;, new NetworkingWP7&amp;#40;&amp;#41;, new JsonSerializerWP7&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                &lt;br /&gt;                container.RegisterInstance&amp;#40;typeof&amp;#40;PhoneApplicationFrame&amp;#41;, null, RootFrame&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterInstance&amp;#40;typeof&amp;#40;AppContext&amp;#41;, null, context&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterInstance&amp;#40;typeof&amp;#40;IUniqueIntProvider&amp;#41;, null, state&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterInstance&amp;#40;typeof&amp;#40;IServerSettings&amp;#41;, null, settings&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterHandler&amp;#40;typeof&amp;#40;IRelativeFileSystem&amp;#41;, null, c &amp;#61;&amp;#62; new FileSystemWinRT&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterHandler&amp;#40;typeof&amp;#40;IJsonSerializer&amp;#41;, null, c &amp;#61;&amp;#62; new JsonSerializerWP7&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterSingleton&amp;#40;typeof&amp;#40;Space&amp;#41;, null, typeof&amp;#40;Space&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                var space &amp;#61; &amp;#40;Space&amp;#41;container.GetInstance&amp;#40;typeof&amp;#40;Space&amp;#41;, null&amp;#41;&amp;#59;&lt;br /&gt;                context.CurrentSpace &amp;#61; space&amp;#59;&lt;br /&gt;&lt;br /&gt;                container.Singleton&amp;#60;RootPageViewModel&amp;#62;&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                container.PerRequest&amp;#60;MainPageViewModel&amp;#62;&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            &amp;#125;&lt;br /&gt;&lt;br /&gt;            AddCustomConventions&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            Container &amp;#61; container&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;&amp;#96;&amp;#96;&amp;#96;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Best,&lt;br /&gt;Tobias&lt;br /&gt;Comments: Not a CM issue</description><author>tibel</author><pubDate>Sat, 04 May 2013 07:38:36 GMT</pubDate><guid isPermaLink="false">Closed Unassigned: AppBootstrapper: .Configure() not reliable if marked as async, Windows Phone [311] 20130504073836A</guid></item><item><title>Commented Feature: Make Portable Libraries [259]</title><link>http://caliburnmicro.codeplex.com/workitem/259</link><description>For v2 we need to refactor to portable libraries.&lt;br /&gt;Comments: .NET 4.0 will not be supported by portable version,&amp;#10;see https&amp;#58;&amp;#47;&amp;#47;twitter.com&amp;#47;davkean&amp;#47;status&amp;#47;329658035490418688</description><author>tibel</author><pubDate>Thu, 02 May 2013 16:53:34 GMT</pubDate><guid isPermaLink="false">Commented Feature: Make Portable Libraries [259] 20130502045334P</guid></item><item><title>Commented Feature: Make Portable Libraries [259]</title><link>http://caliburnmicro.codeplex.com/workitem/259</link><description>For v2 we need to refactor to portable libraries.&lt;br /&gt;Comments: Last message is true, when portable project includes .NET 4.0 target. Other combinations work.</description><author>tibel</author><pubDate>Wed, 01 May 2013 11:10:11 GMT</pubDate><guid isPermaLink="false">Commented Feature: Make Portable Libraries [259] 20130501111011A</guid></item><item><title>Commented Feature: Make Portable Libraries [259]</title><link>http://caliburnmicro.codeplex.com/workitem/259</link><description>For v2 we need to refactor to portable libraries.&lt;br /&gt;Comments: This issue is still blocked&amp;#58;&amp;#10;_INotifyCollectionChanged_ is not supported by portable projects yet.</description><author>tibel</author><pubDate>Wed, 01 May 2013 10:54:07 GMT</pubDate><guid isPermaLink="false">Commented Feature: Make Portable Libraries [259] 20130501105407A</guid></item><item><title>Commented Unassigned: AppBootstrapper: .Configure() not reliable if marked as async, Windows Phone [311]</title><link>http://caliburnmicro.codeplex.com/workitem/311</link><description>Hi all,&lt;br /&gt;&lt;br /&gt;I had to mark the .Configure method of the bootstrapper as async since there is some file system access going on.&lt;br /&gt;&lt;br /&gt;Now, every 3-10 launches the app will not come up correctly as CM does not bind the view model in time.&lt;br /&gt;&lt;br /&gt;I know, because I introduced a static property on the bootstrapper that is set once .Configure&amp;#40;&amp;#41; has run to the end. I checked that property in the code-behind of the first page &amp;#40;RootPageView.xaml&amp;#41;. It sometimes comes up as unset.&lt;br /&gt;&lt;br /&gt;The first page of the app comes up very quickly &amp;#40;no content, no code-behind&amp;#41;. It&amp;#39;s only used to jump into the application &amp;#40;cannot change this&amp;#41;.&lt;br /&gt;&lt;br /&gt;Do you have any suggestions&amp;#63;&lt;br /&gt;&lt;br /&gt;Can I put async Func&amp;#60;Task&amp;#60;T&amp;#62;&amp;#62; into the container so that I do not have to resolve the types in the bootstrapper itself&amp;#63; An example would be appreciated.&lt;br /&gt;&lt;br /&gt;Or should I handle the async dependency myself somewhere in the app&amp;#63;&lt;br /&gt;&lt;br /&gt;I appended the precise code.&lt;br /&gt;&lt;br /&gt;Windows Phone 8, CM 1.4.x and 1.5.x&lt;br /&gt;&lt;br /&gt;The code&amp;#58;&lt;br /&gt;&amp;#96;&amp;#96;&amp;#96;&lt;br /&gt;        protected override async void Configure&amp;#40;&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            container &amp;#61; new PhoneContainer&amp;#40;RootFrame&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            container.RegisterPhoneServices&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            var state &amp;#61; await AppState.Retrieve&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            if &amp;#40;state &amp;#33;&amp;#61; null&amp;#41; &amp;#47;&amp;#47; Not set in designer&lt;br /&gt;            &amp;#123;&lt;br /&gt;                var settings &amp;#61; state.GetCurrentSettings&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                if &amp;#40;settings &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                &amp;#123;&lt;br /&gt;                    var firstSettings &amp;#61; state.KnownServerLogins.First&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                    await state.SetCurrentSettings&amp;#40;firstSettings&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                    settings &amp;#61; state.GetCurrentSettings&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                &amp;#125;&lt;br /&gt;&lt;br /&gt;                var context &amp;#61; new AppContext&amp;#40;state, &amp;#40;&amp;#41; &amp;#61;&amp;#62; new HttpClientWP8&amp;#40;&amp;#41;, new NetworkingWP7&amp;#40;&amp;#41;, new JsonSerializerWP7&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                &lt;br /&gt;                container.RegisterInstance&amp;#40;typeof&amp;#40;PhoneApplicationFrame&amp;#41;, null, RootFrame&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterInstance&amp;#40;typeof&amp;#40;AppContext&amp;#41;, null, context&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterInstance&amp;#40;typeof&amp;#40;IUniqueIntProvider&amp;#41;, null, state&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterInstance&amp;#40;typeof&amp;#40;IServerSettings&amp;#41;, null, settings&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterHandler&amp;#40;typeof&amp;#40;IRelativeFileSystem&amp;#41;, null, c &amp;#61;&amp;#62; new FileSystemWinRT&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterHandler&amp;#40;typeof&amp;#40;IJsonSerializer&amp;#41;, null, c &amp;#61;&amp;#62; new JsonSerializerWP7&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterSingleton&amp;#40;typeof&amp;#40;Space&amp;#41;, null, typeof&amp;#40;Space&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                var space &amp;#61; &amp;#40;Space&amp;#41;container.GetInstance&amp;#40;typeof&amp;#40;Space&amp;#41;, null&amp;#41;&amp;#59;&lt;br /&gt;                context.CurrentSpace &amp;#61; space&amp;#59;&lt;br /&gt;&lt;br /&gt;                container.Singleton&amp;#60;RootPageViewModel&amp;#62;&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                container.PerRequest&amp;#60;MainPageViewModel&amp;#62;&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            &amp;#125;&lt;br /&gt;&lt;br /&gt;            AddCustomConventions&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            Container &amp;#61; container&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;&amp;#96;&amp;#96;&amp;#96;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Best,&lt;br /&gt;Tobias&lt;br /&gt;Comments: Sounds like a timing issue that you have in your code.&amp;#10;&amp;#10;Your problem is that when CM tries to bind the ViewModel to the View, there is no ViewModel registered in the container yet. This is because of the async stuff done before registering the ViewModels.&amp;#10;&amp;#10;To solve this you should register your ViewModels first&amp;#58;&amp;#10;&amp;#96;&amp;#96;&amp;#96; C&amp;#35;&amp;#10;protected override async void Configure&amp;#40;&amp;#41; &amp;#123;&amp;#10;    container &amp;#61; new PhoneContainer&amp;#40;RootFrame&amp;#41;&amp;#59;&amp;#10;    if &amp;#40;&amp;#33;Execute.InDesignMode&amp;#41;&amp;#10;        container.RegisterPhoneServices&amp;#40;&amp;#41;&amp;#59;&amp;#10;&amp;#10;    container.Singleton&amp;#60;RootPageViewModel&amp;#62;&amp;#40;&amp;#41;&amp;#59;&amp;#10;    container.PerRequest&amp;#60;MainPageViewModel&amp;#62;&amp;#40;&amp;#41;&amp;#59;&amp;#10;    &amp;#10;    &amp;#47;&amp;#47;add other stuff here&amp;#10;&amp;#96;&amp;#96;&amp;#96;&amp;#10;&amp;#10;Then CM should be able to bind ViewModels to the View.&amp;#10;There can still be other timing issues, if the ViewModel depends on something that is initialized async &amp;#40;later&amp;#41;. As the async void method returns before it is completed.&amp;#10;&amp;#10;Generally&amp;#58;&amp;#10;- Try to minimize big upfront initialization&amp;#10;- Try to &amp;#91;avoid async void&amp;#93;&amp;#40;http&amp;#58;&amp;#47;&amp;#47;msdn.microsoft.com&amp;#47;en-us&amp;#47;magazine&amp;#47;jj991977.aspx&amp;#41;</description><author>tibel</author><pubDate>Wed, 01 May 2013 06:00:44 GMT</pubDate><guid isPermaLink="false">Commented Unassigned: AppBootstrapper: .Configure() not reliable if marked as async, Windows Phone [311] 20130501060044A</guid></item><item><title>Commented Unassigned: AppBootstrapper: .Configure() not reliable if marked as async, Windows Phone [311]</title><link>http://caliburnmicro.codeplex.com/workitem/311</link><description>Hi all,&lt;br /&gt;&lt;br /&gt;I had to mark the .Configure method of the bootstrapper as async since there is some file system access going on.&lt;br /&gt;&lt;br /&gt;Now, every 3-10 launches the app will not come up correctly as CM does not bind the view model in time.&lt;br /&gt;&lt;br /&gt;I know, because I introduced a static property on the bootstrapper that is set once .Configure&amp;#40;&amp;#41; has run to the end. I checked that property in the code-behind of the first page &amp;#40;RootPageView.xaml&amp;#41;. It sometimes comes up as unset.&lt;br /&gt;&lt;br /&gt;The first page of the app comes up very quickly &amp;#40;no content, no code-behind&amp;#41;. It&amp;#39;s only used to jump into the application &amp;#40;cannot change this&amp;#41;.&lt;br /&gt;&lt;br /&gt;Do you have any suggestions&amp;#63;&lt;br /&gt;&lt;br /&gt;Can I put async Func&amp;#60;Task&amp;#60;T&amp;#62;&amp;#62; into the container so that I do not have to resolve the types in the bootstrapper itself&amp;#63; An example would be appreciated.&lt;br /&gt;&lt;br /&gt;Or should I handle the async dependency myself somewhere in the app&amp;#63;&lt;br /&gt;&lt;br /&gt;I appended the precise code.&lt;br /&gt;&lt;br /&gt;Windows Phone 8, CM 1.4.x and 1.5.x&lt;br /&gt;&lt;br /&gt;The code&amp;#58;&lt;br /&gt;&amp;#96;&amp;#96;&amp;#96;&lt;br /&gt;        protected override async void Configure&amp;#40;&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            container &amp;#61; new PhoneContainer&amp;#40;RootFrame&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            container.RegisterPhoneServices&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            var state &amp;#61; await AppState.Retrieve&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            if &amp;#40;state &amp;#33;&amp;#61; null&amp;#41; &amp;#47;&amp;#47; Not set in designer&lt;br /&gt;            &amp;#123;&lt;br /&gt;                var settings &amp;#61; state.GetCurrentSettings&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                if &amp;#40;settings &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                &amp;#123;&lt;br /&gt;                    var firstSettings &amp;#61; state.KnownServerLogins.First&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                    await state.SetCurrentSettings&amp;#40;firstSettings&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                    settings &amp;#61; state.GetCurrentSettings&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                &amp;#125;&lt;br /&gt;&lt;br /&gt;                var context &amp;#61; new AppContext&amp;#40;state, &amp;#40;&amp;#41; &amp;#61;&amp;#62; new HttpClientWP8&amp;#40;&amp;#41;, new NetworkingWP7&amp;#40;&amp;#41;, new JsonSerializerWP7&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                &lt;br /&gt;                container.RegisterInstance&amp;#40;typeof&amp;#40;PhoneApplicationFrame&amp;#41;, null, RootFrame&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterInstance&amp;#40;typeof&amp;#40;AppContext&amp;#41;, null, context&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterInstance&amp;#40;typeof&amp;#40;IUniqueIntProvider&amp;#41;, null, state&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterInstance&amp;#40;typeof&amp;#40;IServerSettings&amp;#41;, null, settings&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterHandler&amp;#40;typeof&amp;#40;IRelativeFileSystem&amp;#41;, null, c &amp;#61;&amp;#62; new FileSystemWinRT&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterHandler&amp;#40;typeof&amp;#40;IJsonSerializer&amp;#41;, null, c &amp;#61;&amp;#62; new JsonSerializerWP7&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterSingleton&amp;#40;typeof&amp;#40;Space&amp;#41;, null, typeof&amp;#40;Space&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                var space &amp;#61; &amp;#40;Space&amp;#41;container.GetInstance&amp;#40;typeof&amp;#40;Space&amp;#41;, null&amp;#41;&amp;#59;&lt;br /&gt;                context.CurrentSpace &amp;#61; space&amp;#59;&lt;br /&gt;&lt;br /&gt;                container.Singleton&amp;#60;RootPageViewModel&amp;#62;&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                container.PerRequest&amp;#60;MainPageViewModel&amp;#62;&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            &amp;#125;&lt;br /&gt;&lt;br /&gt;            AddCustomConventions&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            Container &amp;#61; container&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;&amp;#96;&amp;#96;&amp;#96;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Best,&lt;br /&gt;Tobias&lt;br /&gt;Comments: Ah yes, and the navigation to the actual launch page is triggered at the end of that async method</description><author>tskarman</author><pubDate>Sun, 28 Apr 2013 22:41:30 GMT</pubDate><guid isPermaLink="false">Commented Unassigned: AppBootstrapper: .Configure() not reliable if marked as async, Windows Phone [311] 20130428104130P</guid></item><item><title>Commented Unassigned: AppBootstrapper: .Configure() not reliable if marked as async, Windows Phone [311]</title><link>http://caliburnmicro.codeplex.com/workitem/311</link><description>Hi all,&lt;br /&gt;&lt;br /&gt;I had to mark the .Configure method of the bootstrapper as async since there is some file system access going on.&lt;br /&gt;&lt;br /&gt;Now, every 3-10 launches the app will not come up correctly as CM does not bind the view model in time.&lt;br /&gt;&lt;br /&gt;I know, because I introduced a static property on the bootstrapper that is set once .Configure&amp;#40;&amp;#41; has run to the end. I checked that property in the code-behind of the first page &amp;#40;RootPageView.xaml&amp;#41;. It sometimes comes up as unset.&lt;br /&gt;&lt;br /&gt;The first page of the app comes up very quickly &amp;#40;no content, no code-behind&amp;#41;. It&amp;#39;s only used to jump into the application &amp;#40;cannot change this&amp;#41;.&lt;br /&gt;&lt;br /&gt;Do you have any suggestions&amp;#63;&lt;br /&gt;&lt;br /&gt;Can I put async Func&amp;#60;Task&amp;#60;T&amp;#62;&amp;#62; into the container so that I do not have to resolve the types in the bootstrapper itself&amp;#63; An example would be appreciated.&lt;br /&gt;&lt;br /&gt;Or should I handle the async dependency myself somewhere in the app&amp;#63;&lt;br /&gt;&lt;br /&gt;I appended the precise code.&lt;br /&gt;&lt;br /&gt;Windows Phone 8, CM 1.4.x and 1.5.x&lt;br /&gt;&lt;br /&gt;The code&amp;#58;&lt;br /&gt;&amp;#96;&amp;#96;&amp;#96;&lt;br /&gt;        protected override async void Configure&amp;#40;&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            container &amp;#61; new PhoneContainer&amp;#40;RootFrame&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            container.RegisterPhoneServices&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            var state &amp;#61; await AppState.Retrieve&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            if &amp;#40;state &amp;#33;&amp;#61; null&amp;#41; &amp;#47;&amp;#47; Not set in designer&lt;br /&gt;            &amp;#123;&lt;br /&gt;                var settings &amp;#61; state.GetCurrentSettings&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                if &amp;#40;settings &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                &amp;#123;&lt;br /&gt;                    var firstSettings &amp;#61; state.KnownServerLogins.First&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                    await state.SetCurrentSettings&amp;#40;firstSettings&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                    settings &amp;#61; state.GetCurrentSettings&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                &amp;#125;&lt;br /&gt;&lt;br /&gt;                var context &amp;#61; new AppContext&amp;#40;state, &amp;#40;&amp;#41; &amp;#61;&amp;#62; new HttpClientWP8&amp;#40;&amp;#41;, new NetworkingWP7&amp;#40;&amp;#41;, new JsonSerializerWP7&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                &lt;br /&gt;                container.RegisterInstance&amp;#40;typeof&amp;#40;PhoneApplicationFrame&amp;#41;, null, RootFrame&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterInstance&amp;#40;typeof&amp;#40;AppContext&amp;#41;, null, context&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterInstance&amp;#40;typeof&amp;#40;IUniqueIntProvider&amp;#41;, null, state&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterInstance&amp;#40;typeof&amp;#40;IServerSettings&amp;#41;, null, settings&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterHandler&amp;#40;typeof&amp;#40;IRelativeFileSystem&amp;#41;, null, c &amp;#61;&amp;#62; new FileSystemWinRT&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterHandler&amp;#40;typeof&amp;#40;IJsonSerializer&amp;#41;, null, c &amp;#61;&amp;#62; new JsonSerializerWP7&amp;#40;&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                container.RegisterSingleton&amp;#40;typeof&amp;#40;Space&amp;#41;, null, typeof&amp;#40;Space&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                var space &amp;#61; &amp;#40;Space&amp;#41;container.GetInstance&amp;#40;typeof&amp;#40;Space&amp;#41;, null&amp;#41;&amp;#59;&lt;br /&gt;                context.CurrentSpace &amp;#61; space&amp;#59;&lt;br /&gt;&lt;br /&gt;                container.Singleton&amp;#60;RootPageViewModel&amp;#62;&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                container.PerRequest&amp;#60;MainPageViewModel&amp;#62;&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            &amp;#125;&lt;br /&gt;&lt;br /&gt;            AddCustomConventions&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;            Container &amp;#61; container&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;&amp;#96;&amp;#96;&amp;#96;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Best,&lt;br /&gt;Tobias&lt;br /&gt;Comments: Moved the async code and its dependencies into RootPageViewModel&amp;#39;s&amp;#10;&amp;#10;&amp;#96;&amp;#96;&amp;#96;&amp;#10;        protected override async void OnInitialize&amp;#40;&amp;#41;&amp;#10;        &amp;#123;&amp;#10;        &amp;#125;&amp;#10;&amp;#96;&amp;#96;&amp;#96;&amp;#10;This does seem to fix the issue in CM 1.5.1.&amp;#10;Would that work in 1.4.x as well&amp;#63;&amp;#10;&amp;#10;I am currently accessing the container via my AppBootstrapper.Container. Has anyone got a better idea&amp;#63;&amp;#10;&amp;#10;Best,&amp;#10;Tobias</description><author>tskarman</author><pubDate>Sun, 28 Apr 2013 22:40:31 GMT</pubDate><guid isPermaLink="false">Commented Unassigned: AppBootstrapper: .Configure() not reliable if marked as async, Windows Phone [311] 20130428104031P</guid></item></channel></rss>