Click here to Skip to main content
Click here to Skip to main content

WPF Modal Dialog

By , 17 Mar 2013
 
<UserControl x:Class="Technewlogic.Samples.WpfModalDialog.ModalDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	x:Name="root">

	<Grid DataContext="{Binding ElementName=root}">
		<Border Background="#90000000" Visibility="{Binding Visibility}">
			<Border BorderBrush="Black" BorderThickness="1" Background="AliceBlue" 
					CornerRadius="10,0,10,0" VerticalAlignment="Center"
					HorizontalAlignment="Center">
				<Border.BitmapEffect>
					<DropShadowBitmapEffect Color="Black" Opacity="0.5" Direction="270" ShadowDepth="0.7" />
				</Border.BitmapEffect>
				<Grid Margin="10">
					<Grid.RowDefinitions>
						<RowDefinition />
						<RowDefinition Height="Auto" />
					</Grid.RowDefinitions>
					<TextBlock x:Name="MessageTextBlock" Text="{Binding Message}" TextWrapping="Wrap" Margin="5" />
					<UniformGrid Grid.Row="1" Margin="5" Columns="2" HorizontalAlignment="Center"
								 VerticalAlignment="Bottom">
						<Button x:Name="OkButton" Click="OkButton_Click" Content="Ok" Margin="2"  />
						<Button x:Name="CancelButton" Click="CancelButton_Click" Content="Cancel" Margin="2" />
					</UniformGrid>
				</Grid>
			</Border>
		</Border>
	</Grid>
	
</UserControl>

By viewing downloads associated with this article you agree to the Terms of use and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)

About the Author

Ronald Schlenker
Software Developer (Senior) www.technewlogic.de
Germany Germany
Member
No Biography provided

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 18 Mar 2013
Article Copyright 2009 by Ronald Schlenker
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid