Note that there are some explanatory texts on larger screens.

plurals
  1. PODoes a bindable property instantiate a popup control?
    primarykey
    data
    text
    <p>I have got a MainPage and a DetailPage. Both of them use a static class to receive their data. This class called DataService implements INotifyPropertyChanged interface and it implements a property called "IsLoading". Whenever a method within the DataService is invoked I set IsLoading to true. The DataService itself is contained in a static class called Globals which instantiances the DataService one (I know, I'm going to implement this with a singleton pattern)</p> <p>On the MainPage their is a popup:</p> <pre><code>&lt;Page.Resources&gt; &lt;Common:DataService x:Key="DataService" /&gt; &lt;/Page.Resources&gt; &lt;Popup IsOpen="{Binding IsLoading}" DataContext="{StaticResource DataService}"&gt;...&lt;/PopUp&gt; </code></pre> <p>On the MainPage everything works fine. If the DataService requests something from the webservice, the popup is shown. If it is done, the popup hides.</p> <p>If I change with <code>Frame.Navigate(typeof(DetailPage));</code> and the DetailPage begins to invoke some methods of the dataservice, the popup is shown too, but not on the same page on as the main page. It will be display on the left top corner.</p> <p>Funny part about that is: If I go back to the MainPage and it loads data, I'll get two popups. If I go again to the DetailPage, a <strong>third</strong> popup will be there and so on. It seems that this popup gets instantiated?!</p> <p>Next point: When setting the DataContext of the Popup in <code>OnNavigatingTo</code> and removing the DataContext in <code>OnNavigatingFrom</code> I'll stay with the popup I want and no second one gets instantiated.</p> <p>What goes wrong here?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload