Example #1
0
 /// <summary>
 /// Shows the task dialog using an <see cref="InlineModalDialog"/>.
 /// </summary>
 /// <param name="owner"></param>
 public void ShowInline(DependencyObject owner)
 {
     _inlineModalDialog = new InlineModalDialog {
         Content = this, Owner = owner, Header = Title
     };
     _inlineModalDialog.Show();
 }
Example #2
0
 partial void OnClosed()
 {
     if (_inlineModalDialog != null)
     {
         _inlineModalDialog.Close();
         _inlineModalDialog = null;
     }
 }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     var dialog = new InlineModalDialog
     {
         Owner = this,
         Content = new DialogSampleContent(),
         Width = _rng.Next(100, (int)ActualWidth),
         Height = _rng.Next(100, (int)ActualHeight),
     };
     dialog.InputBindings.Add(new KeyBinding {Key = Key.Escape, Command = InlineModalDialog.CloseCommand});
     dialog.Show();
 }
 private void BrowseClick(object sender, RoutedEventArgs e)
 {
     _dialog = new InlineModalDialog
     {
         Owner = this,
         Content = new CategoriesView { DataContext = ViewModel },
         Margin = new Thickness(40),
         HorizontalAlignment = HorizontalAlignment.Stretch,
         VerticalAlignment = VerticalAlignment.Stretch,
     };
     _dialog.InputBindings.Add(new KeyBinding(InlineModalDialog.CloseCommand, Key.Escape, ModifierKeys.None));
     _dialog.Show();
 }
        private static void OnTargetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var oldValue = (UIElement)e.OldValue;

            if (oldValue != null)
            {
                InlineModalDialog.ClearModalDecorator(oldValue);
            }
            var newValue = (UIElement)e.NewValue;

            if (newValue != null)
            {
                InlineModalDialog.SetModalDecorator(newValue, (InlineModalDecorator)d);
            }
        }