xceedsoftware / wpftoolkit

All the controls missing in WPF. Over 1 million downloads.
Other
3.9k stars 878 forks source link

MessageBoxImage is not shown #1751

Open BlyZeDev opened 1 year ago

BlyZeDev commented 1 year ago

When I use this method the MessageBox shows perfectly except there is no image shown.

This is my code:

Xceed.Wpf.Toolkit.MessageBox.Show(
            "My message",
            "My caption",
            MessageBoxButton.OKCancel,
            MessageBoxImage.Error,
            MessageBoxResult.Cancel);

This is my style:

<Style TargetType="{x:Type xctk:MessageBox}">
            <Setter Property="Background" Value="{DynamicResource Background}"/>
            <Setter Property="WindowBackground" Value="{DynamicResource Text}"/>
            <Setter Property="ButtonRegionBackground" Value="{DynamicResource Background}"/>
            <Setter Property="Foreground" Value="{DynamicResource Text}"/>
            <Setter Property="CaptionForeground" Value="{DynamicResource Background}"/>
            <Setter Property="BorderThickness" Value="{StaticResource BorderThickness}"/>
            <Setter Property="BorderBrush" Value="{DynamicResource Text}"/>
            <Setter Property="CancelButtonStyle" Value="{StaticResource ButtonStyle}"/>
            <Setter Property="OkButtonStyle" Value="{StaticResource ButtonStyle}"/>
            <Setter Property="CancelButtonContent" Value="Close"/>
            <Setter Property="OkButtonContent" Value="Okay"/>
            <Setter Property="CloseButtonStyle" Value="{StaticResource CloseButtonStyle}"/>
            <Setter Property="WindowBorderThickness" Value="{StaticResource BorderThickness}"/>
            <Setter Property="WindowBorderBrush" Value="{DynamicResource Background}"/>
        </Style>
XceedDanP commented 1 year ago

Sorry, I can't seem to reproduce this in a simpler case (I don't have your details about your dynamic resources)

Have you commented out the setters to see if anything there might be interfering?


From: Leon Schimmel @.> Sent: Saturday, June 3, 2023 5:22 PM To: xceedsoftware/wpftoolkit @.> Cc: Subscribed @.***> Subject: [xceedsoftware/wpftoolkit] MessageBoxImage is not shown (Issue #1751)

When I use this method the MessageBox shows perfectly except there is no image shown.

This is my code:

Xceed.Wpf.Toolkit.MessageBox.Show( "My message", "My caption", MessageBoxButton.OKCancel, MessageBoxImage.Error, MessageBoxResult.Cancel);

This is my style

— Reply to this email directly, view it on GitHubhttps://github.com/xceedsoftware/wpftoolkit/issues/1751, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7M3JW53P6CZ2FZKOAQHLCLXJOTIFANCNFSM6AAAAAAYZQLNT4. You are receiving this because you are subscribed to this thread.Message ID: @.***>

BlyZeDev commented 1 year ago

Sorry, I can't seem to reproduce this in a simpler case (I don't have your details about your dynamic resources) Have you commented out the setters to see if anything there might be interfering? ____ From: Leon Schimmel @.> Sent: Saturday, June 3, 2023 5:22 PM To: xceedsoftware/wpftoolkit @.> Cc: Subscribed @.> Subject: [xceedsoftware/wpftoolkit] MessageBoxImage is not shown (Issue #1751) When I use this method the MessageBox shows perfectly except there is no image shown. This is my code: Xceed.Wpf.Toolkit.MessageBox.Show( "My message", "My caption", MessageBoxButton.OKCancel, MessageBoxImage.Error, MessageBoxResult.Cancel); This is my style — Reply to this email directly, view it on GitHub<#1751>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7M3JW53P6CZ2FZKOAQHLCLXJOTIFANCNFSM6AAAAAAYZQLNT4. You are receiving this because you are subscribed to this thread.Message ID: @.>

It doesn't even work when no Style is applied.

XceedDanP commented 1 year ago

Are you saying that the image to the left of the text is not showing for you in any situation? Can you provide more details, like release version of the toolkit (or day you downloaded it), .Net version, any other styles you might have applied, whether it works in a clean project, and anything else that might help me debug this?

Thanks


From: Leon Schimmel @.> Sent: Friday, June 9, 2023 2:53 PM To: xceedsoftware/wpftoolkit @.> Cc: Daniel Prevost @.>; Comment @.> Subject: Re: [xceedsoftware/wpftoolkit] MessageBoxImage is not shown (Issue #1751)

Sorry, I can't seem to reproduce this in a simpler case (I don't have your details about your dynamic resources) Have you commented out the setters to see if anything there might be interfering? … ____ From: Leon Schimmel @.> Sent: Saturday, June 3, 2023 5:22 PM To: xceedsoftware/wpftoolkit @.> Cc: Subscribed @.> Subject: [xceedsoftware/wpftoolkit] MessageBoxImage is not shown (Issue #1751https://github.com/xceedsoftware/wpftoolkit/issues/1751) When I use this method the MessageBox shows perfectly except there is no image shown. This is my code: Xceed.Wpf.Toolkit.MessageBox.Show( "My message", "My caption", MessageBoxButton.OKCancel, MessageBoxImage.Error, MessageBoxResult.Cancel); This is my style — Reply to this email directly, view it on GitHub<#1751https://github.com/xceedsoftware/wpftoolkit/issues/1751>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7M3JW53P6CZ2FZKOAQHLCLXJOTIFANCNFSM6AAAAAAYZQLNT4. You are receiving this because you are subscribed to this thread.Message ID: @.>

It doesn't even work when no Style is applied.

— Reply to this email directly, view it on GitHubhttps://github.com/xceedsoftware/wpftoolkit/issues/1751#issuecomment-1585005745, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7M3JW5BXXOCWGDL5WCZPJTXKNWJJANCNFSM6AAAAAAYZQLNT4. You are receiving this because you commented.Message ID: @.***>

BlyZeDev commented 1 year ago

Its not showing in any situation. I'm using Version 4.5.0 of the Extended.Wpf.Toolkit I'm using .NET 7 There is no other style applied. It doesn't work in a clean project too.

BlyZeDev commented 1 year ago

I'll try in .NET 6

BlyZeDev commented 1 year ago

Doesn't work in .NET 6 either

SteveA74 commented 1 year ago

I have the same issue, it seems to have been broken since V4.40 if I roll back the NuGet package to 4.3.0 it works.

In my style i have

In code i am calling Xceed.Wpf.Toolkit.MessageBox.Show("Please select an option", "Options",MessageBoxButton.OK,MessageBoxImage.Information);

I am running this in a WPF C# .NET6 project.

XceedBoucherS commented 1 year ago

Hi,

You are right. This doesn't work in .NET5+. It currently only works in .NETFramework. It will be fixed in v4.6.

In the meantime, if you have the source code, you can go in file Xceed.Wpf.Toolkit/MessageBox/Implementation/MessageBox.cs, in method : SetImageSource( MessageBoxImage image ) Replace: this.ImageSource = new BitmapImage( new Uri( String.Format( "/Xceed.Wpf.Toolkit;component/MessageBox/Icons/{0}", iconName ), UriKind.RelativeOrAbsolute ) ); with this.ImageSource = new BitmapImage( new Uri( String.Format( "/Xceed.Wpf.Toolkit.NET5;component/MessageBox/Icons/{0}", iconName ), UriKind.RelativeOrAbsolute ) );

Thank you