這是一種新的Silverlight,我怎樣才能使網格看起來像3D(有點像Silverlight進度條在視覺上突出)。我覺得我已經嘗試了一切,但我已經沒有想法了。任何人都可以給我一個可以做到這一點的代碼片段?使網格3d看起來
Q
使網格3d看起來
0
A
回答
2
您是否嘗試過使用DropShadowEffect?
<data:DataGrid>
<data:DataGrid.Effect>
<DropShadowEffect />
</data:DataGrid.Effect>
...
...
</data:DataGrid>
當然你也可以在其他控件上使用它。
創建凹陷的效果都是關於照明的錯覺。如果在元素周圍繪製邊框的頂部和左側爲深色,底部和右側爲淺色,則表示內容已沉入表面。切換陰影將會增加內容的效果。
這裏是一個小例子來說明
<UserControl x:Class="SilverlightApplication1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400" >
<Grid x:Name="LayoutRoot" Background="Lightgray">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Vertical">
<!-- Sunken -->
<Grid Width="100" Height="25" Background="Wheat" Margin="0,5,0,0">
<!-- Draw the 3d border -->
<Rectangle Height="1" Fill="DarkGray" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
<Rectangle Width="1" Fill="DarkGray" HorizontalAlignment="Left" VerticalAlignment="Stretch" />
<Rectangle Height="1" Fill="White" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" />
<Rectangle Width="1" Fill="White" HorizontalAlignment="Right" VerticalAlignment="Stretch" />
<!-- Put your content in this Grid -->
<Grid>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="Sunken" />
</Grid>
</Grid>
<!-- Raised -->
<Grid Width="100" Height="25" Background="Wheat" Margin="0,5,0,0">
<!-- Draw the 3d border -->
<Rectangle Height="1" Fill="White" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
<Rectangle Width="1" Fill="White" HorizontalAlignment="Left" VerticalAlignment="Stretch" />
<Rectangle Height="1" Fill="DarkGray" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" />
<Rectangle Width="1" Fill="DarkGray" HorizontalAlignment="Right" VerticalAlignment="Stretch" />
<!-- Put your content in this Grid -->
<Grid>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="Raised" />
</Grid>
</Grid>
</StackPanel>
</Grid>
</UserControl>
相關問題
- 1. 3d模型看起來轉過身
- 2. 如何讓TButton看起來像3d?
- 3. Three.js 3d球體看起來2d
- 4. WPF 3D編輯器看起來像3DSMAX
- 5. 使網址看起來更好
- 6. 使引導網格看起來像一張表
- 7. 問題與CSS使它看起來像兩個網格單元格(行)合併
- 8. 3D網格加入
- 9. 體素3d「網格」
- 10. 光源另一側的網格看起來很奇怪
- 11. 用ul組織一些內容(看起來像網格一樣)
- 12. Extjs datefield在我的網格中看起來很奇怪
- 13. 使autocompletetextview看起來像edittext
- 14. 使UICollectionView看起來像UITableView
- 15. 網站看起來縮小負載
- 16. ietester?網站看起來很緊張?
- 17. 柏林噪音看起來太格朗
- 18. 格式TextView看起來像鏈接
- 19. 將3d網格分解爲2d網格
- 20. 3D透視投影看起來不正確
- 21. 蜘蛛網圖圓形網格線插值:標籤看起來離Plotline很遠
- 22. 使3D對象看起來像是面對2D空間中的一個點
- 23. Silverlight + Kit3D 3D網格操作?
- 24. C#3D WPF黑色網格
- 25. 顯示3D表面網格
- 26. HTML盒 - 使它看起來像另一個網站
- 27. 如何使我的網頁看起來好用IE7 +?
- 28. 看起來自動化一個網頁與鏈接使用Javascript
- 29. 如何使「紋理窗口」看起來像偏好窗格
- 30. 風格ASP按鈕看起來像使用jQuery UI的
你能解釋更多你想要什麼 – 2011-06-12 17:50:54