Inheritance: FrameworkElement, IPopup
 public DireccionPopup(Popup padre)
 {
     if (padre == null) throw new ArgumentNullException("Debe asignar un Popup al controlador");
     this.popup = padre;
     this.InitializeComponent();
     cargarEstados();
 }
        /// <summary>
        /// Displays the dialog.
        /// </summary>
        public ConfiguredEndpoint ShowDialog(ApplicationConfiguration configuration, bool createNew)
        {
            m_configuration = configuration;
            m_endpoint = null;

            // create a default collection if none provided.
            if (createNew)
            {
                ApplicationDescription server = new DiscoveredServerListDlg().ShowDialog(null, m_configuration);

                if (server != null)
                {
                    return new ConfiguredEndpoint(server, EndpointConfiguration.Create(configuration));
                }

                return null;
            }
            
            ServersCTRL.Initialize(null, configuration);
            
            OkBTN.IsEnabled = false;

            Popup myPopup = new Popup();
            myPopup.Child = this;
            myPopup.IsOpen = true;

            return m_endpoint;
        }
        private void OpenLoginPopUp(bool open)
        {
            if (!open)
            {
                if (loginPopUp != null)
                    loginPopUp.IsOpen = false;

                return;
            }

            var windowBounds = Window.Current.Bounds;

            loginPopUp = new Popup()
            {
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment = VerticalAlignment.Top,
                Width = 500,
                Height = 310,
                IsLightDismissEnabled = false,
                IsOpen = true
            };

            loginPopUp.Child = new LoginView();

            loginPopUp.SetValue(Popup.HorizontalOffsetProperty, 600);
            loginPopUp.SetValue(Popup.VerticalOffsetProperty, 300);

            loginPopUp.Closed += _loginPopup_Closed;
        }
        private void AlphabetSoundGridView_ItemClick(object sender, ItemClickEventArgs e)
        {

            var sound = (Sound)e.ClickedItem;

            MyMediaElement.Source = new Uri(this.BaseUri, sound.AudioFile); //playing the sound

            // var dialog = new MessageDialog(sound.AudioFile.ToString());

            String lett = sound.Name.ToString();
            //String lett = sound.AudioFile.ToString().Substring(0,sound.a)
            //await dialog2.ShowAsync();
            //var user =  myTextBox.ToString();
            Popup popup = new Popup();


           popup.MaxHeight = 2000;
           popup.MaxWidth = 2000;
            //popup.VerticalOffset = 100;
         

          
            PopUpPage control = new PopUpPage(lett);
            
            popup.Child = control;
            popup.IsOpen = true;
           



        }
        public MoviePlayer(ref Popup Popup)
        {
            this.popup = Popup;
            this.InitializeComponent();
            string youTubeId = "VXPoJAyeF8k";
            TestImage.Source = image;
            TestImage.Height = 500;
            TestImage.Width = 340;

            var url = YouTube.GetVideoUriAsync(youTubeId);
            var url2 = YouTube.GetVideoUri(youTubeId, YouTubeQuality.Quality1080P, null);
            MovieContainer.Source = url.Result.Uri;
            MovieContainer.Play();
            MovieContainer.Width = baseMovieWidth;
            MovieContainer.Height = baseMovieHeight;

            LikeActive = new SolidColorBrush();
            LikeActive.Color = Colors.ForestGreen;

            LikeInactive = new SolidColorBrush();
            LikeInactive.Color = Colors.White;

            DislikeActive = new SolidColorBrush();
            DislikeActive.Color = Colors.Red;

            DislikeInactive = new SolidColorBrush();
            DislikeInactive.Color = Colors.White;
        }
