Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try using Josh Smith's DataContextSpy to introduce an artificial inheritance context to your DataGridColumn</p> <p><a href="http://blogs.infragistics.com/blogs/josh_smith/archive/2008/06/26/data-binding-the-isvisible-property-of-contextualtabgroup.aspx" rel="nofollow">http://blogs.infragistics.com/blogs/josh_smith/archive/2008/06/26/data-binding-the-isvisible-property-of-contextualtabgroup.aspx</a></p> <pre><code>public class DataContextSpy : Freezable // Enable ElementName and DataContext bindings { public DataContextSpy() { // This binding allows the spy to inherit a DataContext. BindingOperations.SetBinding(this, DataContextProperty, new Binding()); } public object DataContext { get { return (object)GetValue(DataContextProperty); } set { SetValue(DataContextProperty, value); } } // Borrow the DataContext dependency property from FrameworkElement. public static readonly DependencyProperty DataContextProperty = FrameworkElement.DataContextProperty.AddOwner(typeof(DataContextSpy)); protected override Freezable CreateInstanceCore() { // We are required to override this abstract method. throw new NotImplementedException(); } } </code></pre> <p>So you add one of these to the control/page/window's resource dictionary like this:</p> <pre><code>&lt;UserControl.Resources&gt; &lt;misc:DataContextSpy x:Key="Spy" /&gt; &lt;/UserControl.Resources&gt; </code></pre> <p>Now you can reference the spy through a StaticResourceExtension to get to the control/page/window's data context</p> <pre><code> Visibility="{Binding Source={StaticResource Spy}, Path=DataContext.IsOutcomesVisible}" </code></pre>
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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