I'm brand new to Caliburn.Micro, so I'm hoping somebody might be able to help me here :). Apologies, posted this first to StackOverflow before I saw this Issue Tracker: http://stackoverflow.com/questions/13732657/using-messagebinder-specialvalues-in-windows-8-app-not-working
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 :).
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 :).