示例#6
0
        public static async Task<AddAlbumResult> AddAlbumAsync()
        {
            var tcs = new TaskCompletionSource<int>();
            var result = new AddAlbumResult();
            var p = new Popup
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment = VerticalAlignment.Stretch,
                Width = Window.Current.Bounds.Width,
                Height = Window.Current.Bounds.Height
            };

            var f = new AddAlbumView
                {
                    Width = Window.Current.Bounds.Width,
                    Height = Window.Current.Bounds.Height,
                    Cancelled = () =>
                        {
                            tcs.TrySetResult(1);
                            p.IsOpen = false;
                        },
                    Result = a =>
                     {
                         result = new AddAlbumResult { AlbumName = a };
                         p.IsOpen = false;
                         tcs.TrySetResult(1);
                     }
                };

            p.Child = f;
            p.IsOpen = true;
            await tcs.Task;
            return result;
        }
        /// <summary>
        /// Initialize VideoPlayer.
        /// </summary>
        private static void Initialize(VideoStretch stretch)
        {
#if NETFX_CORE

            if (_videoPopup == null)
            {
                _videoPopup = new Popup();
            }
            _videoPopup.VerticalOffset = 0;
            _videoPopup.HorizontalOffset = 0;

            if (_videoElement == null)
            {
                _videoElement = new MediaElement();
            }
            _videoPopup.Child = _videoElement;

            _videoElement.MediaEnded += _videoElement_MediaEnded;
            _videoElement.MediaOpened += _videoElement_MediaOpened;

            _videoPopup.Height = Window.Current.Bounds.Height;
            _videoPopup.Width = Window.Current.Bounds.Width;

            _videoElement.Tapped += _videoElement_Tapped;
            _videoElement.Stretch = (Stretch)stretch;

            _videoElement.AutoPlay = false;

            _videoElement.Height = _videoPopup.Height;
            _videoElement.Width = _videoPopup.Width;

            _videoPopup.IsOpen = true;
#endif
        }
示例#8
0
        private void OnAboutCommand(IUICommand command)
        {
            SettingsPopup = new Popup();
            SettingsPopup.IsLightDismissEnabled = true;
            SettingsPopup.Width = SettingsWidth;
            SettingsPopup.Height = WindowBounds.Height;

            SettingsPopup.ChildTransitions = new TransitionCollection
                                                  {
                                                      new PaneThemeTransition
                                                          {
                                                              Edge = (SettingsPane.Edge == SettingsEdgeLocation.Right)
                                                                         ? EdgeTransitionLocation.Right
                                                                         : EdgeTransitionLocation.Left
                                                          }
                                                  };

            var mypane = new AboutFlyout { Width = SettingsWidth, Height = WindowBounds.Height };

            SettingsPopup.Child = mypane;

            SettingsPopup.SetValue(Canvas.LeftProperty,
                                    SettingsPane.Edge == SettingsEdgeLocation.Right
                                        ? (WindowBounds.Width - SettingsWidth)
                                        : 0);
            SettingsPopup.SetValue(Canvas.TopProperty, 0);
            SettingsPopup.IsOpen = true;
        }
        public void ShowInPopup(double? width = null, double? height = null)
        {
            var popup = new Popup();
            if (width.HasValue)
            {
                popup.Width = width.Value;
                this.Width = width.Value;
            }
            if (height.HasValue)
            {
                popup.Height = height.Value;
                this.Height = height.Value;
            }

            this._parentPopup = popup;

            popup.Child = this;

            popup.IsOpen = true;

            _currentlyShownInstances.Add(this);

            this.PrepareForLoad();
          
        }
示例#10
0
        // --- Methods of the class ---

        #region Constructor

        /// <summary>The default constructor creates all objects of the page, i.e. all the settings and the start button.</summary>
        public HubPage()
            : base()
        {
//DEBUG     Logging.I.LogMessage("Calling constructor of HubPage.\n");

            this.InitializeComponent();

            // Do not cache this page:
            NavigationCacheMode = NavigationCacheMode.Disabled;

            _popup_NameInput = null;

//          SetBackgroundImage();
            CreateThemesColumn();
            CreatePlayerColumns();
            CreateGameBoardColumn();
            CreateRulesColumn();
            CheckAdColumn();
            InitializeTooltips();

            if ((Presenter.I.GetGameStatus() == Presenter.GameStatus.Ended) ||
                Presenter.I.NoPlayerIsHuman())
            {
                DisableContinueButton();
            }
            else
            {
                EnableContinueButton();
            }
        }
        void OnWrapOptionsAppBarButtonClick(object sender, RoutedEventArgs args)
        {
            // Create dialog
            WrapOptionsDialog wrapOptionsDialog = new WrapOptionsDialog
            {
                TextWrapping = txtbox.TextWrapping
            };

            // Bind dialog to TextBox
            Binding binding = new Binding
            {
                Source = wrapOptionsDialog,
                Path = new PropertyPath("TextWrapping"),
                Mode = BindingMode.TwoWay
            };
            txtbox.SetBinding(TextBox.TextWrappingProperty, binding);

            // Create popup
            Popup popup = new Popup
            {
                Child = wrapOptionsDialog,
                IsLightDismissEnabled = true
            };

            // Adjust location based on content size
            wrapOptionsDialog.SizeChanged += (dialogSender, dialogArgs) =>
            {
                popup.VerticalOffset = this.ActualHeight - wrapOptionsDialog.ActualHeight
                                                         - this.BottomAppBar.ActualHeight - 48;
                popup.HorizontalOffset = 48;
            };

            // Open the popup
            popup.IsOpen = true;
        }
示例#12
0
        public static async Task ShowAsync(this IDialog view)
        {
            var tcs = new TaskCompletionSource<int>();

            var p = new Popup
                {
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    VerticalAlignment = VerticalAlignment.Stretch,
                    Width = Window.Current.Bounds.Width,
                    Height = Window.Current.Bounds.Height
                };

            ((UserControl)view).Width = Window.Current.Bounds.Width;
            ((UserControl)view).Height = Window.Current.Bounds.Height;
            view.Cancelled += () =>
                {
                    tcs.TrySetResult(1);
                    p.IsOpen = false;
                };

            p.Child = (UserControl)view;
            p.IsOpen = true;
            await tcs.Task;
            return;
        }
        private void OnSettingsCommandInvoker(IUICommand command)
        {
            settingsPopup = new Popup();
            settingsPopup.Closed += SettingsPopupOnClosed;
            Window.Current.Activated += OnWindowActivated;
            settingsPopup.IsLightDismissEnabled = true;
            settingsPopup.Width = settingsWidth;
            settingsPopup.Height = windowBounds.Height;

            settingsPopup.ChildTransitions = new TransitionCollection();
            settingsPopup.ChildTransitions.Add(new PaneThemeTransition()
            {
                Edge = (SettingsPane.Edge == SettingsEdgeLocation.Right) ?
                       EdgeTransitionLocation.Right :
                       EdgeTransitionLocation.Left
            });

            // Create a SettingsFlyout the same dimenssions as the Popup.
            var mypane = new SettingsFlyoutPage
            {
                DataContext = this.Settings
            };

            mypane.Width = settingsWidth;
            mypane.Height = windowBounds.Height;

            settingsPopup.Child = mypane;

            settingsPopup.SetValue(Canvas.LeftProperty, SettingsPane.Edge == SettingsEdgeLocation.Right ? (windowBounds.Width - settingsWidth) : 0);
            settingsPopup.SetValue(Canvas.TopProperty, 0);
            settingsPopup.IsOpen = true;            
        }
示例#14
0
        internal IDisposable OpenPopup(Controls.Primitives.Popup popup)
        {
            if (this.Log().IsEnabled(Uno.Foundation.Logging.LogLevel.Debug))
            {
                this.Log().Debug($"Creating popup");
            }

            if (PopupRoot == null)
            {
                throw new InvalidOperationException("PopupRoot is not initialized yet.");
            }

            var popupPanel = popup.PopupPanel;

            PopupRoot.Children.Add(popupPanel);

            return(Disposable.Create(() =>
            {
                if (this.Log().IsEnabled(Uno.Foundation.Logging.LogLevel.Debug))
                {
                    this.Log().Debug($"Closing popup");
                }

                PopupRoot.Children.Remove(popupPanel);
            }));
        }
void BlankPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
    // 新建一个命令
    SettingsCommand cmd = new SettingsCommand("login", "登录", (x) =>
    {
        // 新建一个Popup,并将其宽度设置为346,高度与屏幕一致
        _settingsPopup = new Popup();
        _settingsPopup.Width = 346;
        _settingsPopup.Height = Window.Current.Bounds.Height;
        _settingsPopup.IsLightDismissEnabled = true;

        // 新建一个页面,并设置该页面的相关属性(大小,位置)
        LoginPane mypane = new LoginPane();
        mypane.Height = Window.Current.Bounds.Height;
        mypane.Width = 346;
        _settingsPopup.Child = mypane;
        _settingsPopup.SetValue(Canvas.LeftProperty, Window.Current.Bounds.Width - 346);
        _settingsPopup.IsOpen = true;
    });

    args.Request.ApplicationCommands.Add(cmd);

    SettingsCommand cmd1 = new SettingsCommand("logout", "注销", (x) =>
    {
    });

    args.Request.ApplicationCommands.Add(cmd1);
}
        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            var deleteButton = GetTemplateChild("DeleteButton") as Button;
            if (deleteButton != null)
                deleteButton.Tapped += DeleteButton_Tapped;

            if (DateComponents != null)
            {
                var monthColumn = GetTemplateChild("PART_DateColumn" + Array.IndexOf(DateComponents, month)) as ColumnDefinition;
                if (monthColumn != null)
                    monthColumn.Width = new GridLength(1, GridUnitType.Star);
            }

            popup = GetTemplateChild("Popup") as Popup;
            if (popup != null)
                popup.Closed += (_, __) => Focus(FocusState.Programmatic);

            VisualStateManager.GoToState(this, "Normal", false);
            VisualStateManager.GoToState(this, "NoDate", true);
            VisualStateManager.GoToState(this, "NoTime", true);
            VisualStateManager.GoToState(this, "NoOffset", true);
            VisualStateManager.GoToState(this, "NoAMPM", true);
        }
		private void OnPopupClosed(object sender, object e)
		{
			if (_tcs != null && !_tcs.Task.IsCompleted)
				_tcs.SetException(new OperationCanceledException()); // user closed the window
			_tcs = null;
			_popup = null;
		}
示例#18
0
        internal IDisposable OpenPopup(Controls.Primitives.Popup popup)
        {
            if (this.Log().IsEnabled(Microsoft.Extensions.Logging.LogLevel.Debug))
            {
                this.Log().Debug($"Creating popup");
            }

            if (PopupRoot == null)
            {
                throw new InvalidOperationException("PopupRoot is not initialized yet.");
            }

            var popupPanel = popup.PopupPanel;

            PopupRoot.Children.Add(popupPanel);

            return(new CompositeDisposable(
                       Disposable.Create(() =>
            {
                if (this.Log().IsEnabled(Microsoft.Extensions.Logging.LogLevel.Debug))
                {
                    this.Log().Debug($"Closing popup");
                }

                PopupRoot.Children.Remove(popupPanel);
            }),
                       VisualTreeHelper.RegisterOpenPopup(popup)
                       ));
        }
示例#19
0
        void CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var command = new SettingsCommand("settings", "Settings", (x) => {
                this._settingsPopup = new Popup();
                this._settingsPopup.Closed += this.SettingsPopupClosed;
                this._settingsPopup.Opened += this.SettingsPopupOpened;
                this._settingsPopup.IsLightDismissEnabled = true;
                this._settingsPopup.Width = this._settingsWidth;
                this._settingsPopup.Height = this._windowsBounds.Height;

                var settingsPane = new ApplicationSettings();

                settingsPane.Width = this._settingsWidth;
                settingsPane.Height = this._windowsBounds.Height;

                this._settingsPopup.Child = settingsPane;
                this._settingsPopup.SetValue(Canvas.LeftProperty, this._windowsBounds.Width - this._settingsWidth);
                this._settingsPopup.SetValue(Canvas.TopProperty, 0);
                this._settingsPopup.IsOpen = true;

                Window.Current.Activated += OnWindowActivated;
            });

            args.Request.ApplicationCommands.Add(command);
        }
