MessageBoxImage is not shown

Open
#1,751 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
desktop

Research direction

Start with the Xceed.Wpf.Toolkit.MessageBox.Show call and the Style targeting xctk:MessageBox, then trace how MessageBoxImage.Error is rendered with the supplied style. Reproduce the missing-image behavior using the posted C# and XAML, and consider the issue done when the error image is visible without breaking the customized message box appearance.

Written by the indexing model from the issue text.

Description

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>
Dominant language
C#
Stars
4.2k
Forks
912
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from xceedsoftware/wpftoolkit

All issues in xceedsoftware/wpftoolkit

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.