Version

Adding xamDialogWindow to Your Application

Before You Begin

This topic is designed to get you up and running as quickly as possible by describing the basic steps required for adding the xamDialogWindow™ control to your page using XAML.

What You Will Accomplish

You will add a basic xamDialogWindow control to your page.

Follow these Steps

  1. Create a Microsoft® WPF™ application.

  1. Add the following NuGet package to your application:

    • Infragistics.WPF.DialogWindow

    For more information on setting up the NuGet feed and adding NuGet packages, you can take a look at the following documentation: NuGet Feeds.

  1. Add the following using/Import directives in the code-behind and a namespace declaration in the opening Window tag.

    In XAML:

    xmlns:ig="http://schemas.infragistics.com/xaml"

    In Visual Basic:

    Imports Infragistics.Controls.Interaction

    In C#:

    using Infragistics.Controls.Interactions;
  1. Add the xamDialogWindow control to a Grid container named LayoutRoot.

    In XAML:

    <Grid x:Name="LayoutRoot">
        <ig:XamDialogWindow
            Width="200" Height="200"
            Content="This is a sample dialog window"
            IsModal="True" StartupPosition="Center" />
    </Grid>

    Create an instance of the xamDialogWindow control in the page constructor after the InitializeComponent method and add it to the Grid panel’s Children collection.

    In Visual Basic:

    Dim xamDialogWindow As New XamDialogWindow()
    xamDialogWindow.Width = 200
    xamDialogWindow.Height = 200
    xamDialogWindow.Content = "This is a sample dialog window"
    xamDialogWindow.IsModal = True
    xamDialogWindow.StartupPosition = StartupPosition.Center
    LayoutRoot.Children.Add(xamDialogWindow)

    In C#:

    XamDialogWindow xamDialogWindow = new XamDialogWindow();
    xamDialogWindow.Width = 200;
    xamDialogWindow.Height = 200;
    xamDialogWindow.Content = "This is a sample dialog window";
    xamDialogWindow.IsModal = true;
    xamDialogWindow.StartupPosition = StartupPosition.Center;
    LayoutRoot.Children.Add(xamDialogWindow);
  1. Save and run your application.

    Adding xamDialogWindow to Your Page Using XAML