示例#20
0
        void MainPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            if (!settingPanelInitialized)
            {
                SettingsCommand cmd = new SettingsCommand("AIMine", "Layout Options", (x) =>
                {
                    _settingsPopup = new Popup();
                    _settingsPopup.Closed += OnPopupClosed;
                    Window.Current.Activated += OnWindowActivated;
                    _settingsPopup.IsLightDismissEnabled = true;
                    _settingsPopup.Width = _settingsWidth;
                    _settingsPopup.Height = _windowBounds.Height;

                    SimpleSettingsNarrow mypane = new SimpleSettingsNarrow();
                    mypane.Width = _settingsWidth;
                    mypane.Height = _windowBounds.Height;

                    _settingsPopup.Child = mypane;
                    _settingsPopup.SetValue(Canvas.LeftProperty, _windowBounds.Width - _settingsWidth);
                    _settingsPopup.SetValue(Canvas.TopProperty, 0);
                    _settingsPopup.IsOpen = true;
                });
                args.Request.ApplicationCommands.Add(cmd);
                settingPanelInitialized = true;
            }
        }
        /// <summary>
        /// Prompts the user to specify the browse options.
        /// </summary>
        public async Task<bool> ShowDialog(Subscription subscription)
        {
            if (subscription == null) throw new ArgumentNullException("subscription");

            DisplayNameTB.Text = subscription.DisplayName;
            PublishingIntervalNC.Value = (double)Convert.ToDecimal(subscription.PublishingInterval);
            KeepAliveCountNC.Value = subscription.KeepAliveCount;
            LifetimeCountCTRL.Value = subscription.LifetimeCount;
            MaxNotificationsCTRL.Value = subscription.MaxNotificationsPerPublish;
            PriorityNC.Value = subscription.Priority;
            PublishingEnabledCK.IsChecked = subscription.PublishingEnabled;

            TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>();
            Popup dialog = new Popup();
            dialog.Child = this;
            dialog.IsOpen = true;
            dialog.Closed += (o, e) =>
            {
                tcs.SetResult(dialogResult);
            };

            bool result = await tcs.Task;

            subscription.DisplayName = DisplayNameTB.Text;
            subscription.PublishingInterval = (int)PublishingIntervalNC.Value;
            subscription.KeepAliveCount = (uint)KeepAliveCountNC.Value;
            subscription.LifetimeCount = (uint)LifetimeCountCTRL.Value;
            subscription.MaxNotificationsPerPublish = (uint)MaxNotificationsCTRL.Value;
            subscription.Priority = (byte)PriorityNC.Value;
            subscription.PublishingEnabled = (bool)PublishingEnabledCK.IsChecked;

            return result;
        }
        /// <summary>
        /// Displays the dialog.
        /// </summary>
        public bool ShowDialog(UserNameIdentityToken token)
        {
            if (token != null)
            {
                UserNameCB.SelectedItem = token.UserName;

                if (token.Password != null && token.Password.Length > 0)
                {
                    PasswordTB.Password = new UTF8Encoding().GetString(token.Password);
                }
            }

            Popup myPopup = new Popup();
            myPopup.Child = this;
            myPopup.IsOpen = true;

            token.UserName = UserNameCB.SelectedItem.ToString();

            if (!String.IsNullOrEmpty(PasswordTB.Password))
            {
                token.Password = new UTF8Encoding().GetBytes(PasswordTB.Password);
            }
            else
            {
                token.Password = null;
            }

            return true;
        }
示例#23
0
        public void Open(object parameter, Action successAction)
        {
            // Create a new Popup to display the Flyout
            _popup = new Popup();
            _popup.IsLightDismissEnabled = true;
            _popup.SetValue(Canvas.LeftProperty, Window.Current.Bounds.Width - FlyoutSize);
            _popup.SetValue(Canvas.TopProperty, 0);

            // Handle the Closed & Activated events of the Popup
            _popup.Closed += OnPopupClosed;
            Window.Current.Activated += OnWindowActivated;

            // Update the Flyout dimensions
            Width = FlyoutSize;
            Height = Window.Current.Bounds.Height;

            // Add animations for the panel.
            _popup.ChildTransitions = new TransitionCollection();
            _popup.ChildTransitions.Add(new PaneThemeTransition()
            {
                Edge = (SettingsPane.Edge == SettingsEdgeLocation.Right) ? EdgeTransitionLocation.Right : EdgeTransitionLocation.Left
            });

            // Place the Flyout inside the Popup
            _popup.Child = this;
            _popup.IsOpen = true;

            var viewModel = this.DataContext as IFlyoutViewModel;
            if (viewModel != null)
            {
                viewModel.Open(parameter, successAction);
            }
        }
示例#24
0
 private void BotonCalificacion_Click(object sender, RoutedEventArgs e)
 {
     Popup popup = new Popup();
     CalificarPopup direcPopup = new CalificarPopup(popup,detalle.Producto);
     popup.Child = direcPopup;
     popup.IsOpen = true;
 }
 public VerMetodoPagoPopup(Popup padre)
 {
     if (padre == null) throw new ArgumentNullException("Debe asignar un Popup al controlador");
     this.popup = padre;
     this.InitializeComponent();
     cargarMetodoPago();
 }
