#if XFORMS namespace Caliburn.Micro.Core.Xamarin.Forms #else namespace Caliburn.Micro #endif { using System; using System.Reflection; #if WinRT81 using Windows.UI.Xaml; using TriggerBase = Microsoft.Xaml.Interactivity.IBehavior; #elif XFORMS using global::Xamarin.Forms; using DependencyObject = global::Xamarin.Forms.BindableObject; using DependencyProperty = global::Xamarin.Forms.BindableProperty; using FrameworkElement = global::Xamarin.Forms.VisualElement; #else using System.Windows; using TriggerBase = System.Windows.Interactivity.TriggerBase; #endif /// /// Represents the conventions for a particular element type. /// public class ElementConvention { /// /// The type of element to which the conventions apply. /// public Type ElementType; /// /// Gets the default property to be used in binding conventions. /// public Func GetBindableProperty; /// /// The default trigger to be used when wiring actions on this element. /// public Func CreateTrigger; /// /// The default property to be used for parameters of this type in actions. /// public string ParameterProperty; /// /// Applies custom conventions for elements of this type. /// /// Pass the view model type, property path, property instance, framework element and its convention. public Func ApplyBinding = (viewModelType, path, property, element, convention) => ConventionManager.SetBindingWithoutBindingOverwrite(viewModelType, path, property, element, convention, convention.GetBindableProperty(element)); } }