سلام بر برنامه نویسان عزیز ایران زمین 😉 در این پست کد ساخت DialogBox ساده با wpf و سی شارپ #C را آماده کردم. انشاالله که این کد سی شارپ براتون مفید باشد.
تصاویر خروجی نهایی این کد:
کد ساخت DialogBox ساده با wpf و سی شارپ #C :
<Window x:Class="Styles.BasicDialogBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="BasicDialogBox" Height="300" Width="300" MinHeight="150" MinWidth="200">
<Window.Resources>
<Thickness x:Key="BasicMargin" Bottom="5" Top="5" Left="5" Right="5"></Thickness>
</Window.Resources>
<DockPanel LastChildFill="True">
<StackPanel DockPanel.Dock="Bottom" HorizontalAlignment="Right" Orientation="Horizontal">
<Button Margin="{StaticResource BasicMargin}" Padding="3,3,3,3">OK</Button>
<Button Margin="{StaticResource BasicMargin}" Padding="3,3,3,3">Cancel</Button>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="BasicDialogBox" Height="300" Width="300" MinHeight="150" MinWidth="200">
<Window.Resources>
<Thickness x:Key="BasicMargin" Bottom="5" Top="5" Left="5" Right="5"></Thickness>
</Window.Resources>
<DockPanel LastChildFill="True">
<StackPanel DockPanel.Dock="Bottom" HorizontalAlignment="Right" Orientation="Horizontal">
<Button Margin="{StaticResource BasicMargin}" Padding="3,3,3,3">OK</Button>
<Button Margin="{StaticResource BasicMargin}" Padding="3,3,3,3">Cancel</Button>