private static string AskForInput(UserInputOptions options) { var viewModel = new UserInputViewModel() { Message = options.Message, Text = options.DefaultText, Icon = options.Icon, InputTest = options.InputTest }; var window = new System.Windows.Window(); var control = new UserInputWindow() { window = window, context = viewModel, DataContext = viewModel, }; window.Content = control; window.Width = options.Width; window.WindowStyle = System.Windows.WindowStyle.ThreeDBorderWindow; window.Height = options.Height; window.Title = options.Title; window.ResizeMode = System.Windows.ResizeMode.NoResize; window.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; window.ShowDialog(); return(viewModel.Text); }
private void carSelect_ItemClick(object sender, ItemClickEventArgs e) { System.Windows.Window wnd = new System.Windows.Window(); wnd.CommandBindings.Add(new System.Windows.Input.CommandBinding(Commands.OK, OnCompareCarSelect)); System.Windows.ResourceDictionary res = new System.Windows.ResourceDictionary(); res.BeginInit(); res.Source = new Uri("pack://application:,,,/Assistant;component/Template/CarTypeSelector.xaml"); res.EndInit(); wnd.Style = res["carTypeSelector"] as System.Windows.Style; wnd.ShowInTaskbar = false; wnd.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; CarTypeSelector selector = new CarTypeSelector(); if (selectedNode != null) { selector.SelectedItem = selectedNode.Header; } wnd.Content = selector; wnd.DataContext = selector; if (wnd.ShowDialog() == true) { selectedNode = selector.Tree.Children[0] as RuleCompareNode; comparer = new RuleComparer(selectedNode, mainWebBrowser); } }
public void Test() { System.Windows.Window Window = new System.Windows.Window(); Window.Content = new TablePanelTestContainer(); Window.DataContext = new TablePanelTestContainerValues(); Window.ShowDialog(); }
public void ShowViewWithMockServiceAndLoadedAppStorage() { AppBuilderView builderView = CreateViewAndViewModelViaMockService(); WpfWindow window = CreateTestWindow(builderView); window.ShowDialog(); }
public void ShowViewWithIncreasingProgressOnMouseDoubleClick() { AppBuilderView builderView = CreateViewAndViewModelViaMockService(); WpfWindow window = CreateTestWindow(builderView); window.MouseDoubleClick += (sender, e) => UpdateBuildProgress(builderView, 10); window.ShowDialog(); }
/// <summary> /// Muestra un cuadro de diálogo /// </summary> public SystemControllerEnums.ResultType ShowDialog(System.Windows.Window owner, System.Windows.Window view) { // Muestra el formulario activo view.Owner = owner; view.ShowActivated = true; // Muestra el formulario y devuelve el resultado return(ConvertDialogResult(view.ShowDialog())); }
public void ShowInfoDialogWhenNoSolutionProjectIsAvailableForContentProject() { AppBuilderView builderView = CreateViewAndViewModelViaMockService(); WpfWindow window = CreateTestWindow(builderView); window.MouseDoubleClick += (sender, e) => service.ChangeProject("NonExistingProject"); window.ShowDialog(); }
public void ShowViewWithMockServiceWithEngineContentProjects() { service.SetAvailableProjects("LogoApp", "GhostWars", "Insight", "DeltaEngine.Tutorials"); AppBuilderView builderView = CreateViewAndViewModelViaMockService(); WpfWindow window = CreateTestWindow(builderView); window.ShowDialog(); }
public void ShowViewWithMockServiceToVisualizeSwitchingBetweenBothLists() { AppBuilderView builderView = CreateViewAndViewModelViaMockService(); AppBuilderViewModel viewModel = builderView.ViewModel; WpfWindow window = CreateTestWindow(builderView); window.MouseDoubleClick += (sender, e) => FireAppBuildMessagesOnMouseDoubleClick(e, viewModel); window.ShowDialog(); }
public static void OpenWindow() { var w = new System.Windows.Window(); w.SizeToContent = System.Windows.SizeToContent.WidthAndHeight; w.Content = new TheCanvas(); w.ShowDialog(); }
public static Task <Microsoft.SharePoint.Client.ClientContext> GetAuthenticatedContext(string sharepointSiteUrl) { // see: https://stackoverflow.com/questions/15316613/when-should-taskcompletionsourcet-be-used var promise = new TaskCompletionSource <Microsoft.SharePoint.Client.ClientContext>(); UseWPFThread(() => { var win = new System.Windows.Window(); var webBrowser = new WebBrowser(); win.Content = webBrowser; webBrowser.Navigated += (_s, _args) => { var cookies = CookieReader.GetCookieCollection(_args.Uri) .OfType <Cookie>(); var FedAuth = cookies.FirstOrDefault(c => string.Equals("FedAuth", c.Name, StringComparison.OrdinalIgnoreCase)); var rtfa = cookies.FirstOrDefault(c => string.Equals("rtFa", c.Name, StringComparison.OrdinalIgnoreCase)); if (FedAuth != null && rtfa != null) { // from: http://jcardy.co.uk/creating-a-sharepoint-csom-clientcontext-with-an-authentication-cookie/ var context = new Microsoft.SharePoint.Client.ClientContext(_args.Uri); context.ExecutingWebRequest += (sender, e) => { e.WebRequestExecutor.WebRequest.Headers[HttpRequestHeader.Cookie] = "FedAuth=" + FedAuth.Value + ";rtFa=" + rtfa.Value; }; if (!promise.Task.IsCompleted) { promise.SetResult(context); } win.Close(); // we are done so close the window } }; win.Closed += (_s, _args) => { if (!promise.Task.IsCompleted) { throw new Exception("Window closed before got authentication"); } }; // make this one of the last things that happens webBrowser.Navigate(sharepointSiteUrl); win.ShowDialog(); });// end of wpf thread return(promise.Task); }
public void ShowParticleEditorViewInWindow() { var window = new Window { Title = "WPF Test - UserControl ParticleEditorView", Content = new ParticleEditorView() }; window.ShowDialog(); }
protected override void OpenWindow(System.Windows.Window wnd) { //Do the pre open dialog method before showing the dialog _ViewModel.PreOpenDialog(); //Show the dialog bool?result = wnd.ShowDialog(); //Send the result to the post open dialog method. _ViewModel.PostOpenDialog(result); }
public bool ShowDialog(System.Windows.Window dialog, DTE dte) { var hwnd = dte.MainWindow.HWnd; var helper = new WindowInteropHelper(dialog); helper.Owner = new IntPtr(hwnd); return(dialog.ShowDialog() ?? false); }
public void ShowDialog(Window window) { var uiShell = (IVsUIShell)ServiceProvider.GetService(typeof(SVsUIShell)); uiShell.EnableModeless(0); window.ShowDialog(); uiShell.EnableModeless(1); }
public static bool?ShowHostDialog(this System.Windows.Window window) { Process process = Process.GetCurrentProcess(); IntPtr mainWindowHandle = process.MainWindowHandle; var helper = new WindowInteropHelper(window); helper.Owner = mainWindowHandle; return(window.ShowDialog()); }
public static bool ShowModal(System.Windows.Window wnd) { wnd.ShowInTaskbar = false; wnd.Topmost = true; wnd.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; wnd.ResizeMode = Windows.ResizeMode.NoResize; // This hides window Minimize/Maximize buttons #if AutoCAD return(AcApp.ShowModalWindow(null, wnd, false).GetValueOrDefault(false)); #else return(wnd.ShowDialog().GetValueOrDefault(false)); #endif }
public override bool?ShowDialog(object rootModel, object context = null, IDictionary <string, object> settings = null) { System.Windows.Window window = CreateWindow(rootModel, true, context, settings); if (window == null) { return(false); } System.Windows.Interop.WindowInteropHelper helper = new System.Windows.Interop.WindowInteropHelper(window); helper.Owner = Autodesk.Windows.ComponentManager.ApplicationWindow; window.SourceInitialized += Window_SourceInitialized; window.SizeChanged += Window_SizeChanged; window.LocationChanged += Window_LocationChanged; return(window.ShowDialog()); }
public void ShowViewWithMockServiceAndDummyApps() { AppBuilderView builderView = CreateViewAndViewModelViaMockService(); AppBuilderViewModel viewModel = builderView.ViewModel; viewModel.AppListViewModel.AddApp( AppBuilderTestExtensions.GetMockAppInfo("My favorite app", PlatformName.Windows)); viewModel.AppListViewModel.AddApp(AppBuilderTestExtensions.GetMockAppInfo( "My mobile app", PlatformName.Android)); viewModel.AppListViewModel.AddApp(AppBuilderTestExtensions.GetMockAppInfo( "My cool web app", PlatformName.Web)); WpfWindow window = CreateTestWindow(builderView); window.ShowDialog(); }
private Task <bool?> OpenDialogAsync(System.Windows.Window dialog) { if (_activeDialog is not null) { CloseDialog(_activeDialog); } _activeDialog = dialog; _activeDialog.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; if (System.Windows.Application.Current.MainWindow != null && System.Windows.Application.Current.MainWindow.IsLoaded) { } _activeDialog.Owner = System.Windows.Application.Current.MainWindow; return(Task.FromResult(_activeDialog.ShowDialog())); }
internal bool?InternalShowModalWindow(System.Windows.Window window) { if (null == window) { throw new ArgumentNullException(nameof(window)); } window.Owner = TopmostModalWindow; _modalWindows.Push(window); try { return(window.ShowDialog()); } finally { _modalWindows.Pop(); } }
protected override void EndJob(JobHandle job) { try { if (_canvas != null) { Window window = new Window(); window.Content = _canvas; window.Title = job.Context.GraphName; window.SnapsToDevicePixels = true; window.ShowDialog(); } } finally { _canvas = null; } }
public static System.Windows.Window createMainWindow(Type window, bool dialogBox = false) { System.Windows.Window temp = views.Find(name => name.GetType().Equals(window)); if (temp == null) { temp = (System.Windows.Window)Activator.CreateInstance(window); views.Add(temp); } temp.Closed += onClose; if (dialogBox) { temp.ShowDialog(); } else { temp.Show(); } temp.Focus(); return(temp); }
private void OpenOrganizerFunc(object param) { var organizerVM = new ComponentLibraryOrganizerVM(m_componentsLibraryViewModel); var organizerView = new TraceLab.UI.WPF.Views.ComponentLibraryOrganizer(); organizerView.DataContext = organizerVM; var organizerWindow = new System.Windows.Window(); organizerWindow.Content = organizerView; foreach (System.Windows.Window window in System.Windows.Application.Current.Windows) { if (window.IsKeyboardFocusWithin) { organizerWindow.Owner = window; } } organizerWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner; organizerWindow.ShowActivated = true; organizerWindow.Title = "Component Tags Organizer"; organizerWindow.Icon = new BitmapImage(new Uri("pack://application:,,,/TraceLab.UI.WPF;component/Resources/Icon_Organizer16.png")); organizerWindow.ShowDialog(); }
static void Main(string[] args) { System.Windows.Window 視窗物件 = new System.Windows.Window(); 視窗物件.ShowDialog(); }
public static void ShowDialogInScreen(this System.Windows.Window win) { SetScreen(win); win.ShowDialog(); }
static void Main(string[] args) { System.Windows.Window window = new System.Windows.Window(); window.ShowDialog(); }
public void Test() { System.Windows.Window Window = new System.Windows.Window(); Window.Content = new ContentUnavailableTestContainer(); Window.ShowDialog(); }
private void OpenOrganizerFunc(object param) { var organizerVM = new ComponentLibraryOrganizerVM(m_componentsLibraryViewModel); var organizerView = new TraceLab.UI.WPF.Views.ComponentLibraryOrganizer(); organizerView.DataContext = organizerVM; var organizerWindow = new System.Windows.Window(); organizerWindow.Content = organizerView; foreach(System.Windows.Window window in System.Windows.Application.Current.Windows) { if(window.IsKeyboardFocusWithin) { organizerWindow.Owner = window; } } organizerWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner; organizerWindow.ShowActivated = true; organizerWindow.Title = "Component Tags Organizer"; organizerWindow.Icon = new BitmapImage(new Uri("pack://application:,,,/TraceLab.UI.WPF;component/Resources/Icon_Organizer16.png")); organizerWindow.ShowDialog(); }
protected void OpenWindow(object obj) { System.Windows.Window creationWindow = obj as System.Windows.Window; creationWindow.Owner = System.Windows.Application.Current.MainWindow; creationWindow.ShowDialog(); }