Note that there are some explanatory texts on larger screens.

plurals
  1. POGridSplitter overrides ColumnDefinition's style trigger?
    primarykey
    data
    text
    <p>I ran into a strange issue...<br> It looks like resizing Grid's columns using a GridSplitter disables (or otherwise deactivates) the trigger defined on a Grid's column.</p> <p>Here's my setup:</p> <p>A Grid has 3 columns, defined as follows:</p> <pre><code>&lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="*" /&gt; &lt;ColumnDefinition&gt; &lt;ColumnDefinition.Style&gt; &lt;Style&gt; &lt;Setter Property="ColumnDefinition.Width" Value="Auto"/&gt; &lt;Style.Triggers&gt; &lt;DataTrigger Binding="{Binding Path=OpenItemViewModels.Count}" Value="0"&gt; &lt;Setter Property="ColumnDefinition.Width" Value="0"/&gt; &lt;/DataTrigger&gt; &lt;/Style.Triggers&gt; &lt;/Style&gt; &lt;/ColumnDefinition.Style&gt; &lt;/ColumnDefinition&gt; &lt;ColumnDefinition&gt; &lt;ColumnDefinition.Style&gt; &lt;Style&gt; &lt;Setter Property="ColumnDefinition.Width" Value="4*"/&gt; &lt;Style.Triggers&gt; &lt;DataTrigger Binding="{Binding Path=OpenItemViewModels.Count}" Value="0"&gt; &lt;Setter Property="ColumnDefinition.Width" Value="0"/&gt; &lt;/DataTrigger&gt; &lt;/Style.Triggers&gt; &lt;/Style&gt; &lt;/ColumnDefinition.Style&gt; &lt;/ColumnDefinition&gt; &lt;/Grid.ColumnDefinitions&gt; </code></pre> <p>The expectation is that when there are no items that constitute ItemsSource for the control in the <em>third</em> column, 0 width will be assigned to the second and third columns (hosting the GridSplitter and the auxiliary items control, respectively). </p> <p>This works well as long as I don't touch the Splitter (when all the tabs in the auxiliary control are closed, only the first column remains visible).<br> The problems start if I move the splitter, thus effectively changing the proportion between columns ##0 and 2. In such scenario, these columns' width is not reset when all the items in the right-hand control are closed. </p> <p>I suspect this has something to do with the GridSplitter "overruling" my definitions in XAML.</p> <p>Can someone please confirm / disprove this theory, and suggest how to work around the problem?</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