After reading the question, I found it interesting my selves to investigate possibilities and share my founds as the answer.
As you tagged your question with C#, my solution will be based on C#. By and btw I was not able to find the default api to do the job, if other finds a solution with an example I will be happy to vote for it.
I started with the UWP solution and created a very simple information dialog using ContentDialog
. Create a UWP project and add the following code:
private async void ShowMessage()
{
ContentDialog dialog = new ContentDialog
{
Title = "Title",
Content = "Content text",
Width = 200,
Height = 600,
Background = new SolidColorBrush(Colors.CornflowerBlue),
Foreground = new SolidColorBrush(Colors.White),
BorderThickness = new Thickness(1),
BorderBrush = new SolidColorBrush(Colors.White),
CloseButtonText = "Close",
};
await dialog.ShowAsync();
}
public MainPage()
{
this.InitializeComponent();
ShowMessage();
}
This will create something like

But that content dialog appears as a part of the application and not the windows system as I tried to solve.
Adding the following lines before the ShowMessage method will maximize application to the whole background of the screen.
ApplicationView.GetForCurrentView().SuppressSystemOverlays = true;
ApplicationView.GetForCurrentView().FullScreenSystemOverlayMode = FullScreenSystemOverlayMode.Minimal;
ApplicationView.GetForCurrentView().TryEnterFullScreenMode();
But IMO it is not the best solution. I thought, there might be another way, I tried with WPF instead.
I created a WPF project, my strategy was to start MainWindow in minimized mode and the content dialog to appear. Hence there is no content dialog in WPF like UWP, I created something similar (look and feel).
Here is the code in my MainWindow
private readonly string _title;
private readonly string _message;
public MainWindow()
{
_title = "Updates are available";
_message = "Required updates need to be downloaded.";
InitializeComponent();
string[]? args = App.Args;
if (args != null && args.Length > 0)
{
_title = args[0];
_message = args[1];
}
MinimizedMainWindow();
ShowContentDialog();
}
protected void MinimizedMainWindow()
{
AllowsTransparency = true;
WindowStyle = WindowStyle.None;
WindowState = WindowState.Maximized;
Background = Brushes.Transparent;
Topmost = true;
}
public void ShowContentDialog()
{
ContentDialog dialog = new ContentDialog
{
Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF0066CC")),
Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFFFFFFF")),
WindowStartupLocation = WindowStartupLocation.CenterScreen,
SizeToContent = SizeToContent.WidthAndHeight,
WindowStyle = WindowStyle.None,
Padding = new Thickness(20),
Margin = new Thickness(0),
ResizeMode = ResizeMode.NoResize,
Width = 600,
Height = 200,
Title = { Text = _title },
Message = { Text = _message }
};
dialog.Show();
}
And here is my ContentDialog.xaml
<Window x:Class="NotificationSol.ContentDialog"
xmlns:local="clr-namespace:NotificationSol"
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:av="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
Title="ContentDialog"
av:DesignWidth="600"
av:DesignHeight="200"
>
<Grid>
<TextBlock x:Name="Title" Margin="30,22,30,118" TextWrapping="Wrap" Text="Title" FontSize="28"/>
<TextBlock x:Name="Message" Margin="30,70,30,70" TextWrapping="Wrap" Text="Content" FontSize="16"/>
<Button x:Name="Button" Click="CloseButton_Click" Content="Close" HorizontalAlignment="Right" Margin="0,0,30,20" VerticalAlignment="Bottom" Width="75" Background="#FF0066CC" BorderBrush="White" Foreground="White" Padding="8,4"/>
</Grid>
</Window>
And ContentDialog.xaml.cs
public ContentDialog()
{
InitializeComponent();
}
private void CloseButton_Click(object sender, RoutedEventArgs e)
{
Close();
base.OnClosed(e);
Application.Current.Shutdown();
}
To let my application take parameters in the command line, I made the following changes to App.xaml.cs:
public static string[]? Args;
void AppStartup(object sender, StartupEventArgs e)
{
if (e.Args.Length > 0)
{
Args = e.Args;
}
}
And to App.xaml adding as the startup
<Application x:Class="NotificationSol.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:NotificationSol"
StartupUri="MainWindow.xaml"
Startup="AppStartup">
<Application.Resources>
</Application.Resources>
</Application>
Running this code from the visual studio I get the:

If you run the software with 2 parameters from the command line, you can pass the title and the message. You have the code, where you can create other method actions or buttons with other features. Right now my button is just closing the dialog box and the application. Here I have put both examples on my repo:
https://github.com/maythamfahmi/BlogExamples/tree/master/Stackoverflow/ContentDialog