当前位置: 首页>>代码示例>>C#>>正文


C# Popup.SetValue方法代码示例

本文整理汇总了C#中Windows.UI.Xaml.Controls.Primitives.Popup.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Popup.SetValue方法的具体用法?C# Popup.SetValue怎么用?C# Popup.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Windows.UI.Xaml.Controls.Primitives.Popup的用法示例。


在下文中一共展示了Popup.SetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GroupedItemsPage_CommandsRequested

        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);
            

        }
开发者ID:harunpehlivan,项目名称:LiveSDK-for-Windows,代码行数:27,代码来源:GroupedItemsPage.xaml.cs

示例2: Open

        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);
            }
        }
开发者ID:hvining,项目名称:PasswordManager,代码行数:33,代码来源:FlyOutView.cs

示例3: 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

示例4: MainPage_CommandsRequested

 void MainPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
 {
     args.Request.ApplicationCommands.Clear();
     SettingsCommand settingsCommand = new SettingsCommand("settings", "Settings", (x) =>
     {
         _settingsPopup = new Popup();
         _settingsPopup.Closed += _settingsPopup_Closed;
         Window.Current.Activated += Current_Activated;
         _settingsPopup.IsLightDismissEnabled = true;
         _settingsPopup.Width = _settingsWidth;
         _settingsPopup.Height = _windowBounds.Height;
         SettingsUserControl settingsPane = new SettingsUserControl();
         settingsPane.Width = _settingsWidth;
         settingsPane.Height = _windowBounds.Height;
         _settingsPopup.Child = settingsPane;
         _settingsPopup.SetValue(Canvas.LeftProperty, _windowBounds.Width - _settingsWidth);
         _settingsPopup.SetValue(Canvas.TopProperty, 0);
         _settingsPopup.IsOpen = true;
     });
     SettingsCommand privacyPolicyCommand = new SettingsCommand("privacyPolicy", "Privacy Policy", (x) =>
     {
         _settingsPopup = new Popup();
         _settingsPopup.Closed += _settingsPopup_Closed;
         Window.Current.Activated += Current_Activated;
         _settingsPopup.IsLightDismissEnabled = true;
         _settingsPopup.Width = _settingsWidth;
         _settingsPopup.Height = _windowBounds.Height;
         PrivacyPolicy settingsPane = new PrivacyPolicy();
         settingsPane.Width = _settingsWidth;
         settingsPane.Height = _windowBounds.Height;
         _settingsPopup.Child = settingsPane;
         _settingsPopup.SetValue(Canvas.LeftProperty, _windowBounds.Width - _settingsWidth);
         _settingsPopup.SetValue(Canvas.TopProperty, 0);
         _settingsPopup.IsOpen = true;
     });
     SettingsCommand registerCommand = new SettingsCommand("register", "Register", (x) =>
     {
         _settingsPopup = new Popup();
         _settingsPopup.Closed += _settingsPopup_Closed;
         Window.Current.Activated += Current_Activated;
         _settingsPopup.IsLightDismissEnabled = true;
         _settingsPopup.Width = _settingsWidth;
         _settingsPopup.Height = _windowBounds.Height;
         RegisterUser settingsPane = new RegisterUser();
         settingsPane.Width = _settingsWidth;
         settingsPane.Height = _windowBounds.Height;
         _settingsPopup.Child = settingsPane;
         _settingsPopup.SetValue(Canvas.LeftProperty, _windowBounds.Width - _settingsWidth);
         _settingsPopup.SetValue(Canvas.TopProperty, 0);
         _settingsPopup.IsOpen = true;
     });
     args.Request.ApplicationCommands.Add(settingsCommand);
     args.Request.ApplicationCommands.Add(registerCommand);
     args.Request.ApplicationCommands.Add(privacyPolicyCommand);
 }
开发者ID:Riveu,项目名称:Riveu.Notifications.Windows8,代码行数:55,代码来源:MainPage.xaml.cs

