I'm brand new to Caliburn.Micro, so I'm hoping somebody might be able to help me here :).
I'm trying to use MessageBinder.SpecialValues in my Windows 8 app, but I can't get it to work. I'm adding a new "$pointerPercentage" to know the percentage (float between 0.0 and 1.0) of how far the mouse is positioned within an element (for a music keyboard in my synthesizer app). Everything else is currently working (so I believe I have Caliburn.Micro wired up properly).
I've added the following to the Configure method of my App.xaml.cs:
protected override void Configure()
{
container = new WinRTContainer();
container.RegisterWinRTServices();
MessageBinder.SpecialValues.Add("$pointerPercentage", ctx =>
{
return 1.0f;
});
}
Then I'm using it from a PointerMoved event within a Canvas element:
<Canvas x:Name="keyCanvas" Background="#338B8BDC"
cal:Message.Attach="[Event PointerMoved] = [Action UpdateKeyboard($pointerPercentage)]" />
The UpdateKeyboard method in my ViewModel does get fired (I break into it with a debugger), but the parameter passed in is always 0.0f (not 1.0f as set in the SpecialValues code above).
What am I doing wrong? Any help would be appreciated :).
Configure
? I've not usedSpecialValues
myself but what about the dollar, I know CM uses the dollar sign to signify a special value but does it need it when configuring one? Let me have a look at CM source... – Kishakishinev