Archive for the ‘xaml’ tag
DoUNo: XAML gets compiled in to a BAML
What does a xaml file gets compiled in to ? It gets compiled in to a baml (binary xaml). More @ wikipedia.
You can find the .baml file in the \obj\Debug folder.
Transparent background with opaque controls on top of it in wpf
Ever felt like having a transparent window background and still opaque controls inside the window? It can be easily done in wpf.
- Set the window’s AllowsTransparency to True
- Set the window’s Background to Transparent
- Add a Rectangle to the parent panel of the window
- Set the opacity of the rectangle to some value < 1 (0.7, …)
- Add your controls to the parent panel
- You are one step away form seeing a transparent background with opaque controls on top of it. Go ahead, run the application now
Sample window,
<Window x:Class=”BackgroundWindow.Transparent.Samples.WPF.Window1″
xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
Title=”Window1″ Height=”300″ Width=”300″ AllowsTransparency=”True” Background=”Transparent” WindowStyle=”None”>
<Grid>
<Rectangle Fill=”Gray” Opacity=”0.7″ />
<Button Width=”100″ Height=”100″>Click this on</Button>
</Grid>
</Window>

