コード例 #1
0
ファイル: BaseQmlTests.cs プロジェクト: joachim-egger/Qml.Net
        protected BaseQmlMvvmTestsWithInstance()
        {
            InteropBehaviors.ClearQmlInteropBehaviors();
            InteropBehaviors.RegisterQmlInteropBehavior(new MvvmQmlInteropBehavior());

            RegisterType <T>();
            Instance = new T();
            TypeCreator.SetInstance(typeof(T), Instance);
        }
コード例 #2
0
 /// <summary>
 /// Activates the MVVM behavior.
 /// This Behavior automatically connects INotifyPropertyChanged instances with appropriate signals on the QML side
 /// and triggers those signals whenever the PropertyChanged event of the INotifyPropertyChanged instances is triggered.
 ///
 /// Call this before any INotifyPropertyChanged type is registered!
 /// Otherwise the behavior might not include
 /// INotifyPropertyChanged types that were registered (implicitly or explicitly) before this call
 /// </summary>
 public static void ActivateMVVMBehavior()
 {
     InteropBehaviors.RegisterQmlInteropBehavior(new MvvmQmlInteropBehavior(), false);
 }