Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlipView Banner only showing default value when using DataTemplate #4447

Open
JKamsker opened this issue Dec 11, 2023 · 0 comments
Open

FlipView Banner only showing default value when using DataTemplate #4447

JKamsker opened this issue Dec 11, 2023 · 0 comments
Labels
Milestone

Comments

@JKamsker
Copy link

JKamsker commented Dec 11, 2023

Describe the bug

The FlipView control in MahApps.Metro is ignoring the BannerText property of the FlipViewItem. Regardless of whether BannerText is set to an empty string, a non-empty string, or bound to a property, the text "Banner" is always displayed.

Steps to reproduce

  1. Create a new WPF project.
  2. Install the MahApps.Metro NuGet package.
  3. Add a FlipView control to the main window.
  4. Set the ItemTemplate of the FlipView to include a FlipViewItem with BannerText="", BannerText="SomeText", or BannerText="{Binding SomeProperty}".
  5. Run the project and observe that the "Banner" text is displayed, regardless of the BannerText setting.

The code in the ItemTemplate is as follows:

<mah:FlipView.ItemTemplate>
    <DataTemplate>
        <mah:FlipViewItem
            BannerText=""
            BorderThickness="0"
            Foreground="White">
            <Image
                HorizontalAlignment="Stretch"
                VerticalAlignment="Stretch"
                Source="{Binding ImageSource}"
                Stretch="Fill" />
        </mah:FlipViewItem>
    </DataTemplate>
</mah:FlipView.ItemTemplate>

Expected behavior

The FlipView control should respect the BannerText property of the FlipViewItem. The text displayed should match the value of BannerText.

Actual behavior

Regardless of the BannerText setting, the text "Banner" is always displayed.

Mitigation

Set IsBannerEnabled to false in FlipView and do it myself if i need it

Environment

MahApps.Metro version: 3.0.0-alpha0457
Windows build number: Win10 22H2 
Visual Studio: 2022 17.8.3
Target Framework: .Net 8.0-windows

Screenshots

grafik

@JKamsker JKamsker added the Bug label Dec 11, 2023
@punker76 punker76 added this to the 3.0.0 milestone Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants