Esempio n. 1
0
 private void AddViewObservers()
 {
     _observer      = new KVOObserver();
     _kvoController = FBKVOController.ControllerWithObserver(_observer);
     _kvoController.Observe(View, "frame", NSKeyValueObservingOptions.OldNew, CallbackFromKVO);
     _kvoController.Observe(View.Layer, "bounds", NSKeyValueObservingOptions.OldNew, CallbackFromKVO);
 }
Esempio n. 2
0
        private void RemoveViewObservers()
        {
            if (_kvoController != null)
            {
                _kvoController.UnobserveAll();
                _kvoController.Dispose();
                _kvoController = null;
            }

            if (_observer != null)
            {
                _observer.Dispose();
                _observer = null;
            }
        }
Esempio n. 3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.
            PlayItem = new UIBarButtonItem(UIBarButtonSystemItem.Play, (sender, e) => {
                DidTapPlay(PlayItem);
            });
            StopItem = new UIBarButtonItem(UIBarButtonSystemItem.Stop, (sender, e) =>
            {
                DidTapStop(StopItem);
            });
            PauseItem = new UIBarButtonItem(UIBarButtonSystemItem.Pause, (sender, e) =>
            {
                DidTapPause(PauseItem);
            });

            _KVOController = FBKVOController.ControllerWithObserver(this);

            NSNotificationCenter.DefaultCenter.AddObserver(AVPlayerItem.DidPlayToEndTimeNotification, PlayerDidPlayToEnd);
        }