Exemple #1
0
        public ComboBox()
        {
            ResourceResolver.ApplyResource(this, LightDismissOverlayBackgroundProperty, "ComboBoxLightDismissOverlayBackground", isThemeResourceExtension: true);

            IsItemClickEnabled = true;
            DefaultStyleKey    = typeof(ComboBox);
        }
Exemple #2
0
        public DatePicker()
        {
            DefaultStyleKey = typeof(DatePicker);
            ResourceResolver.ApplyResource(this, LightDismissOverlayBackgroundProperty, "DatePickerLightDismissOverlayBackground", isThemeResourceExtension: true);

            InitializePartial();
        }
Exemple #3
0
        private void EnsurePopupCreated()
        {
            if (_popup == null)
            {
                ResourceResolver.ApplyResource(this, LightDismissOverlayBackgroundProperty, "FlyoutLightDismissOverlayBackground", isThemeResourceExtension: true, isHotReloadSupported: true);

                var child = CreatePresenter();
                _popup = new Popup()
                {
                    Child = child,
                    IsLightDismissEnabled = _isLightDismissEnabled,
                    AssociatedFlyout      = this,
                };

                SynchronizePropertyToPopup(Popup.TemplatedParentProperty, TemplatedParent);

                _popup.Opened += OnPopupOpened;
                _popup.Closed += OnPopupClosed;

                _popup.BindToEquivalentProperty(this, nameof(LightDismissOverlayMode));
                _popup.BindToEquivalentProperty(this, nameof(LightDismissOverlayBackground));

                InitializePopupPanel();

                SynchronizePropertyToPopup(Popup.DataContextProperty, DataContext);
                SynchronizePropertyToPopup(Popup.AllowFocusOnInteractionProperty, AllowFocusOnInteraction);
                SynchronizePropertyToPopup(Popup.AllowFocusWhenDisabledProperty, AllowFocusWhenDisabled);
            }
        }
Exemple #4
0
        private void EnsurePopupCreated()
        {
            if (_popup == null)
            {
                ResourceResolver.ApplyResource(this, LightDismissOverlayBackgroundProperty, "FlyoutLightDismissOverlayBackground", isThemeResourceExtension: true);

                var child = CreatePresenter();
                _popup = new Windows.UI.Xaml.Controls.Popup()
                {
                    Child = child,
                    IsLightDismissEnabled = _isLightDismissEnabled,
                };

                SynchronizeTemplatedParent();

                _popup.Opened += OnPopupOpened;
                _popup.Closed += OnPopupClosed;

                _popup.BindToEquivalentProperty(this, nameof(LightDismissOverlayMode));
                _popup.BindToEquivalentProperty(this, nameof(LightDismissOverlayBackground));

                InitializePopupPanel();

                SynchronizeDataContext();
            }
        }
Exemple #5
0
        public ContentDialog() : base()
        {
            _popup = new Popup()
            {
                LightDismissOverlayMode = LightDismissOverlayMode.On,
            };

            ResourceResolver.ApplyResource(_popup, Popup.LightDismissOverlayBackgroundProperty, "ContentDialogLightDismissOverlayBackground", isThemeResourceExtension: true);

            _popup.PopupPanel = new ContentDialogPopupPanel(this);

            var thisRef = (this as IWeakReferenceProvider).WeakReference;

            _popup.Opened += (s, e) =>
            {
                if (thisRef.Target is ContentDialog that)
                {
                    that.Opened?.Invoke(that, new ContentDialogOpenedEventArgs());
                    VisualStateManager.GoToState(that, "DialogShowing", true);
                }
            };
            this.KeyDown += OnPopupKeyDown;

            Loaded   += (s, e) => RegisterEvents();
            Unloaded += (s, e) => UnregisterEvents();

            DefaultStyleKey = typeof(ContentDialog);
        }
Exemple #6
0
        private void Initialize()
        {
            InitializePartial();

            ResourceResolver.ApplyResource(this, LightDismissOverlayBackgroundProperty, "PopupLightDismissOverlayBackground", isThemeResourceExtension: true);

            ApplyLightDismissOverlayMode();
        }
Exemple #7
0
        public Hyperlink() : base("a")
        {
            UpdateNavigationProperties(null, _defaultNavigationTarget);

            PointerPressed     += TextBlock.OnPointerPressed;
            PointerReleased    += TextBlock.OnPointerReleased;
            PointerCaptureLost += TextBlock.OnPointerCaptureLost;
            ResourceResolver.ApplyResource(this, Hyperlink.ForegroundProperty, "SystemControlHyperlinkTextBrush", isThemeResourceExtension: true);
        }
Exemple #8
0
        public ContentDialog() : base()
        {
            _popup = new Popup()
            {
                LightDismissOverlayMode = LightDismissOverlayMode.On,
            };

            ResourceResolver.ApplyResource(_popup, Popup.LightDismissOverlayBackgroundProperty, "ContentDialogLightDismissOverlayBackground", isThemeResourceExtension: true, isHotReloadSupported: true);

            _popup.PopupPanel = new ContentDialogPopupPanel(this);

            var thisRef = (this as IWeakReferenceProvider).WeakReference;

            _popup.Opened += (s, e) =>
            {
                if (thisRef.Target is ContentDialog that)
                {
                    that.Opened?.Invoke(that, new ContentDialogOpenedEventArgs());
                    that.UpdateVisualState();
                }
            };
            this.KeyDown += OnPopupKeyDown;
            var inputPane = InputPane.GetForCurrentView();

            inputPane.Showing += (o, e) =>
            {
                if (thisRef.Target is ContentDialog that)
                {
                    that.UpdateVisualState();
                }
            };
            inputPane.Hiding += (o, e) =>
            {
                if (thisRef.Target is ContentDialog that)
                {
                    that.UpdateVisualState();
                }
            };

            Loaded   += (s, e) => RegisterEvents();
            Unloaded += (s, e) => UnregisterEvents();

            DefaultStyleKey = typeof(ContentDialog);
        }
Exemple #9
0
        public TimePicker()
        {
            ResourceResolver.ApplyResource(this, LightDismissOverlayBackgroundProperty, "FlyoutLightDismissOverlayBackground", isThemeResourceExtension: true);

            DefaultStyleKey = typeof(TimePicker);
        }
Exemple #10
0
        public ComboBox()
        {
            ResourceResolver.ApplyResource(this, LightDismissOverlayBackgroundProperty, "ComboBoxLightDismissOverlayBackground", isThemeResourceExtension: true, isHotReloadSupported: true);

            DefaultStyleKey = typeof(ComboBox);
        }