﻿<?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 - RequiresAuthentication can't bind to property</title><link>http://www.intersoftsolutions.com/Community/ClientUI/RequiresAuthentication-cant-bind-to-property/</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>RequiresAuthentication can't bind to property</title><link>http://www.intersoftsolutions.com/Community/ClientUI/RequiresAuthentication-cant-bind-to-property/</link><pubDate>Wed, 18 Sep 2013 00:26:38 GMT</pubDate><dc:creator>yudi</dc:creator><category>RequiresAuthentication can't bind to property</category><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I have discussed this topic with the ClientUI development team and find that the RequiresRole and RequiresAuthentication property of UXPage is not designed to be bind-able due to security reason.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Those properties need to be declared explicitly. On Silverlight, the data context will be resolved after passing through several phases. In an application which requires certain pages to authenticate against current user, it is expected to get the information regarding RequiresRole and RequiresAuthentication; then redirect the user to the login page in the early phase. If authentication process fail, the target page will not be rendered; objects inside the page will not be created; and related data (such as products data or sales data) will not be processed. User will be redirected to the login page.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;However, it might be late to obtain the information regarding RequiresRole and RequiresAuthentication if we use binding. Related data probably has been processed or objects have been created. As an alternative, you can try to use traditional approach to set those properties in code-behind of the page.&lt;/span&gt;&lt;/p&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>RequiresAuthentication can't bind to property</title><link>http://www.intersoftsolutions.com/Community/ClientUI/RequiresAuthentication-cant-bind-to-property/</link><pubDate>Tue, 17 Sep 2013 05:09:21 GMT</pubDate><dc:creator>zen8019</dc:creator><category>RequiresAuthentication can't bind to property</category><description>&lt;p&gt;Yes I can verify that the binding operation appears to work but when RequiresAuth is set to &lt;strong&gt;true&lt;/strong&gt; the page still loads under guest user!! &lt;/p&gt;&lt;pre&gt; public SearchViewModel()
        {
            RequiresAuth = true;
            RequiredRoles = Utils.GetSetting("SearchRequiredRoles");
        }&lt;/pre&gt;
&lt;p&gt;The RequiredRoles = Utils.GetSetting("SearchRequiredRoles") does however work.&lt;/p&gt;
&lt;p&gt;I await your reply, thanks&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>RequiresAuthentication can't bind to property</title><link>http://www.intersoftsolutions.com/Community/ClientUI/RequiresAuthentication-cant-bind-to-property/</link><pubDate>Thu, 12 Sep 2013 23:37:24 GMT</pubDate><dc:creator>yudi</dc:creator><category>RequiresAuthentication can't bind to property</category><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Deeply apologize for the delay in sending this.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I started my investigation by adding a Boolean property in view model.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;private bool _requiresAuth;
        
public bool RequiresAuth
{
    get
    {
        return _requiresAuth;
    }
    set
    {
        if (_requiresAuth != value)
        {
            _requiresAuth = value;
            OnPropertyChanged("RequiresAuth");
        }
    }
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Then I bind the RequiresAuthentication of UXPage to RequiresAuth in view model.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&amp;lt;Intersoft:UXPage 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    ...
    RequiresAuthentication="{Binding RequiresAuth}"
    ...&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Last, I added a breakpoint in the getter of RequiresAuth, in order to check whether this breakpoint will be invoked during binding operation or not.&lt;/span&gt;&lt;/p&gt;&lt;img style="width: 648px; height: 387px;" src="https://intersoftpt.com/Community/Attachments/3746/BindRequiresAuthentication.jpg" rgb(31,="" /&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;As shown in the above screenshot, the binding operation works.&lt;/span&gt;&lt;/p&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>RequiresAuthentication can't bind to property</title><link>http://www.intersoftsolutions.com/Community/ClientUI/RequiresAuthentication-cant-bind-to-property/</link><pubDate>Sun, 01 Sep 2013 11:18:54 GMT</pubDate><dc:creator>zen8019</dc:creator><category>RequiresAuthentication can't bind to property</category><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;This works.......&lt;b&gt;RequiresRole="{Binding RequiredRoles}"&lt;/b&gt; so I can retieve roles from user table and amend dynamically.&lt;/p&gt;
&lt;p&gt;However this...does not appear to work...&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&amp;nbsp;&lt;b&gt;RequiresAuthentication="{Binding RequiresAuthenticationProperty}"&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Can you please advise.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>