Silverlight–Theme 的使用

在 Silverlight Toolkit 中提供了數種 Theme 供開發人員使用,但如何使用這些呢?

1.  在 App() 中加入下面的程式碼.

System.Windows.Controls.Theming.Theme.SetApplicationThemeUri(App.Current,
new Uri("/System.Windows.Controls.Theming.BubbleCreme;component/Theme.xaml", UriKind.Relative));

此部份可套用在所有的 .xaml 中,也包含了 ChildWindow 的部份.


2. 使用 XAML 語法描述,程式碼如下所示:

<toolkit:Theme x:Name="theme" ThemeUri="/System.Windows.Controls.Theming.BubbleCreme;component/Theme.xaml">

此部份只會套用包含在它之內的 Childern.


3. 使用 VS2010 Toolkit 中拖拉所需的 Theme.


image


這三種方法擇一台即可使用 Silverlight Toolkit 所提供的 Theme.


image

留言

這個網誌中的熱門文章

WPF - 窺探 Flow Diagram Designer 的設計

EasyUI – datebox 中如何自定日期格式化

WPF – Getting Started with MVVM