Quantcast
Channel: Caliburn.Micro: Xaml Made Easy
Viewing all articles
Browse latest Browse all 1760

Created Unassigned: Binding with Caliburn.Micro Failing [362]

$
0
0
I have a `MessageBoxView` and an associated `MessageBoxViewModel` class, as shown below

public class MessageBoxViewModel : DialogViewModel<MessageDialogResult> { ... }

where

public abstract class DialogViewModel<TResult> : PropertyChangedBase { ... }

In my `MessageBoxView` XAML I am attempting to bind to some properties within the `MessageBoxViewModel` class. However, using Snoop I can see that the binding is failing. the stack trace/binding error is showing:

>System.Windows.Data Error: 40 : BindingExpression path error: 'AffirmativeButtonText' property not found on 'object' ''ShellViewModel' (HashCode=19096940)'. BindingExpression:Path=AffirmativeButtonText; DataItem='ShellViewModel' (HashCode=19096940); target element is 'Button' (Name='AffirmativeButton'); target property is 'Content' (type 'Object')

This view is for a dialog box, so I do not want this to inherit from IScreen. How can I get Caliburn.Micro to bind to properties in the associated view model?

Thanks for your time.

Viewing all articles
Browse latest Browse all 1760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>