I have created two buttons using the following XAML
code.
<Button x:Name="Button1" Width="100" Content="Button1" HorizontalAlignment="Left" VerticalAlignment="Top" ></Button>
<Button x:Name="Button2" Width="100" Content="Button2" HorizontalAlignment="Left" VerticalAlignment="Top" ></Button>
The two buttons are tightly touching each other. How to put some space between them?
Note: The buttons are located inside a stackpanel with Horizontal orientation.
If you do not use (for some reason) Button's Margin property, you can put transparent Separator (Transparent background color) with desired Width (or/and Height) between your controls (Buttons in your case).
In xaml:
<StackPanel Orientation="Horizontal">
<Button x:Name="Button1" Width="100" Content="Button1"/>
<Separator Width="20" Background="Transparent"/>
<Button x:Name="Button2" Width="100" Content="Button2"/>
</StackPanel>