Infragistics WPF 應用主題到所有控制項

來源:互聯網
上載者:User

標籤:

引用 Infragistics.Themes.MetroDarkTheme.dll (本文以MetroDarkTheme為例)

並在 App.xaml 中添加:

<Application x:Class="MetroDarkThemeTest.App"             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"             xmlns:local="clr-namespace:MetroDarkThemeTest"             StartupUri="MainWindow.xaml">    <Application.Resources>        <ResourceDictionary>            <ResourceDictionary.MergedDictionaries>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.DataVisualization.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.OlapCharts.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.WPF.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamCalendar.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamColorPicker.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamComboEditor.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamDataChart.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamDataPresenter.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamDataTree.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamDateTimeInput.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamDiagram.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamDialogWindow.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamDockManager.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamEditors.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamFormulaEditor.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamGantt.ContextMenuIcons.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamGantt.TaskModeIcons.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamGantt.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamGauges.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamGeographicMap.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamGrid.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamMap.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamMaskedInput.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamMenu.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamMultiColumnCombo.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamNetworkNode.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamOrgChart.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamOutlookBar.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamPivotDataSlicer.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamPivotGrid.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamPropertyGrid.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamRadialMenu.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamRibbon.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamRichTextEditor.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamSchedule.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamSlider.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamSparkline.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamSpellChecker.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamSpreadsheet.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamSpreadsheetContextMenuResourceSet.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamSyntaxEditor.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamTagCloud.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamTileManager.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamTimeline.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/MetroDark.xamTreemap.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/Styles.Shared.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/Styles.WPF.xaml"/>                <ResourceDictionary Source="/Infragistics.Themes.MetroDarkTheme;component/Theme.Colors.xaml"/>            </ResourceDictionary.MergedDictionaries>        </ResourceDictionary>    </Application.Resources></Application>

Infragistics.Themes.MetroDarkTheme.dll 的來源:

安裝 Infragistics_WPF_20151_Samples.msi 後
C:\Users\Public\Documents\Infragistics\2015.1\WPF\Samples\CLR4.0\Infragistics.Themes\MetroDarkTheme.WPF\Infragistics.Themes.MetroDarkTheme.WPF.csproj
Release產生

 

ResourceDictionary 的提取:

            DirectoryInfo dir = new DirectoryInfo(@"C:\Users\Public\Documents\Infragistics\2015.1\WPF\Samples\CLR4.0\Infragistics.Themes\MetroDarkTheme.WPF");            FileInfo[] files = dir.GetFiles("*.xaml");            foreach (FileInfo f in files)            {                Console.WriteLine("<ResourceDictionary Source=\"/Infragistics.Themes.MetroDarkTheme;component/" + f.Name + "\"/>");            }

 

Infragistics WPF 應用主題到所有控制項

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.