示例5: SettingsCommandsRequested

        private void SettingsCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            SettingsCommand about_cmd = new SettingsCommand("about", "About", (x) =>
            {
                _settingsPopup = new Popup();
                _settingsPopup.Closed += OnPopupClosed;
                Window.Current.Activated += OnWindowActivated;
                _settingsPopup.IsLightDismissEnabled = true;
                _settingsPopup.Width = _settingsWidth;
                _settingsPopup.Height = _windowBounds.Height;

                SettingsAboutView mypane = new SettingsAboutView();
                //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(about_cmd);

            SettingsCommand logout_cmd = new SettingsCommand("logout", "Log out", (x) =>
            {
                var vault = new PasswordVault();
                vault.Remove(vault.Retrieve("Sovok.tv WinApp", App.ViewModel.UserAccount.login));
                bool nav = Frame.Navigate(typeof(Login));
                App.ViewModel = new Model.MainViewModel();
            });

            args.Request.ApplicationCommands.Add(logout_cmd);

            SettingsCommand settings_cmd = new SettingsCommand("settings", "Settings", (x) =>
            {
                _settingsPopup = new Popup();
                _settingsPopup.Closed += OnPopupClosed;
                Window.Current.Activated += OnWindowActivated;
                _settingsPopup.IsLightDismissEnabled = true;
                _settingsPopup.Width = _settingsWidth;
                _settingsPopup.Height = _windowBounds.Height;

                SettingsView mypane = new SettingsView();
                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(settings_cmd);
        }
开发者ID:legator,项目名称:SovokTV,代码行数:54,代码来源:PlayerPage.xaml.cs

示例6: ItemViewModel

        public ItemViewModel ()
        {
            assignmentViewModel = ServiceContainer.Resolve<AssignmentViewModel> ();

            saveAssignmentItemCommand = new DelegateCommand (obj => {
                var item = obj as AssignmentItem;
                if (item != null && assignmentViewModel.SelectedAssignment != null) {
                    SaveAssignmentItemAsync (assignmentViewModel.SelectedAssignment, item);
                }
            });

            searchItemsCommand = new DelegateCommand (async _ => {
                await LoadItemsAsync ();
                var items = new List<Item> ();
                foreach (var item in Items) {
                    if (item.Name.ToLower ().Contains (SearchText.ToLower ()) || item.Number.ToLower ().Contains (SearchText.ToLower ())) {
                        items.Add (item);
                    }
                }
                SearchItems = items;
            });

            addItemCommand = new DelegateCommand (_ => {
                if (addItemPopUp != null && addItemPopUp.IsOpen) {
                    addItemPopUp.IsOpen = false;
                }
                addItemPopUp = new Popup ();
                addItemPopUp.Height = Window.Current.Bounds.Height;
                addItemPopUp.Width = Constants.PopUpWidth;
                AddItemFlyoutPanel flyoutpanel = new AddItemFlyoutPanel ();
                flyoutpanel.Width = addItemPopUp.Width;
                flyoutpanel.Height = addItemPopUp.Height;
                addItemPopUp.Child = flyoutpanel;
                addItemPopUp.SetValue (Canvas.LeftProperty, Window.Current.Bounds.Width - Constants.PopUpWidth);
                addItemPopUp.SetValue (Canvas.TopProperty, 0);
                addItemPopUp.IsOpen = true;
                SearchText = string.Empty;
                SearchItemsCommand.Invoke ();
            });

            cancelAddItemCommand = new DelegateCommand (_ => {
                addItemPopUp.IsOpen = false;
            });

            deleteItemCommand = new DelegateCommand (async _ => {
                if (selectedItem != null) {
                    await DeleteAssignmentItemAsync (assignmentViewModel.SelectedAssignment, selectedItem);
                    await LoadAssignmentItemsAsync (assignmentViewModel.SelectedAssignment);
                }
            });
        }
开发者ID:EminosoftCorp,项目名称:prebuilt-apps,代码行数:51,代码来源:ItemViewModel.cs

示例7: onGeneralSettingsCommand

 void onGeneralSettingsCommand(IUICommand command)
 {
     settingsPopup = setupSettings(settingsPopup);
     SettingsFlyout.StandardFlyout generalpane = new SettingsFlyout.StandardFlyout();
     generalpane.Width = settingsWidth;
     generalpane.Height = windowBounds.Height;
     // Place the SettingsFlyout inside our Popup window.
     settingsPopup.Child = generalpane;
     
     // Let's define the location of our Popup.
     settingsPopup.SetValue(Canvas.LeftProperty, SettingsPane.Edge == SettingsEdgeLocation.Right ? (windowBounds.Width - settingsWidth) : 0);
     settingsPopup.SetValue(Canvas.TopProperty, 0);
     settingsPopup.IsOpen = true;
 }
开发者ID:TimothyJames,项目名称:SIG-Windows8,代码行数:14,代码来源:SettingsCharm.cs

示例8: onHelpSettingsCommand

 void onHelpSettingsCommand(IUICommand command)
 {
     helpPopup = setupSettings(helpPopup);
     SettingsFlyout.HelpFlyout helppane = new SettingsFlyout.HelpFlyout();
     helppane.Width = settingsWidth;
     helppane.Height = windowBounds.Height;
     // Place the SettingsFlyout inside our Popup window.
     helpPopup.Child = helppane;
     
     // Let's define the location of our Popup.
     helpPopup.SetValue(Canvas.LeftProperty, SettingsPane.Edge == SettingsEdgeLocation.Right ? (windowBounds.Width - settingsWidth) : 0);
     helpPopup.SetValue(Canvas.TopProperty, 0);
     helpPopup.IsOpen = true;
 }
开发者ID:TimothyJames,项目名称:SIG-Windows8,代码行数:14,代码来源:SettingsCharm.cs

示例9: Handler

 private void Handler(IUICommand command)
 {
     _popUp = new Popup
     {
         Width = WIDTH,
         Height = _window.Height,
         IsLightDismissEnabled = true,
         IsOpen = true
     };
     _popUp.Closed += OnPopupClosed;
     Window.Current.Activated += OnWindowActivated;
     _popUp.Child = new AboutSettings { Width = WIDTH, Height = _window.Height };
     _popUp.SetValue(Canvas.LeftProperty, SettingsPane.Edge == SettingsEdgeLocation.Right ? (_window.Width - WIDTH) : 0);
     _popUp.SetValue(Canvas.TopProperty, 0);
 }
开发者ID:varunhisaria,项目名称:Noughts-And-Crosses,代码行数:15,代码来源:MainPage.xaml.cs

示例10: 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

示例11: OpenPopup

        private void OpenPopup(int width, UserControl child)
        {
            var settingsPopup = new Popup
            {
                IsLightDismissEnabled = true,
                Width = width,
                Height = Window.Current.Bounds.Height
            };

            child.Width = width;
            child.Height = Window.Current.Bounds.Height;
            settingsPopup.Child = child;
            settingsPopup.SetValue(Canvas.LeftProperty, Window.Current.Bounds.Width - width);
            settingsPopup.SetValue(Canvas.TopProperty, 0);
            settingsPopup.IsOpen = true;
        }
开发者ID:BerserkerDotNet,项目名称:UniversalWorldClock,代码行数:16,代码来源:MainPage.xaml.cs

示例12: BuildSettingsItem

        public static Popup BuildSettingsItem(UserControl userControl, int width)
        {
            var popup = new Popup();

            popup.IsLightDismissEnabled = true;
            userControl.Width = width;
            userControl.Height = Window.Current.Bounds.Height;

            popup.Child = userControl;

            popup.SetValue(Canvas.LeftProperty, Window.Current.Bounds.Width - width);
            popup.SetValue(Canvas.TopProperty, 0);
            popup.IsOpen = true;

            return popup;
        }
开发者ID:radu-ungureanu,项目名称:Haxball.Gr-Viewer,代码行数:16,代码来源:SettingsCharmExtensions.cs

示例13: SettingsWindow

        /// <summary>
        /// Creates a new instance of <see cref="SettingsWindow"/>
        /// </summary>
        /// <param name="applicationBoundingRectangle">The bounding rectangle of the parent application.</param>
        /// <param name="settingsElement">The element that will be wrapped by the <see cref="SettingsWindow"/>.</param>
        /// <param name="settingWidth">The width of the settings pane.  Defaults to 346px.</param>
        private SettingsWindow(Rect applicationBoundingRectangle, FrameworkElement settingsElement, double settingWidth = 346)
        {
            _settingsPopup = new Popup();
            _settingsPopup.Closed += (s, e) => Window.Current.Activated -= OnWindowActivated;
            Window.Current.Activated += OnWindowActivated;
            _settingsPopup.IsLightDismissEnabled = true;
            _settingsPopup.Width = settingWidth;
            _settingsPopup.Height = applicationBoundingRectangle.Height;

            settingsElement.Width = settingWidth;
            settingsElement.Height = applicationBoundingRectangle.Height;

            _settingsPopup.Child = settingsElement;
            _settingsPopup.SetValue(Canvas.LeftProperty, applicationBoundingRectangle.Width - settingWidth);
            _settingsPopup.SetValue(Canvas.TopProperty, 0);
            _settingsPopup.IsOpen = true;
        }
开发者ID:robrodi,项目名称:TfsRT,代码行数:23,代码来源:SettingsWindow.cs

示例14: ShowFlyout

        /// <summary>
        /// Display a user control inside a screen popup window
        /// </summary>
        /// <param name="control"></param>
        public void ShowFlyout(UserControl control)
        {
            _popup = new Popup();
            _popup.Closed += OnPopupClosed;
            Window.Current.Activated += OnWindowActivated;
            _popup.IsLightDismissEnabled = true;
            _popup.Width = _width;
            _popup.Height = Window.Current.Bounds.Height;

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

            _popup.Child = control;
            _popup.SetValue(Canvas.LeftProperty, Window.Current.Bounds.Width - _width);
            _popup.SetValue(Canvas.TopProperty, 0);
            _popup.IsOpen = true;
        }
开发者ID:rootdevelop,项目名称:Sunny,代码行数:21,代码来源:SettingsFlyout.cs

示例15: LaborViewModel

 public LaborViewModel ()
 {
     assignmentViewModel = ServiceContainer.Resolve<AssignmentViewModel> ();
     cancelAddLaborCommand = new DelegateCommand (_ => {
         addLaborPopUp.IsOpen = false;
     });
     saveAddLaborCommand = new DelegateCommand (async _ => {
         selectedLabor.Hours = TimeSpan.FromHours (currentLaborHours.ToDouble (CultureInfo.InvariantCulture));
         selectedLabor.AssignmentId = assignmentViewModel.SelectedAssignment.Id;
         await SaveLaborAsync (assignmentViewModel.SelectedAssignment, selectedLabor);
         await LoadLaborHoursAsync (assignmentViewModel.SelectedAssignment);
         addLaborPopUp.IsOpen = false;
     });
     deleteAddLaborCommand = new DelegateCommand (async _ => {
         await DeleteLaborAsync (assignmentViewModel.SelectedAssignment, selectedLabor);
         await LoadLaborHoursAsync (assignmentViewModel.SelectedAssignment);
         addLaborPopUp.IsOpen = false;
     });
     addLaborCommand = new DelegateCommand (obj => {
         var labor = obj as Labor;
         if (labor != null) {
             SelectedLabor = labor;
             AddLaborHeader = "Labor";
             CanDelete = true;
         } else {
             SelectedLabor = new Labor ();
             AddLaborHeader = "Add Labor";
             CanDelete = false;
         }
         if (addLaborPopUp != null && addLaborPopUp.IsOpen) {
             addLaborPopUp.IsOpen = false;
         }
         addLaborPopUp = new Popup ();
         addLaborPopUp.Height = Window.Current.Bounds.Height;
         addLaborPopUp.Width = Constants.PopUpWidth;
         AddLaborFlyoutPanel flyoutpanel = new AddLaborFlyoutPanel ();
         flyoutpanel.Width = addLaborPopUp.Width;
         flyoutpanel.Height = addLaborPopUp.Height;
         addLaborPopUp.Child = flyoutpanel;
         addLaborPopUp.SetValue (Canvas.LeftProperty, Window.Current.Bounds.Width - Constants.PopUpWidth);
         addLaborPopUp.SetValue (Canvas.TopProperty, 0);
         addLaborPopUp.IsOpen = true;
     });
 }
开发者ID:EminosoftCorp,项目名称:prebuilt-apps,代码行数:44,代码来源:LaborViewModel.cs


注:本文中的Windows.UI.Xaml.Controls.Primitives.Popup.SetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。