Allow only OneWayToSource binding mode
<p>I have <code>EntitiesUserControl</code> responsible for <code>EntitiesCount</code> dependency property:  </p>

<pre><code>public static readonly DependencyProperty EntitiesCountProperty = DependencyProperty.Register(
    nameof(EntitiesCount),
    typeof(int),
    typeof(EntitiesUserControl),
    new FrameworkPropertyMetadata(1, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));

public int EntitiesCount
{
    get { return (int)this.GetValue(EntitiesCountProperty); }
    set { this.SetValue(EntitiesCountProperty, value); }
}
</code></pre>

<p>Another (primary) control include <code>EntitiesUserControl</code> and read it property through binding:  </p>

<pre><code>&lt;controls:EntitiesUserControl EntitiesCount="{Binding CountOfEntities, Mode=OneWayToSource}" /&gt;
</code></pre>

<p><code>CountOfEntities</code> property in view model just store and process changing of count value:  </p>

<pre><code>private int countOfEntities;
public int CountOfEntities
{
    protected get { return this.countOfEntities; }
    set
    {
        this.countOfEntities = value;
        // Custom logic with new value...
    }
}
</code></pre>

<p>I need <code>EntitiesCount</code> property of <code>EntitiesUserControl</code> to be <strong>read-only</strong> (primary control must not change it, just read) and it works this way only because <code>Mode=OneWayToSource</code> declared explicitly. But if declare <code>TwoWay</code> mode or don't explicitly declare mode, then <code>EntitiesCount</code> could be rewritten from outside (at least right after binding initialization, because it happens <strong>after</strong> default dependency property value assigned).</p>

<p>I can't do 'legal' read-only dependency property due to binding limitations (best described in this <a href="https://stackoverflow.com/a/658683/5177728">answer</a>), so I need to prevent bindings with mode other than <code>OneWayToSource</code>. It would be best to have some <em>OnlyOneWayToSource</em> flag like <code>BindsTwoWayByDefault</code> value in <a href="https://msdn.microsoft.com/library/system.windows.frameworkpropertymetadataoptions%28v=vs.110%29.aspx" rel="nofollow noreferrer"><code>FrameworkPropertyMetadataOptions</code></a> enumeration...</p>

<p>Any suggestions how to achieve this?</p>