기본 캡션 단추와 제목 표시 줄을 사용하여 창을 만들려고하고 있으며 여전히 창 크롬 내에 임의의 내용을 넣을 수 있습니다. 그러나, 내가 시도한 모든 솔루션 캡션 버튼 오른쪽에 약 5 단위 여백을 둡니다.정규 캡션 단추를 사용하여 비 클라이언트 영역의 내용을 올바르게 그리는 방법
<Window x:Class="SemiCustomWindowChrome.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SemiCustomWindowChrome"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525" Name="Window">
<WindowChrome.WindowChrome>
<WindowChrome UseAeroCaptionButtons="True" ResizeBorderThickness="5" GlassFrameThickness="1,28,1,1"/>
</WindowChrome.WindowChrome>
<Window.Template>
<ControlTemplate>
<AdornerDecorator>
<ContentPresenter Content="{Binding ElementName=Window, Path=Content}"/>
</AdornerDecorator>
</ControlTemplate>
</Window.Template>
<Grid>
<StackPanel Orientation="Horizontal" VerticalAlignment="Top">
<Button Content="Click me daddy!" WindowChrome.IsHitTestVisibleInChrome="True" Height="28"/>
<TextBlock Text="Custom Window Test" Margin="6.5"/>
</StackPanel>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" FontFamily="MS Calibri" FontWeight="ExtraLight" Text="Hello There"/>
</Grid>
가
위의 코드를 생성 this : 여기 기본적인 예이다.
분명히하기 위해 윈도우 크롬의 캡션 버튼 오른쪽에있는 흰색 패딩을 제거하여 다른 것과 똑같이 보이도록하고 싶습니다. 비 클라이언트 영역 (창 크롬). 모든 도움을 주시면 감사하겠습니다.
WindowChrome 요소의 사용을 포함하지 않는 DWM을 사용하는 더 안정적인 방법이 있다면 누군가가 내게 예제를 줄 수 있다면 감사하겠습니다.