Detecting the attachment of a DataContext In our application the views and the viewmodels are created in parallel to increase the performance and when the viewmodel is created it is attached to the datacontext.

While there is no datacontext the view shows an indefinite progressbar. To hide it we use the following code:

    &lt;!-- Loading background. It gets removed when the datacontext is attached --&gt;
    &lt;Border Visibility="{Binding IsDataContextLoaded, Converter={StaticResource NegatedBooleanToVisibilityConverter}, Mode=OneWay, FallbackValue=Visible}" &gt;
        &lt;views1:CircularProgressBar Visibility="Visible" /&gt;
    &lt;/Border&gt;


And the viewmodel has the following code:

    /// &lt;summary&gt;
    /// Gets a value indicating whether the datacontex has been loaded or not
    /// &lt;/summary&gt;
    /// &lt;remarks&gt;If the view can reach this property it means that the datacontext
    /// has been loaded.&lt;/remarks&gt;
    public bool IsDataContextLoaded
    {
        get
        {
            return true;
        }
    }


The solution looks a bit weird to me, any ideas that are more elegant?
If by:


  While there is no datacontext the view shows an indefinite progressbar.


You mean that the view's DataContext is null until the ViewModel is loaded, then you can simply use this:

&lt;Border Visibility="{Binding, Converter={StaticResource IsNullToVisibilityConverter}, Mode=OneWay, FallbackValue=Visible}" &gt;
    &lt;views1:CircularProgressBar Visibility="Visible" /&gt;
&lt;/Border&gt;


Which is to say, bind directly to the view model property path (which will be null until the view model is loaded) and convert a null value to mean 'Collapsed' and a non-null value to mean 'Visible'.

This removes the need for an IsLoaded boolean property per view model.

Of course, you will need to write the converter.