Further API differences I ran into:
Caliburn is trying to hook into the
FrameworkElement.Loaded and
FrameworkElement.Unloaded events. In WPF both are events based on a
RoutedEventHandler.
Noesis used their own event handlers called
FrameworkElement.LoadedHandler and
FrameworkElement.UnloadedHandler
Additional to this, I cannot create a
RoutedEventArgs instance. I'm suspecting this code will not work correctly, based on an earlier answer?
#if NOESIS
handler(element, new RoutedEventArgs(element, new RoutedEvent("Loaded")));
#else
// This is the original Caliburn code for WPF. The Noesis version of RoutedEventArgs does not have a parameterless constructor.
// So I'm not sure what I should call the handler with.
handler(element, new RoutedEventArgs());
#endif
Also as discussed somewhere on this forums before, the
LayoutUpdated event is missing.
On the
TriggerBase class the
Actions Property is missing. It should return a
TriggerActionCollection.
The
EventTrigger class is missing the
EventName property. How do I reproduce this in Noesis?
new EventTrigger { EventName = triggerDetail };
I only see a "RoutedEvent" property, but if I put a new event on that, that will again not be semantically the same as the code above, correct?
The
IAttachedObject interface is missing completely.
var allTriggers = Interaction.GetTriggers(d);
does not work since the GetTriggers() method is missing from the Interaction class. (d is a DependencyObject)
Is there a way to retrieve the triggers any other way?
Caliburn.Micro for WPF uses the code
var childCount = (current is Visual || current is Visual3D)
? VisualTreeHelper.GetChildrenCount(current) : 0;
I found the
Visual3D type does not exist in Noesis, probably on purpose so I left that second is-check away for Noesis.
The
VisualTreeHelper.GetParent()
method expects a
DependencyObject in WPF as a parameter. In noesis it expects a
Visual.
Should I simply cast it? Does that work? If WPF uses it in this way I expect the type in this context to be a
Visual?
Minor but I want to mention it anyway, the
AttachedPropertyBrowsableForTypeAttribute is missing.
The biggest issues probably are that the
DependencyObjectCollection as well as the
TriggerAction<> generic type are entirely missing.
And finally,
ItemCollection does not implement the
IEnumerable interface. Which is a problem when trying to use LINQ on it. I need to implement the LINQ operators specifically for this type if I want to use it. From what I can see it correctly implements the interface already (it does have the
GetEnumerator() method), it just doesn't DECLARE that it is an
IEnumerable. Could that be added?
From what I can see those are the main issues.
Oh yeah, one big issue is of course that in the absense of both
XamlReader and
FrameworkElementFactory types, there's seemingly no way to create a
DataTemplate in code. Any suggestions on that?