wpftoolkit icon indicating copy to clipboard operation
wpftoolkit copied to clipboard

MessageBoxImage is not shown

Open BlyZeDev opened this issue 1 year ago • 8 comments

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>

BlyZeDev avatar Jun 03 '23 21:06 BlyZeDev

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: @.***>

XceedDanP avatar Jun 09 '23 18:06 XceedDanP

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 <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="Open GitHub issue"/> <Setter Property="CloseButtonStyle" Value="{StaticResource CloseButtonStyle}"/> <Setter Property="WindowBorderThickness" Value="{StaticResource BorderThickness}"/> <Setter Property="WindowBorderBrush" Value="{DynamicResource Background}"/> </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.

BlyZeDev avatar Jun 09 '23 18:06 BlyZeDev

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 <Style TargetType="{x:Type xctk:MessageBox}"> </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: @.***>

XceedDanP avatar Jun 09 '23 19:06 XceedDanP

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 avatar Jun 09 '23 19:06 BlyZeDev

I'll try in .NET 6

BlyZeDev avatar Jun 09 '23 19:06 BlyZeDev

Doesn't work in .NET 6 either

BlyZeDev avatar Jun 09 '23 19:06 BlyZeDev

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.

SteveA74 avatar Jul 19 '23 11:07 SteveA74

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

XceedBoucherS avatar Aug 07 '23 15:08 XceedBoucherS