Click here to Skip to main content
15,885,032 members
Articles / Desktop Programming / WPF

WPF Dialog / MessageBox Manager

Rate me:
Please Sign up or sign in to vote.
4.81/5 (31 votes)
17 Mar 2013CPOL2 min read 95.5K   7K   67  
Creating and layering message, progress and wait dialogs in WPF
<UserControl x:Class="Technewlogic.WpfDialogManagement.DialogBaseControl"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:ClassModifier="internal" x:Name="root">

	<UserControl.Resources>
		<ResourceDictionary Source="/Technewlogic.WpfDialogManagement;component/DialogContentStyle.xaml" />
	</UserControl.Resources>

	<Grid>
		<ContentControl x:Name="BackgroundImageHolder" />
		<Border DataContext="{Binding ElementName=root}" Background="#50000000" HorizontalAlignment="Stretch"
				VerticalAlignment="Stretch">
			<Grid HorizontalAlignment="{Binding HorizontalDialogAlignment}"
					VerticalAlignment="{Binding VerticalDialogAlignment}" Background="WhiteSmoke" Margin="30">
				<ContentControl Style="{StaticResource ContentStyle1}">
					<DockPanel>
						<Grid Margin="2" DockPanel.Dock="Top" Visibility="{Binding CaptionVisibility}">
							<TextBlock Margin="20,10" FontSize="25" VerticalAlignment="Center"
									HorizontalAlignment="Center" Text="{Binding Caption}" />
						</Grid>
						<UniformGrid x:Name="ButtonsGrid" DockPanel.Dock="Bottom" Margin="10"
								HorizontalAlignment="Center" />
						<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"
								Margin="2">
							<ContentControl x:Name="CustomContent" Margin="15" />
						</ScrollViewer>
					</DockPanel>
				</ContentControl>
			</Grid>
		</Border>
	</Grid>

</UserControl>

By viewing downloads associated with this article you agree to the Terms of Service 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 Code Project Open License (CPOL)


Written By
Software Developer (Senior) www.technewlogic.de
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions