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

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

            InitializePartial();
        }
示例#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);
            }
        }
示例#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();
            }
        }
示例#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);
        }
示例#6
0
文件: Popup.cs 项目: zhuzilyy/uno
        private void Initialize()
        {
            InitializePartial();

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

            ApplyLightDismissOverlayMode();
        }
示例#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);
        }
示例#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);
        }
示例#9
0
文件: TimePicker.cs 项目: jabak/uno
        public TimePicker()
        {
            ResourceResolver.ApplyResource(this, LightDismissOverlayBackgroundProperty, "FlyoutLightDismissOverlayBackground", isThemeResourceExtension: true);

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

            DefaultStyleKey = typeof(ComboBox);
        }