Пример #1
0
        protected override void OnElementChanged(ElementChangedEventArgs <Page> e)
        {
            // Set prior to calling base
            Tracker = new BackgroundTracker <Panel>(BackgroundProperty)
            {
                Model = Element, Element = this
            };

            base.OnElementChanged(e);

            Loaded   += (sender, args) => Element.SendAppearing();
            Unloaded += (sender, args) => Element.SendDisappearing();
        }
Пример #2
0
        public void SetElement(VisualElement element)
        {
            TabbedPage oldElement = _page;

            _page    = (TabbedPage)element;
            _tracker = new BackgroundTracker <Control>(BackgroundProperty)
            {
                Model = _page, Element = this
            };

            DataContext = element;

            _page.PropertyChanged += OnPropertyChanged;

            Loaded   += (sender, args) => _page.SendAppearing();
            Unloaded += (sender, args) => _page.SendDisappearing();

            OnElementChanged(new VisualElementChangedEventArgs(_page, element));
        }
Пример #3
0
        public void SetElement(VisualElement element)
        {
            CarouselPage oldElement = _page;

            _page    = (CarouselPage)element;
            _tracker = new BackgroundTracker <Control>(BackgroundProperty)
            {
                Model = _page, Element = this
            };

            DataContext = _page;

            SelectionChanged += OnSelectionChanged;

            OnPagesChanged(_page, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));

            _page.PagesChanged    += OnPagesChanged;
            _page.PropertyChanged += OnPropertyChanged;

            Loaded   += (sender, args) => _page.SendAppearing();
            Unloaded += (sender, args) => _page.SendDisappearing();

            OnElementChanged(new VisualElementChangedEventArgs(oldElement, element));
        }