Skip to content

Commit

Permalink
Fix possible System.Windows.Data warning for ComboBoxItem, if a Combo…
Browse files Browse the repository at this point in the history
…Box is inside a ContentControl.

  System.Windows.Data Warning: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ComboBox', AncestorLevel='1''. BindingExpression:Path=(0); DataItem=null; target element is 'ComboBoxItem' (Name=''); target property is 'ClearTypeHint' (type 'ClearTypeHint')
  • Loading branch information
punker76 committed Aug 30, 2017
1 parent 6c936c2 commit 44c2363
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,6 @@
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="MinHeight" Value="22" />
<Setter Property="Padding" Value="2" />
<Setter Property="RenderOptions.ClearTypeHint" Value="{Binding Path=(RenderOptions.ClearTypeHint), Mode=OneWay, FallbackValue=Auto, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ComboBox}}}" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
Expand Down Expand Up @@ -643,6 +642,11 @@
</Setter.Value>
</Setter>
<Setter Property="VerticalContentAlignment" Value="Center" />
<Style.Triggers>
<Trigger Property="IsVisible" Value="True">
<Setter Property="RenderOptions.ClearTypeHint" Value="{Binding Path=(RenderOptions.ClearTypeHint), FallbackValue=Auto, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ComboBox}}}" />
</Trigger>
</Style.Triggers>
</Style>

</ResourceDictionary>
Expand Down

0 comments on commit 44c2363

Please sign in to comment.