﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - ClientUI - DelegateCommand CanExecute called after Navigation</title><link>http://www.intersoftsolutions.com/Community/ClientUI/DelegateCommand-CanExecute-called-after-Navigation/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>DelegateCommand CanExecute called after Navigation</title><link>http://www.intersoftsolutions.com/Community/ClientUI/DelegateCommand-CanExecute-called-after-Navigation/</link><pubDate>Thu, 18 Jul 2013 09:23:26 GMT</pubDate><dc:creator>hoffmaster@aretechllc.com</dc:creator><description>&lt;p&gt;Thank you so much.  When the IsAutomaticRequeryDisabled property gets set to true the command gets disabled.  I binding to the UXPage Unloaded Event with Interaction Triggers and set the IsAutomaticRequerDisabled to True there.  &lt;/p&gt;</description></item><item><title>DelegateCommand CanExecute called after Navigation</title><link>http://www.intersoftsolutions.com/Community/ClientUI/DelegateCommand-CanExecute-called-after-Navigation/</link><pubDate>Thu, 18 Jul 2013 02:53:12 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;You can try to enable &lt;strong&gt;&lt;em&gt;IsAutomaticRequeryDisabled&lt;/em&gt;&lt;/strong&gt; property of DelegateCommand. It specifies whether automatic require should be disabled.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Following snippet code shows how to enable IsAutomaticRequeryDisabled in the ViewModel.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;class HomeViewModel : ViewModelBase
{
    public HomeViewModel()
    {
        this.Cmd1Action = new DelegateCommand(ExecuteCmd1, CanExecuteCmd1, true);
        this.Cmd2Action = new DelegateCommand(ExecuteCmd2, CanExecuteCmd2, true);
    }
    ...
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>DelegateCommand CanExecute called after Navigation</title><link>http://www.intersoftsolutions.com/Community/ClientUI/DelegateCommand-CanExecute-called-after-Navigation/</link><pubDate>Wed, 17 Jul 2013 16:56:35 GMT</pubDate><dc:creator>hoffmaster@aretechllc.com</dc:creator><description>&lt;p&gt;I am currently developing a WPF application in the MVVM pattern that involves many pages of user navigation and some of the pages consist of many commands.  What I have noticed is that after navigating from one page to another, the CanExecute from my DelegateCommand of the previous view model are still called.  I use the UXNavigationButton to simply display a new page (&lt;span class="s1" style="font-size: 10pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span class="s2" style="font-size: 10pt;"&gt;Intersoft&lt;/span&gt;&lt;span class="s1" style="font-size: 10pt;"&gt;:&lt;/span&gt;&lt;span class="s2" style="font-size: 10pt;"&gt;UXNavigationButton&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; Content&lt;/span&gt;&lt;span class="s1" style="font-size: 10pt;"&gt;="Login"&lt;/span&gt;&lt;span class="s3" style="font-size: 10pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; HorizontalAlignment&lt;/span&gt;&lt;span class="s1" style="font-size: 10pt;"&gt;="Center"&lt;/span&gt;&lt;span class="s3" style="font-size: 10pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; Grid.Row&lt;/span&gt;&lt;span class="s1" style="font-size: 10pt;"&gt;="6"&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; Grid.Column&lt;/span&gt;&lt;span class="s1" style="font-size: 10pt;"&gt;="1"&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; VerticalAlignment&lt;/span&gt;&lt;span class="s1" style="font-size: 10pt;"&gt;="Top"&lt;/span&gt;&lt;span class="s3" style="font-size: 10pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; Style&lt;/span&gt;&lt;span class="s1" style="font-size: 10pt;"&gt;="{&lt;/span&gt;&lt;span class="s2" style="font-size: 10pt;"&gt;StaticResource&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; NavButtonStyle&lt;/span&gt;&lt;span class="s1" style="font-size: 10pt;"&gt;}"&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; NavigateUri&lt;/span&gt;&lt;span class="s1" style="font-size: 10pt;"&gt;="/MainPage" /&amp;gt; ). &amp;nbsp;My delegate commands are created in the view model and simply do a WriteLine every time a CanExecute event is triggered. &amp;nbsp;Is there a way to dispose the DelegateCommand after the current view and ViewModel are navigated away from? &amp;nbsp;I can foresee performance issues down the rode with a 10&amp;#43; page application with many Commands. &amp;nbsp;&lt;/span&gt;&lt;/p&gt;
</description></item></channel></rss>