示例#26
0
        public void ShowFlyout(UserControl control, int width, bool isLightDismiss)
        {
            if (popup == null)
            {
                popup = new Popup();
                popup.Closed += popup_Closed;

                popup.ChildTransitions = new TransitionCollection();
                popup.ChildTransitions.Add(new PaneThemeTransition()
                {
                    Edge = (SettingsPane.Edge == SettingsEdgeLocation.Right) ?
                                   EdgeTransitionLocation.Right :
                                   EdgeTransitionLocation.Left
                });
            }
            Window.Current.Activated += Current_Activated;

            popup.Width = width;
            popup.Height = Window.Current.Bounds.Height;
            popup.IsLightDismissEnabled = isLightDismiss;

            control.Width = width;
            control.Height = Window.Current.Bounds.Height;

            popup.Child = control;
            popup.SetValue(Canvas.LeftProperty, SettingsPane.Edge == SettingsEdgeLocation.Right ? (Window.Current.Bounds.Width - width) : 0);
            popup.SetValue(Canvas.TopProperty, 0);
            popup.IsOpen = true;
        }
        void GroupedItemsPage_CommandsRequested(Windows.UI.ApplicationSettings.SettingsPane sender, Windows.UI.ApplicationSettings.SettingsPaneCommandsRequestedEventArgs args)
        {
            
             
                SettingsCommand cmd = new SettingsCommand("Accounts", "Account", (x) =>
                    {
                        _settingsPopup = new Popup();
                        _settingsPopup.Closed += OnPopupClosed;
                        Window.Current.Activated += OnWindowActivated;
                        _settingsPopup.IsLightDismissEnabled = true;
                        _settingsPopup.Width = _settingsWidth;
                        _settingsPopup.Height = _windowBounds.Height;

                        SimpleSettingsNarrow mypane = new SimpleSettingsNarrow();
                        mypane.Width = _settingsWidth;
                        mypane.Height = _windowBounds.Height;

                        _settingsPopup.Child = mypane;
                        _settingsPopup.SetValue(Canvas.LeftProperty, _windowBounds.Width - _settingsWidth);
                        _settingsPopup.SetValue(Canvas.TopProperty, 0);
                        _settingsPopup.IsOpen = true;
                    });

                args.Request.ApplicationCommands.Add(cmd);
            

        }
示例#28
0
 private void botonTwitter_Click(object sender, RoutedEventArgs e)
 {
     TwitterPopup.tweet = "Hola! He visto este producto: " +producto.Nombre+ " en @aeiStore";
     Popup popup = new Popup();
     TwitterPopup twitterPopup = new TwitterPopup(popup,this);
     popup.Child = twitterPopup;
     popup.IsOpen = true;
 }
        private void botonAgregarDireccion_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            Popup popup = new Popup();
            DireccionPopup direcPopup = new DireccionPopup(popup, this);
            popup.Child = direcPopup;
            popup.IsOpen = true;

        }
示例#30
0
 public void showPopup(string msg)
 {
     Popup popup = new Popup();
     Button bt = new Button { Content = "message: " + msg };
     popup.Child = bt;
     popup.IsOpen = true;
     bt.Click += bt_Click;
 }
示例#31
0
 public CheckoutPopup(Popup padre, ListaCompraPage father)
 {
     this.father = father;
     if (padre == null) throw new ArgumentNullException("Debe asignar un Popup al controlador");
     this.popup = padre;
     this.InitializeComponent();
     cargarCombos();
 }
 public RegistroUsuarioPopup(Popup padre, object sender, MainPage pagina)
 {
     if (padre == null) throw new ArgumentNullException("Debe asignar un Popup al controlador");
     this.popup = padre;
     this.InitializeComponent();
     this.botonSender = sender;
     this.pagina = pagina;
 }
