2009-10-12 14 views
0

我將BureauBlue.xaml主題應用於我的應用程序,並破壞了我的所有對齊方式。有沒有解決方案來應用主題而不會破壞我的對齊?wpf主題改變了我的對齊方式

將您的主題放在「主題」文件夾中。

application 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
x:Class="WpfApplication4.App" 
StartupUri="MainWindow.xaml"> 
Application.Resources> 

    ResourceDictionary> 
    ResourceDictionary.MergedDictionaries> 
    ResourceDictionary Source="Themes/BureauBlue.xaml"/> 
    /ResourceDictionary.MergedDictionaries> 
    /ResourceDictionary> 
/Application.Resources> 
/Application>

我剛剛刪除了我的代碼的起始括號,因爲它沒有顯示我的代碼。

回答

1

轉到App.xaml並粘貼那裏的行,你將使用Vista主題非常接近Windows7,進度條,複選框,菜單,定量按鈕,滾動條等,但你不會有玻璃看。

<Application.Resources> 
    <ResourceDictionary Source="/PresentationFramework.Aero, Version=3.0.0.0, 
    Culture=neutral, PublicKeyToken=31bf3856ad364e35, 
    ProcessorArchitecture=MSIL;component/themes/aero.normalcolor.xaml" /> 
</Application.Resources>