how can I set the MaxHeight Property of a Window to screen height?
XAML:
<Window x:Class="RT.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="{Binding WindowTitle}" Height="300" MaxHeight="500" Width="495.149" SizeToContent="WidthAndHeight">
In the codebehind page of your control you can set the MaxHeight of your Window to
System.Windows.SystemParameters.PrimaryScreenHeight
or you can use SystemParameters.VirtualScreenHeight
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With