Which XAML code fragment should you use?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You plan to add a Button control to a Canvas control. You need to ensure that exactly 10 device-independent pixels are present between the right side of the Button control and the right side of the Canvas control.
Which XAML code fragment should you use?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You plan to add a Button control to a Canvas control. You need to ensure that exactly 10 device-independent pixels are present between the right side of the Button control and the right side of the Canvas control.
Which XAML code fragment should you use?

A.
<Canvas Margin="10">
<Button>I’m a button</Button>
</Canvas>

B.
<Canvas>
<Button Canvas.Left="10" Canvas.Right="10">I’m a button</Button>
</Canvas>

C.
<Canvas Margin="10">
<Button HorizontalAlignment="Right">I’m a button</Button>
</Canvas>

D.
<Canvas>
<Button Canvas.Top="10" Canvas.Right="10">I’m a button</Button>
</Canvas>



Leave a Reply 0

Your email address will not be published. Required fields are marked *