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


C# ChildWindow.Show方法代码示例

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


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

示例1: MainWindow

		public MainWindow()
		{
			InitializeComponent();

			CollectGarbageCommand = new RelayCommand<object>(o =>
			{
				GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);
			});

			RaiseEventCommand = new RelayCommand<object>(o =>
			{
				var handler = EventOrdinary;
				if (handler != null)
					handler(this, DateTime.Now.ToString());

				_weakEvent.Raise(this, DateTime.Now.ToString());
				_weakEventSource.Raise(this, DateTime.Now.ToString());
				_asyncWeakEvent.RaiseAsync(this, DateTime.Now.ToString());
			});

			OpenChildWindowCommand = new RelayCommand<object>(o =>
			{
				var w = new ChildWindow(this);
				w.WindowStartupLocation = WindowStartupLocation.CenterScreen;
				w.Show();
			});
		}
开发者ID:taori,项目名称:Amusoft,代码行数:27,代码来源:MainWindow.xaml.cs

示例2: mmf_DoubleClick

        private void mmf_DoubleClick(object sender, MouseButtonEventArgs e)
        {
            TimeSpan span;

            if (sender == lastClickItem)
            {
                DateTime now = DateTime.Now;
                span = now - lastClicked;

                if (span.Milliseconds < 300)
                {

                    var child = new ChildWindow();
                    child.Show();
                    child.Closed += delegate {

                                    };
                }
                else
                {
                    lastClickItem = null;
                }
            }

            lastClicked = DateTime.Now;
            lastClickItem = sender;
        }
开发者ID:benjito,项目名称:Projects,代码行数:27,代码来源:MainPage.xaml.cs

示例3: Button_Click

 private void Button_Click(object sender, RoutedEventArgs e)
 {
     ChildWindow window = new ChildWindow();
     window.Owner = this;
     ChildWindowCount.Content = "Child Window count = " + OwnedWindows.Count.ToString();
     window.Show();
 }
开发者ID:fan123777,项目名称:WPF_Unleashed,代码行数:7,代码来源:TestWindow.xaml.cs

示例4: Show

        /// <summary>
        /// Show popup window whichs is special, has special message
        /// </summary>
        /// <param name="childWindow"></param>
        /// <param name="message"></param>
        public static void Show(ChildWindow childWindow, MessageItem message)
        {
            if (childWindow != null) {
                _instance = childWindow;
                _instance.Show();

                Messenger.Default.Send<MessageItem>(message);
            }
        }
开发者ID:CanhNguyenVan,项目名称:ooad-dev,代码行数:14,代码来源:PopupService.cs

示例5: OKButton_Click

 private void OKButton_Click(object sender, RoutedEventArgs e)
 {
     this.Close();
     ChildWindow chol = new ChildWindow();
     chol.Height = 2400;
     chol.Width = 2300;
     //SL_Project_UI.MainPage mp = new SL_Project_UI.MainPage();
     //mp.Visibility = Visibility.Collapsed;
     chol.Show();
 }
开发者ID:JuRogn,项目名称:OA,代码行数:10,代码来源:LogoutWindow.xaml.cs

示例6: OpenWindow

 public void OpenWindow(ViewModelBase viewModel, Action onClosed)
 {
     var childWindow = new ChildWindow
                           {
                               Content = GetViewForViewModel(viewModel)
                           };
     var canClose = viewModel as ICanClose;
     if (canClose != null)
     {
         canClose.RequestClose += (s,e) => childWindow.Close();
     }
     childWindow.Closed += (s,e) => onClosed();
     childWindow.Show();
 }
开发者ID:Agies,项目名称:Silverlight-Architecture,代码行数:14,代码来源:IWindowOpenMediator.cs

示例7: Render

        /// <summary>
        /// Renders this view.
        /// </summary>
        public override void Render()
        {
            var dispatcher = ControllerContext.Request.Navigator.Dispatcher;

            dispatcher.Dispatch(
                delegate
                {
                    TraceSources.MagellanSource.TraceInformation("The WindowViewEngine is instantiating the window '{0}'.", _type);

                    // Prepare the window
                    RenderedInstance = (ChildWindow)_viewActivator.Instantiate(_type);
                    WireModelToView(RenderedInstance);

                    TraceSources.MagellanSource.TraceVerbose("The ChildWindowViewEngine is rendering the window '{0}' as a dialog.", _type);
                    RenderedInstance.Show();
                });
        }
