© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•15mo ago•
2 replies
nathanAjacobs

WPF - Custom Control Help

See attached files, the template binding to FlyoutDirection is not working. I am getting this exception:

System.Windows.Markup.XamlParseException
  HResult=0x80131501
  Message='Set property 'System.Windows.Condition.Binding' threw an exception.' Line number '46' and line position '34'.
  Source=<Cannot evaluate the exception source>
  StackTrace:
<Cannot evaluate the exception stack trace>

  This exception was originally thrown at this call stack:
    [External Code]

Inner Exception 1:
InvalidCastException: Unable to cast object of type 'System.Windows.TemplateBindingExpression' to type 'System.Windows.Data.BindingBase'.
System.Windows.Markup.XamlParseException
  HResult=0x80131501
  Message='Set property 'System.Windows.Condition.Binding' threw an exception.' Line number '46' and line position '34'.
  Source=<Cannot evaluate the exception source>
  StackTrace:
<Cannot evaluate the exception stack trace>

  This exception was originally thrown at this call stack:
    [External Code]

Inner Exception 1:
InvalidCastException: Unable to cast object of type 'System.Windows.TemplateBindingExpression' to type 'System.Windows.Data.BindingBase'.
ContextMenuFlyout.xaml5.32KB
ContextMenuFlyout.xaml.cs860B
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Extending custom WPF control
C#CC# / help
3y ago
Host custom control with handle in WPF or WinUI?
C#CC# / help
4y ago
Custom Control WPF - Combobox with search bar and listview
C#CC# / help
4y ago
Custom ToggleButon WPF
C#CC# / help
2y ago