Skip to content

ColorCanvas has 14 Binding Expression ErrorsΒ #4019

Closed

Description

@nzain

Describe the bug

Using the MahApps ColorCanvas results in 14 binding expressions errors when the control is displayed. VS2019 shows them in the new XAML Binding Failures tool (Debug > Windows > XAML Binding Failures). Alternatively, you add a TraceListener via PresentationTraceSources.DataBindingSource (this is what we use during development to avoid binding errors).

Steps to reproduce

Create a new WPF application (I used framework, but probably doesn't matter) and use a ColorCanvas, e.g. using the sample code from the MahApps ColorPicker Documentation.

<Window x:Class="MahAppsDemo.MainWindow"
        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:MahAppsDemo"
        xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <mah:ColorCanvas x:Name="ColorCanvasExample"
                         SelectedColor="Blue"
                         DefaultColor="Transparent"
                         LabelAlphaChannel="Alpha"
                         LabelBlueChannel="Blue"
                         LabelGreenChannel="Green"
                         LabelRedChannel="Red" />
    </Grid>
</Window>

Expected behavior

No binding expression errors occur.

Actual behavior

14 binding expressions errors show up (see screenshot below). Using a TraceListener in combination with Debugger.Break(); calls completely kills the development experience.

Environment

MahApps.Metro version: v2.4.3
Windows build number: Win10 2004
Visual Studio: 2019 16.8.3
Target Framework: v4.7.2

Screenshots

image

Activity

  1. timunie commented on Jan 8, 2021

    @timunie
    Collaborator

    @punker76 can you assign me to this issue?

  2. added this to the 2.4.4 milestone on Jan 8, 2021
  3. added 2 commits that reference this issue on Feb 25, 2021
  4. added 2 commits that reference this issue on Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions