public bool ShowWindow(IDialogContent model) { var dialog = new DialogWindow(); dialog.SetContent(model); dialog.Show(); return true; }
/// <summary> /// Does the actual work of creating the dialog. Override this to create custom dialogs.</summary> /// <param name="content">The content to display</param> /// <returns>The created dialog</returns> public virtual IDialogContentHost CreateDialog(IDialogContent content) { var dialog = new CommonDialogHost(); dialog.Content = content; content.Host = dialog; return(dialog); }
public DialogViewer(IDialogContent dialogContent) { InitializeComponent(); DataContext = this; DialogContent = dialogContent; closeButton.Click += CloseButtonClick; ((ADialogContent)DialogContent).Closed += DialogContentClosed; }
/// <summary> /// Initializes a new instance of the <see cref="EmbeddedDialogContentHost"/> class.</summary> /// <param name="content">The content</param> /// <exception cref="System.ArgumentException">Content is null</exception> public EmbeddedDialogContentHost(IDialogContent content) { if (content == null) { throw new ArgumentException("context"); } var contentWrapper = new ContentControl(); contentWrapper.Content = content; contentWrapper.Margin = new Thickness(12); content.Host = this; m_dialogContent = contentWrapper; }
public MenuDialog(string title, IDialogContent contentModel) { var frame = new MenuDialogFrameModel(); frame.Title = title; Frame = frame; frame.Owner = this; Content = contentModel; contentModel.Owner = this; CloseOnTouchOutside = true; _clickStream = new Subject <IDialogButton>(); }
public override void Initialize(IDialogContent argument) { _model = (MenuDialogContentModel)argument; foreach (var item in _model.MenuItems) { var m = item; m.Owner = _model.Owner; var p = Instantiate(_menuDialogItemPrefab, _container.transform); p.OnClickAsObservable().Subscribe(_ => { _model.Owner.Click(m); }).AddTo(this); p.Initialize(m); } }
public ConfirmDialog(string title, IDialogContent contentModel, List <IDialogButton> buttons, ConfirmDialogSize size = ConfirmDialogSize.Medium, string templateName = "Confirm") { var frame = new ConfirmDialogFrameModel(); frame.Size = size; frame.Title = title; Frame = frame; frame.Owner = this; Content = contentModel; contentModel.Owner = this; Buttons = buttons; CloseOnTouchOutside = true; _clickStream = new Subject <IDialogButton>(); _templateName = templateName; }
public bool ShowModalWindow(IDialogContent model, Window parentWindow) { try { var dialog = new DialogWindow { Owner = parentWindow, }; dialog.SetContent(model); bool? result = dialog.ShowDialog(); if (result == null) { } return (bool)result; } catch (Exception) { throw; } }
public override void Initialize(IDialogContent argument) { var model = (ConfirmDialogContentModel)argument; _text.text = model.Text; }
/// <summary> /// Factory method to create dialogs</summary> /// <param name="content">The content to display</param> /// <returns>The created dialog</returns> public static IDialogContentHost Create(IDialogContent content) { return s_instance.CreateDialog(content); }
/// <summary> /// Initializes a new instance of the <see cref="EmbeddedDialogContentHost"/> class.</summary> /// <param name="content">The content</param> /// <exception cref="System.ArgumentException">Content is null</exception> public EmbeddedDialogContentHost(IDialogContent content) { if(content == null) throw new ArgumentException("context"); var contentWrapper = new ContentControl(); contentWrapper.Content = content; contentWrapper.Margin = new Thickness(12); content.Host = this; m_dialogContent = contentWrapper; }
/// <summary> /// Does the actual work of creating the dialog. Override this to create custom dialogs.</summary> /// <param name="content">The content to display</param> /// <returns> /// The created dialog</returns> public override IDialogContentHost CreateDialog(IDialogContent content) { return new EmbeddedDialogContentHost(content); }
/// <summary> /// Does the actual work of creating the dialog. Override this to create custom dialogs.</summary> /// <param name="content">The content to display</param> /// <returns>The created dialog</returns> public virtual IDialogContentHost CreateDialog(IDialogContent content) { var dialog = new CommonDialogHost(); dialog.Content = content; content.Host = dialog; return dialog; }
/// <summary> /// Does the actual work of creating the dialog. Override this to create custom dialogs.</summary> /// <param name="content">The content to display</param> /// <returns> /// The created dialog</returns> public override IDialogContentHost CreateDialog(IDialogContent content) { return(new EmbeddedDialogContentHost(content)); }
/// <summary> /// Factory method to create dialogs</summary> /// <param name="content">The content to display</param> /// <returns>The created dialog</returns> public static IDialogContentHost Create(IDialogContent content) { return(s_instance.CreateDialog(content)); }
public virtual void Initialize(IDialogContent argument) { }
public bool ShowModalWindow(IDialogContent model) { return ShowModalWindow(model, Application.Current.MainWindow); }