2012-05-19

Articles

WindowTitleBarBehavior

 

The WPF window has no properties for removing or disabe the minimize, maximize and close buttons. You have to manipulate the window directly in the WinApi. With this behavior you have a direct access to it. Just attach it and define which buttons should be disabled.

 

alt

 

Usage

<Window x:Class="DW.Interactivity.Demo.NoIconsWindow"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:Interactivity="http://schemas.my-libraries.de/wpf/interactivity"
		Interactivity:WindowTitleBarBehavior.RemoveTitleItems="True"
		Title="No Icons"
		Height="300"
		Width="300">
	<Grid>
		<Button Content="Close" VerticalAlignment="Bottom" HorizontalAlignment="Right" Click="Button_Click" />
	</Grid>
</Window>