2025-11-28 00:35:46 +09:00

50 lines
2.7 KiB
XML

<!--
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
-->
<src:PerMonitorDPIWindow x:Class="PerMonitorAwareWPFApplication.PerMonitorAwareWPFWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:src="clr-namespace:NativeHelpers;assembly=NativeHelpers"
Title="DPIWindow" Height="400" Width="600" DPIChanged="PerMonitorDPIWindow_DPIChanged" SizeChanged="PerMonitorDPIWindow_SizeChanged" LayoutUpdated="PerMonitorDPIWindow_LayoutUpdated">
<Grid x:Name="LayoutRoot" ShowGridLines="True">
<Grid.RowDefinitions>
<RowDefinition Height="66"/>
<RowDefinition Height="*"/>
<RowDefinition Height="100"/>
<!--Zooming Row Definitions-->
<RowDefinition Height="0"/>
<RowDefinition Height="0"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="100"/>
<!--Zooming Column Definitions-->
<ColumnDefinition Width="0"/>
<ColumnDefinition Width="0"/>
</Grid.ColumnDefinitions>
<Button Content="Button" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Name="buttonTopLeft">
</Button>
<Button Content="Button" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Top" Width="100" Name="buttonTopRight">
</Button>
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Name="DPI" Grid.Row="2" Grid.Column="1" TextWrapping="WrapWithOverflow">
</TextBlock>
<Rectangle Grid.Column="1" Fill="#FFD6604E" HorizontalAlignment="Left" Height="120" Grid.Row="1" Stroke="Black" VerticalAlignment="Top" Width="120" Name="rectangleTopLeft">
</Rectangle>
<Rectangle Grid.Column="1" Fill="#FF4A4AD4" HorizontalAlignment="Right" Height="160" Grid.Row="1" Stroke="Black" VerticalAlignment="Top" Width="160" Name="rectangleTopRight">
</Rectangle>
<Rectangle Grid.Column="1" Fill="#FF81B098" HorizontalAlignment="Center" VerticalAlignment="Bottom" Height="120" Grid.Row="1" Stroke="Black" Width="120" Name="rectangleMiddle">
</Rectangle>
</Grid>
</src:PerMonitorDPIWindow>