XAML

W

west.rohan

Hi, i have just installed VS2008 and was working on a simple WPF
application.

I created the following XAML, it produced a simple rectangle with a
reflection at the bottom. When i run the app, it looks totally
different from when it was in the designer? Why?

<Window x:Class="Reflection.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:r="clr-namespace:Reflection"
Title="Reflection" Height="500" Width="500">
<Grid>
<StackPanel HorizontalAlignment="Center" >
<Canvas x:Name="canvas" Width="478" Height="231">
<Rectangle Fill="Black" Width="50" Height="50"
Canvas.Left="143.75" Canvas.Top="108.75" />
</Canvas>
<Canvas Width="478" Height="231">
<Rectangle Width="478" Height="231">
<Rectangle.Fill>
<VisualBrush Visual="{Binding
ElementName=canvas}">
<VisualBrush.RelativeTransform>
<TransformGroup>
<ScaleTransform CenterX="0.5"
CenterY="0.5" ScaleX="1" ScaleY="-1"/>
</TransformGroup>
</VisualBrush.RelativeTransform>
</VisualBrush>
</Rectangle.Fill>
<Rectangle.OpacityMask>
<LinearGradientBrush StartPoint="0,0"
EndPoint="0,1">
<GradientStop Color="#44000000" Offset="0"/<GradientStop Color="#00000000" Offset="1"/</LinearGradientBrush>
</Rectangle.OpacityMask>
</Rectangle>
</Canvas>
</StackPanel>
</Grid>
</Window>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top