How to remove shadow of ContentDialog in UWP?
Please check Z-depth and shadow document.
ThemeShadow automatically casts shadows when applied to any XAML element in a Popup. It will cast shadows on the app background content behind it and any other open Popups below it.
If you want to disable it, the better way is that set Container
a new Translation
in loaded event, and make z value as low enough.
For example: (place the style of ContentDialog in the page resource and give it new name MyContentDialog
).
var diaog = new ContentDialog() { Title = "hello world!",Style= (Style)Resources["MyContentDialog"] ,SecondaryButtonText="ok"};
await diaog.ShowAsync();
Set the new Translation.
private void Container_Loaded(object sender, RoutedEventArgs e)
{
var border = sender as Border;
border.Translation = new Vector3(0, 0, -100);
}