コード例 #1
0
        partial void OnApplyTemplatePartial()
        {
            var source = new ListViewBaseSource(NativePanel);

            NativePanel.Source = source;
            NativePanel.NativeLayout.Source = new WeakReference <ListViewBaseSource>(NativePanel.Source);

            BindToPanel(nameof(ItemsSource));

            NativePanel.AnimateScrollIntoView = AnimateScrollIntoView;

            var disposables = new CompositeDisposable();

            Action headerFooterCallback = () => NativePanel?.UpdateHeaderAndFooter();

            RegisterCallback(HeaderProperty, headerFooterCallback).DisposeWith(disposables);
            RegisterCallback(HeaderTemplateProperty, headerFooterCallback).DisposeWith(disposables);
            RegisterCallback(FooterProperty, headerFooterCallback).DisposeWith(disposables);
            RegisterCallback(FooterTemplateProperty, headerFooterCallback).DisposeWith(disposables);

            _callbackSubscriptions.Disposable = disposables;
        }