コード例 #1
0
        protected override Control CreatePresenter()
        {
            _timePickerPresenter = new TimePickerFlyoutPresenter()
            {
                Content = Content
            };

            void onLoad(object sender, RoutedEventArgs e)
            {
                _headerUntapZone = _timePickerPresenter?.FindName("HeaderUntapableZone") as FrameworkElement;

                AttachAcceptCommand(_timePickerPresenter);
                AttachDismissCommand(_timePickerPresenter);

                _onLoad.Disposable = null;
            }

            void onUnload(object sender, RoutedEventArgs e)
            {
                _onUnloaded.Disposable = null;
                _onLoad.Disposable     = null;
            }

            if (_timePickerPresenter != null)
            {
                _onLoad.Disposable     = Disposable.Create(() => _timePickerPresenter.Loaded -= onLoad);
                _onUnloaded.Disposable = Disposable.Create(() => _timePickerPresenter.Unloaded -= onUnload);

                _timePickerPresenter.Loaded   += onLoad;
                _timePickerPresenter.Unloaded += onUnload;
            }

            return(_timePickerPresenter);
        }
コード例 #2
0
        protected override Control CreatePresenter()
        {
            var presenter = new TimePickerFlyoutPresenter()
            {
                Style   = FlyoutPresenterStyle,
                Content = Content
            };

            AttachAcceptCommand(presenter);

            return(presenter);
        }
コード例 #3
0
        protected override Control CreatePresenter()
        {
            var timePickerPresenter = new TimePickerFlyoutPresenter()
            {
                Content = Content
            };

            void onLoad(object sender, RoutedEventArgs e)
            {
                AttachAcceptCommand(timePickerPresenter);
                AttachDismissCommand(timePickerPresenter);
                timePickerPresenter.Loaded -= onLoad;
            }

            if (timePickerPresenter != null)
            {
                timePickerPresenter.Loaded += onLoad;
            }

            return(timePickerPresenter);
        }