开发者ID:p69,项目名称:magellan-framework,代码行数:20,代码来源:ChildWindowViewEngineResult.cs

示例8: ShowConfigDialog

        private void ShowConfigDialog(MainViewModel mainViewModel)
        {
            var win = new ChildWindow();
            win.Title = "Configure";

            var configViewModel = new ConfigViewModel(mainViewModel.AgentConfig);
            configViewModel.Removed += mainViewModel.OnNodeRemoved;
            configViewModel.Updated += mainViewModel.OnNodeUpdated;
            configViewModel.Added += mainViewModel.OnNodeAdded;

            win.Content = new ConfigPanel()
            {
                DataContext = configViewModel
            };

            win.Width = 600;
            win.Height = 300;
            win.Show();
        }
开发者ID:RocChing,项目名称:SuperSocket,代码行数:19,代码来源:MainPanel.xaml.cs

示例9: OnConfigCommandMessage

        private void OnConfigCommandMessage(ConfigCommandMessage message)
        {
            var window = new ChildWindow();
            var contentControl = new NewEditServer();
            contentControl.DataContext = new EditServerDetailViewModel(message.Server);
            window.Content = contentControl;
            window.Closed += (s, e) =>
            {
                Messenger.Default.Unregister<CloseEditServerMessage>(this);
                Application.Current.RootVisual.SetValue(Control.IsEnabledProperty, true);
            };

            Messenger.Default.Register<CloseEditServerMessage>(this, (m) =>
            {
                window.DialogResult = false;
                window.Close();
            });

            window.Show();
        }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:20,代码来源:MainPage.xaml.cs

示例10: MainPage

        public MainPage()
        {
            InitializeComponent();
            Loaded += MainPage_Loaded;

            Messenger.Default.Register<Player>(this, (player) =>
            {
                var dialog = new ChangePlayerNameDialogView();
                Messenger.Default.Send<Player, ChangePlayerNameDialogViewModel>(player);
                dialog.Show();
            });
            Messenger.Default.Register<SticksAIPlayer>(this, Tokens.EducationEnded, (player) =>
            {
                var educationResult = new ChildWindow();
                educationResult.Content = new TextBlock() { Text = player.Name + " is ready for battle!" };
                educationResult.Show();
            });
            Messenger.Default.Register<Tuple<Player, Player>>(this, Tokens.GameEnded, (playersPair) =>
            {
                var gameResult = new ChildWindow();
                gameResult.Content = new TextBlock() { Text = GameOverMessage.GetRandom(playersPair.Item1.Name, playersPair.Item2.Name) };
                gameResult.Show();
            });
        }
开发者ID:Yankovsky,项目名称:EvilSticks,代码行数:24,代码来源:MainPage.xaml.cs

示例11: ContentFrame_NavigationFailed

 // If an error occurs during navigation, show an error window
 private void ContentFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
 {
     e.Handled = true;
     ChildWindow errorWin = new ChildWindow{Content = new TextBlock{Text = e.Exception.ToString()}};
     errorWin.Show();
 }
开发者ID:andypaxo,项目名称:Slick-Scrumy,代码行数:7,代码来源:MainPage.xaml.cs

