當前位置: 首頁>>代碼示例>>C#>>正文


C# Primitives.Popup類代碼示例

本文整理匯總了C#中Windows.UI.Xaml.Controls.Primitives.Popup的典型用法代碼示例。如果您正苦於以下問題:C# Popup類的具體用法?C# Popup怎麽用?C# Popup使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Popup類屬於Windows.UI.Xaml.Controls.Primitives命名空間,在下文中一共展示了Popup類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnApplyTemplate

        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);
        }
開發者ID:stevehansen,項目名稱:vidyano_v1,代碼行數:25,代碼來源:PersistentObjectAttributeDateTimeOffset.cs

示例2: BlankPage_CommandsRequested

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);
}
開發者ID:BeyondVincent,項目名稱:WindowsStoreAppCode,代碼行數:28,代碼來源:MainPage.xaml.cs

示例3: ShowDialog

        /// <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;
        }
開發者ID:OPCFoundation,項目名稱:UA-.NETStandardLibrary,代碼行數:31,代碼來源:ConfiguredServerListDlg.xaml.cs

示例4: OpenLoginPopUp

        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;
        }
開發者ID:sharemepoint,項目名稱:SharePointAuthentication,代碼行數:29,代碼來源:MainView.xaml.cs

示例5: AlphabetSoundGridView_ItemClick

        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;
           



        }
開發者ID:sarbjeetkumar,項目名稱:MoblieAppProject,代碼行數:31,代碼來源:GamePage.xaml.cs

示例6: MoviePlayer

        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;
        }
開發者ID:alexsb92,項目名稱:TheMovieTrailerApp,代碼行數:28,代碼來源:MoviePlayer.xaml.cs

示例7: AddAlbumAsync

        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;
        }
開發者ID:willhughes,項目名稱:Smuggle,代碼行數:34,代碼來源:AddAlbumView.xaml.cs

示例8: Initialize

        /// <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
        }
開發者ID:khaerul10056,項目名稱:MarkerMetro.Unity.WinIntegration,代碼行數:37,代碼來源:VideoPlayer.cs

示例9: OnAboutCommand

        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;
        }
開發者ID:rousse101,項目名稱:WritePadSDK,代碼行數:28,代碼來源:SettingsUI.cs

示例10: ShowInPopup

        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();
          
        }
開發者ID:super-ala,項目名稱:vk-windowsphone-sdk,代碼行數:25,代碼來源:VKPopupControlBase.cs

示例11: OnWrapOptionsAppBarButtonClick

        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;
        }
開發者ID:BeyondVincent,項目名稱:WindowsStoreAppStepByStep,代碼行數:35,代碼來源:MainPage.xaml.cs

示例12: ShowAsync

        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;
        }
開發者ID:modulexcite,項目名稱:MarkPadRT,代碼行數:25,代碼來源:InputDialog.cs

示例13: OnSettingsCommandInvoker

        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;            
        }
開發者ID:derikwhittaker,項目名稱:LiveLessons.WinRT,代碼行數:32,代碼來源:DashboardViewModel.cs

示例14: OnPopupClosed

		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;
		}
開發者ID:MagicWang,項目名稱:arcgis-runtime-samples-dotnet,代碼行數:7,代碼來源:OAuthAuthorizeHandler.cs

示例15: VerMetodoPagoPopup

 public VerMetodoPagoPopup(Popup padre)
 {
     if (padre == null) throw new ArgumentNullException("Debe asignar un Popup al controlador");
     this.popup = padre;
     this.InitializeComponent();
     cargarMetodoPago();
 }
開發者ID:alonsonic,項目名稱:Desarrollo,代碼行數:7,代碼來源:VerMetodoPagoPopup.xaml.cs


注:本文中的Windows.UI.Xaml.Controls.Primitives.Popup類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。