Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF trigger on UnsetValue, or how to set MinHeight if Height is not set

$
0
0

Hi,

I have searched for a while but found no solution yet.

What I would like to do:

I want to define a button style where the button has a MinHeight, when the user of the styled button did not set the Height property of that button. If the user sets the Height property in the button (not in the style) the MinHeight from the style should have no effect.

So I need something like that:

<Trigger Property="Height" Value="{x:Static DependenyProperty.UnsetValue}">

 <Setter Property="MinHeight" Value="20"/>

</Trigger>

But I have read somewhere that triggering on UnsetValue does not work. Any ideas or links?


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>