Comments: Silverlight Tip of the Day #29: Creating a Transparent, Draggable Dialog with Rounded Corners


Wiki Table of Contents

Page Details

Published by:
This page has not yet been rated

Silverlight Tip of the Day #29: Creating a Transparent, Draggable Dialog with Rounded Corners

Sort by: Published Date | Most Recent | Most Useful
By: Võ Đình Vinh Posted on 04-07-2010 5:06 PM

Có thể viết đơn giản cho vị dụ này như sau: Thay vì cách viết rất dài như trên

<CODE>

<Grid>  

   <Grid.ColumnDefinitions>

     <ColumnDefinition Width="Auto"></ColumnDefinition>

     <ColumnDefinition Width="Auto"></ColumnDefinition>

   </Grid.ColumnDefinitions>

   <Grid.RowDefinitions>

     <RowDefinition Height="Auto"></RowDefinition>

     <RowDefinition Height="Auto"></RowDefinition>

     <RowDefinition Height="Auto"></RowDefinition>

   </Grid.RowDefinitions>

   <Label Grid.Row="0" Grid.Column="0" Content="Opacity"></Label>

   <Label Grid.Row="1" Grid.Column="0" Content="Borders"></Label>

   <Slider Maximum="1" x:Name="Opa" Grid.Row="0" Grid.Column="1" Width="100" Margin="3"></Slider>

   <Slider Maximum="100" x:Name="Cor" Grid.Row="1" Grid.Column="1" Width="100" Margin="3"></Slider>

   <Border Margin="3" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" Opacity="{Binding Value,ElementName=Opa}" CornerRadius="{Binding Value,ElementName=Cor}" Width="300" Height="300" BorderBrush="White" Background="Black" BorderThickness="1">

   </Border>

 </Grid>

</CODE>