DialogBox API | WPF | C# | Saatody | Amit Padhiyar
DialogBox Class API
DialogBox API is providing small widget to create custom dialog box.
Constructure
This is one and default constructor.
Syntax
public DialogBox()
Show (DialogBox DialogBox) Methods
Show dialog box by calling this method.
Syntax
public static void Show(DialogBox DialogBox)
Close (DialogBox DialogBox) Methods
Close dialog box by calling this method.
Syntax
public static void Close(DialogBox DialogBox)
Example
XAML
<gui:DialogBox
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Custom Box" Width="800" Height="700">
<Grid>
</Grid>
</gui:DialogBox>
C#
using GUI = Example.Commons.GUI;
namespace Example
{
public partial class CustomBox : GUI.DialogBox
{
public CustomBox()
{
InitializeComponent();
this.Closing += (sender, e) =>
{
GUI.DialogBox.Close(this);
};
}
}
}
Show DialogBox
CustomBox = new CustomBox();
CustomBox.Owner = AnotherWindow;
GUI.DialogBox.Show(CustomBox);
Comments
Post a Comment