我不知道为什么,但是我的模态窗口变得模糊了。不知道是什么原因造成的,这让我很沮丧。在进行此操作时,我没有注意到这一点(我想我应该会发现),突然间,我想,这是上帝的名义...
令人惊讶的是,它仅发生在模态中,而不发生在主窗口中,因此它一定是我更改过的东西。我已经检查过我没有模糊的效果,以防万一我不经意地激活了它,并且不知道还有什么可能导致这种情况。如您在图像中所见,我应用的唯一效果是dropShadow。
以下是其外观的图片: blurry modal
图片的质量似乎还不够好,但是无论如何您都可以看到模态比背景(主窗口)模糊得多。
正如您在另一幅图中所看到的,在设计窗口中它并没有显示模糊,以防万一这可能有所帮助。 not blurry in design window
可能是什么原因引起的?
编辑:顺便说一句,您在第一个图像中看到的内容(不是在设计窗口中)以编程方式放置在那里。
<Window x:Class="CholaYTD.WpfMBFin"
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:local="clr-namespace:CholaYTD"
mc:Ignorable="d"
Title="WpfMBFin" Height="275" Width="400" ResizeMode="NoResize" ShowInTaskbar="False" WindowStartupLocation="CenterScreen" WindowStyle="None" Background="{x:Null}" Foreground="#FFEBF3FA" AllowsTransparency="True" SnapsToDevicePixels="True">
<Border BorderThickness="1" BorderBrush="#000000" CornerRadius="25" Background="#2F3138" VerticalAlignment="Center" HorizontalAlignment="Center" >
<Border.Effect>
<DropShadowEffect Opacity="0.8"/>
</Border.Effect>
<DockPanel MinWidth="375" MinHeight="100" Height="250" HorizontalAlignment="Center" VerticalAlignment="Top">
<StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center" VerticalAlignment="Top" >
<!-- Titulo -->
<Label Content="DESCARGAS FINALIZADAS" HorizontalAlignment="Center" Margin="0 15 0 0" Foreground="#FFEBF3FA" FontFamily="Berlin Sans FB"
FontSize="20" />
<!-- Descripcion -->
<Label Content="Las descargas finalizaron con éxito." HorizontalAlignment="Center" Margin="0 5 0 0" Foreground="#FFEBF3FA"
FontFamily="Berlin Sans FB" FontSize="16" />
<!-- Descripcion fallidas -->
<!--<Label Content="Las descargas finalizaron con éxito." HorizontalAlignment="Center" Margin="0 0 0 0"
Foreground="#FFEBF3FA" FontFamily="Berlin Sans FB" FontSize="16" />-->
<!-- Enlaces -->
<TextBlock Name="textBox_enlaces" HorizontalAlignment="Center" Margin="0 0 0 0" Foreground="#FFEBF3FA" FontFamily="Berlin Sans FB" FontSize="16" >
</TextBlock>
</StackPanel>
<!-- Boton OK -->
<StackPanel Name="stackPanelCerrar" DockPanel.Dock="Bottom" Height="35" Width="60" VerticalAlignment="Bottom" Margin="0 0 0 10">
<Border Name="borderCerrar" BorderThickness="1" BorderBrush="#000000" CornerRadius="15" Background="#9FBED1" MouseDown="Border_MouseDown" MouseEnter="Border_MouseEnter" MouseLeave="Border_MouseLeave" Cursor="Hand" >
<Label Name="labelCerrar" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontFamily="Berlin Sans FB" FontSize="20" Foreground="#2F3138" >
OK
</Label>
</Border>
</StackPanel>
</DockPanel>
</Border>
public partial class WpfMBFin : Window
{
private List<string> listaEnlaces;
public WpfMBFin(List<string> failedList)
{
listaEnlaces = failedList;
InitializeComponent();
// declaramos la venata principal como padre de esta ventana
this.Owner = App.Current.MainWindow;
crearEnlaces();
}
private void crearEnlaces()
{
string youtubeURLStarting = "https://www.youtube.com/watch?v=";
string textoFinalEnlaces = "Sin embargo, ";
if (listaEnlaces.Count < 2)
{
textoFinalEnlaces += "el siguiente video no estaba disponible:\n";
Hyperlink hLink = new Hyperlink();
hLink.NavigateUri = new Uri(youtubeURLStarting + listaEnlaces.ElementAt(0));
hLink.RequestNavigate += new System.Windows.Navigation.RequestNavigateEventHandler(Hyperlink_RequestNavigate);
hLink.Inlines.Add(youtubeURLStarting + listaEnlaces.ElementAt(0));
textBox_enlaces.Inlines.Add(textoFinalEnlaces);
textBox_enlaces.Inlines.Add(hLink);
}
else
{
textoFinalEnlaces += "los siguientes videos no estaban disponibles:\n";
foreach (string link in listaEnlaces)
{
textoFinalEnlaces += "\n" + youtubeURLStarting + link;
}
}
}
// HANDLER de Hyperlinks
private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
{
System.Diagnostics.Process.Start(e.Uri.AbsoluteUri);
}
// EFECTO BOTON
private void Border_MouseDown(object sender, MouseButtonEventArgs e)
{
this.Close();
}
private void Border_MouseEnter(object sender, MouseEventArgs e)
{
stackPanelCerrar.Height = 36;
stackPanelCerrar.Width = 62;
borderCerrar.BorderBrush = (Brush)(new BrushConverter().ConvertFrom("#EBF3FA"));
borderCerrar.BorderThickness = (new Thickness(2, 2, 2, 2));
borderCerrar.Background = (Brush)(new BrushConverter().ConvertFrom("#EBF3FA"));
labelCerrar.Foreground = (Brush)(new BrushConverter().ConvertFrom("#2F3138"));
}
private void Border_MouseLeave(object sender, MouseEventArgs e)
{
stackPanelCerrar.Height = 35;
stackPanelCerrar.Width = 60;
borderCerrar.BorderBrush = Brushes.Black;
borderCerrar.BorderThickness = (new Thickness(1, 1, 1, 1));
borderCerrar.Background = (Brush)(new BrushConverter().ConvertFrom("#9FBED1"));
labelCerrar.Foreground = (Brush)(new BrushConverter().ConvertFrom("#2F3138"));
}
}