示例#33
0
 void InitializeContextMenu()
 {
     _autoFitContentMenuPopup = new Windows.UI.Xaml.Controls.Primitives.Popup();
     AutoFillType[] items = new AutoFillType[4];
     items[1]        = AutoFillType.FillSeries;
     items[2]        = AutoFillType.FillFormattingOnly;
     items[3]        = AutoFillType.FillWithoutFormatting;
     _autoFitListBox = new DragFillContextMenu(items, AutoFillType.CopyCells);
     _autoFitListBox.SelectedAutoFitTypeChanged += new EventHandler(_autoFitListBox_SelectedAutoFitTypeChanged);
 }
        private static void UpdatePopupBounds(Popup p, Rect rect)
        {
            p.HorizontalOffset = rect.X;
            p.VerticalOffset   = rect.Y;

            var child = (FrameworkElement)p.Child;

            child.Width  = rect.Width;
            child.Height = rect.Height;
        }
        private void OnPress(Point point)
        {
            var child = CreateChild();

            Popup = new Popup
            {
                IsOpen           = true,
                IsHitTestVisible = false,
                Child            = child
            };
            Origin = point;
            UpdatePopupBounds(Popup, new Rect(Origin, Origin));
        }
示例#36
0
文件: PopupHelper.cs 项目: Daoting/dt
        public PopupHelper(Windows.UI.Xaml.Controls.Primitives.Popup popup)
        {
            _popup          = popup;
            _popupChildGrid = new Grid();

            _popupOutsideCanvas = new Canvas();
            _popupOutsideCanvas.PointerPressed += OnOutsideCanvasMouseLeftButtonDown;
            _popupChildGrid.Children.Add(_popupOutsideCanvas);

            _popupContentHost              = new Border();
            _popupContentHost.SizeChanged += OnPopupContentHostSizeChanged;
            _popupChildGrid.Children.Add(_popupContentHost);

            _popup.Child = _popupChildGrid;
        }
示例#37
0
文件: Compass.cs 项目: Daoting/dt
        FrameworkElement GetSubtree(FrameworkElement element)
        {
            Windows.UI.Xaml.Controls.Primitives.Popup popup = element as Windows.UI.Xaml.Controls.Primitives.Popup;
            if (element == null || popup == null)
            {
                return(element);
            }
            FrameworkElement testElement = (FrameworkElement)((VisualTreeHelper.GetParent(popup) == null) ? popup.Child : GetRootVisual(popup));

            Windows.UI.Xaml.Controls.Primitives.Popup rootPopup = testElement as Windows.UI.Xaml.Controls.Primitives.Popup;
            if (rootPopup != null)
            {
                testElement = (FrameworkElement)rootPopup.Child;
            }
            return(testElement);
        }
示例#38
0
 public Template10Popup()
 {
     popup = new Windows.UI.Xaml.Controls.Primitives.Popup
     {
         Child = new ContentControl
         {
             Padding         = new Thickness(5),
             Background      = new SolidColorBrush(Colors.Gray),
             BorderBrush     = new SolidColorBrush(Colors.Red),
             BorderThickness = new Windows.UI.Xaml.Thickness(2),
         }
     };
     popup.Opened += (s, e) => Opened?.Invoke(this, EventArgs.Empty);
     popup.Closed += (s, e) => Closed?.Invoke(this, EventArgs.Empty);
     window        = Window.Current;
 }
示例#39
0
        public TooltipPopupHelper(Excel p_excel, double minWidth = -1.0)
        {
            _popup = p_excel.ToolTipPopup;
            _tooltipFocusableElement = new Grid();
            new Border();
            new LinearGradientBrush().StartPoint = new Point();
            _toolTipBlock        = new TooltipControl();
            _toolTipBlock.Margin = new Thickness(0.0, 0.0, 5.0, 5.0);
            _popup.Child         = _tooltipFocusableElement;
            _tooltipFocusableElement.Children.Add(_toolTipBlock);
            _minWidth = minWidth;
            Grid grid = _tooltipFocusableElement;

            grid.SizeChanged += _tooltipFocusableElement_SizeChanged;
            if (_minWidth > 0.0)
            {
                _toolTipBlock.MinWidth = minWidth;
            }
        }
示例#40
0
        void DragFillSmartTag_Loaded(object sender, RoutedEventArgs e)
        {
            DragFillSmartTag tag = this;

            tag.PointerEntered += OnDragFillSmartTagPointerEntered;
            DragFillSmartTag tag2 = this;

            tag2.PointerExited += OnDragFillSmartTagPointerExited;
            DragFillSmartTag tag3 = this;

            tag3.PointerPressed += OnDragFillSmartTagPointerPressed;
            DragFillSmartTag tag4 = this;

            tag4.PointerReleased += OnDragFillSmartTagPointerReleased;
            Windows.UI.Xaml.Controls.Primitives.Popup popup = _autoFitContentMenuPopup;
            popup.Closed += _autoFitContentMenu_Closed;
            _isPressed    = false;
            _isHover      = false;
            UpdateVisualState(true);
        }