示例12: ShowUnsavedChangesDialog

        public void ShowUnsavedChangesDialog(Action subsequentAction)
        {
            var saveButton = new Button()
            {
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment = VerticalAlignment.Bottom,
                Margin = new Thickness(8),
                Content = "Save",
                Width = 100
            };
            saveButton.Click += delegate(object sender, RoutedEventArgs e)
            {
                (((sender as Button).Parent as Grid).Parent as ChildWindow).Close();
                Save();
                subsequentAction();
            };

            var dontSaveButton = new Button()
            {
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Bottom,
                Margin = new Thickness(8),
                Content = "Don't Save",
                Width = 100
            };
            dontSaveButton.Click += delegate(object sender, RoutedEventArgs e)
            {
                (((sender as Button).Parent as Grid).Parent as ChildWindow).Close();
                subsequentAction();
            };

            var cancelButton = new Button()
            {
                HorizontalAlignment = HorizontalAlignment.Right,
                VerticalAlignment = VerticalAlignment.Bottom,
                Margin = new Thickness(8),
                Content = "Cancel",
                Width = 100
            };
            cancelButton.Click += delegate(object sender, RoutedEventArgs e)
            {
                (((sender as Button).Parent as Grid).Parent as ChildWindow).Close();
            };

            TextBlock text = new TextBlock();
            string drawingName = drawingHost.CurrentDrawing.Name;
            if (drawingName == null) drawingName = "untitled";
            text.Text = "Do you want to save changes to \"" + drawingName + "\"?";

            Grid grid = new Grid()
            {
                Width = 360
            };
            grid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            Grid.SetRow(text, 0);
            Grid.SetRow(dontSaveButton, 1);
            Grid.SetRow(saveButton, 1);
            Grid.SetRow(cancelButton, 1);
            grid.Children.Add(text, saveButton, dontSaveButton, cancelButton);

            var unsavedChangesWindow = new ChildWindow()
            {
                Content = grid
            };
            unsavedChangesWindow.HasCloseButton = false;
            unsavedChangesWindow.Show();
        }
开发者ID:wcatykid,项目名称:GeoShader,代码行数:68,代码来源:UI.cs

示例13: LogoutTimerTick

        private void LogoutTimerTick( object sender, EventArgs e )
        {
            ( ( DispatcherTimer )sender ).Stop ();

            // The main logout time has expired. Show the log out warning prompt.
            LogOutWarning = new LogOutWarningView ( response.WarningTimeOutIntervalSeconds );
            LogOutWarning.Closed += LogOutWarningClosed;
            LogOutWarning.Show ();

            // Start the warning timer.
            _warningLogoutTimer.Interval = TimeSpan.FromSeconds ( response.WarningTimeOutIntervalSeconds );
            _warningLogoutTimer.Tick += WarningLogoutTimerTick;
            _warningLogoutTimer.Start ();
        }
开发者ID:divyang4481,项目名称:REM,代码行数:14,代码来源:Shell.xaml.cs

示例14: newChildWindowButton_Click

 private void newChildWindowButton_Click(object sender, RoutedEventArgs e)
 {
     // Create a new skind child window
     var window = new ChildWindow();
     window.Show();
 }
开发者ID:ClemensT,项目名称:WPF-Samples,代码行数:6,代码来源:MainWindow.cs

示例15: PopupMessage

        public static ChildWindow PopupMessage(string title, string message, string closeButtonLabel, bool closeWindow)
        {
            if (CurrentPopup != null)
                return null;

            var msgBox = new ChildWindow();
            CurrentPopup = msgBox;
            
            msgBox.Style = Application.Current.Resources["PopupMessageWindow"] as Style;
            msgBox.BorderBrush = new SolidColorBrush(Color.FromArgb(0xFF, 0xBA, 0xD2, 0xEC));
            msgBox.Title = title;
            msgBox.MaxWidth = Application.Current.Host.Content.ActualWidth * 0.5;

            StackPanel content = new StackPanel();
            content.Children.Add(new TextBlock() { Text = message, Margin = new Thickness(20), Foreground = new SolidColorBrush(Colors.White), FontSize = 14, HorizontalAlignment=HorizontalAlignment.Center });

            Button closeButton = new Button { Content = closeButtonLabel, FontSize = 14, HorizontalAlignment = HorizontalAlignment.Center, Margin = new Thickness(20) };
            closeButton.Click += (s, o) =>
                                     {
                                         msgBox.Close();
                                         if (closeWindow)
                                         {
                                             BrowserWindow.Close();
                                         }
                                     };
            content.Children.Add(closeButton);
            msgBox.Content = content;
            msgBox.IsTabStop = true;
            
            msgBox.Show();
            msgBox.Focus();
            
            _currentWindow = msgBox;
            PopupManager.CloseActivePopup();
            return msgBox;
        }
开发者ID:nhannd,项目名称:Xian,代码行数:36,代码来源:PopupHelper.cs


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