示例#41
0
        private void InitializeTemplate()
        {
            _eventSubscriptions.Disposable = null;

            var registrations = new CompositeDisposable();

            var spinDownName = ResourceAccessor.GetLocalizedStringResource("NumberBoxDownSpinButtonName");
            var spinUpName   = ResourceAccessor.GetLocalizedStringResource("NumberBoxUpSpinButtonName");

            if (this.GetTemplateChild(c_numberBoxDownButtonName) is RepeatButton spinDown)
            {
                spinDown.Click += OnSpinDownClick;
                registrations.Add(() => spinDown.Click -= OnSpinDownClick);

                // Do localization for the down button
                if (string.IsNullOrEmpty(AutomationProperties.GetName(spinDown)))
                {
                    AutomationProperties.SetName(spinDown, spinDownName);
                }
            }

            if (GetTemplateChild(c_numberBoxUpButtonName) is RepeatButton spinUp)
            {
                spinUp.Click += OnSpinUpClick;
                registrations.Add(() => spinUp.Click -= OnSpinUpClick);

                // Do localization for the up button
                if (string.IsNullOrEmpty(AutomationProperties.GetName(spinUp)))
                {
                    AutomationProperties.SetName(spinUp, spinUpName);
                }
            }

            if (GetTemplateChild(c_numberBoxTextBoxName) is TextBox textBox)
            {
                textBox.KeyDown += OnNumberBoxKeyDown;
                registrations.Add(() => textBox.KeyDown -= OnNumberBoxKeyDown);
                textBox.KeyUp += OnNumberBoxKeyUp;
                registrations.Add(() => textBox.KeyUp -= OnNumberBoxKeyUp);

                m_textBox = textBox;
            }

            m_popup = GetTemplateChild(c_numberBoxPopupName) as Windows.UI.Xaml.Controls.Primitives.Popup;

            if (SharedHelpers.IsThemeShadowAvailable())
            {
                // UNO TODO
                //if (GetTemplateChildT(c_numberBoxPopupContentRootName) is UIElement popupRoot)
                //{
                //	if (!popupRoot.Shadow())
                //	{
                //		popupRoot.Shadow(ThemeShadow{});
                //		auto&& translation = popupRoot.Translation();

                //		const double shadowDepth = unbox_value<double>(SharedHelpers.FindResource(c_numberBoxPopupShadowDepthName, Application.Current().Resources(), box_value(c_popupShadowDepth)));

                //		popupRoot.Translation({ translation.x, translation.y, (float)shadowDepth });
                //	}
                //}
            }

            if (GetTemplateChild(c_numberBoxPopupDownButtonName) is RepeatButton popupSpinDown)
            {
                popupSpinDown.Click += OnSpinDownClick;
                registrations.Add(() => popupSpinDown.Click -= OnSpinDownClick);
            }

            if (GetTemplateChild(c_numberBoxPopupUpButtonName) is RepeatButton popupSpinUp)
            {
                popupSpinUp.Click += OnSpinUpClick;
                registrations.Add(() => popupSpinUp.Click -= OnSpinUpClick);
            }

            // .NET rounds to 12 significant digits when displaying doubles, so we will do the same.
            m_displayRounder.SignificantDigits = 12;

            UpdateSpinButtonPlacement();
            UpdateSpinButtonEnabled();

            if (ReadLocalValue(ValueProperty) == DependencyProperty.UnsetValue &&
                ReadLocalValue(TextProperty) != DependencyProperty.UnsetValue)
            {
                // If Text has been set, but Value hasn't, update Value based on Text.
                UpdateValueToText();
            }
            else
            {
                UpdateTextToValue();
            }

            _eventSubscriptions.Disposable = registrations;
        }
示例#42
0
 protected PlacementPopupPanel(Popup popup) : base(popup)
 {
     Loaded   += (s, e) => Windows.UI.Xaml.Window.Current.SizeChanged += Current_SizeChanged;
     Unloaded += (s, e) => Windows.UI.Xaml.Window.Current.SizeChanged -= Current_SizeChanged;
 }