修改App.xaml文件,如下:

    1. <Application
    2. x:Class="InvestmentDiary.Net.App"
    3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    6. xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006"
    7. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
    8. d1p1:Ignorable="d"
    9. StartupUri="View/Window/MainWindow.xaml">
    10. <Application.Resources>
    11. <ResourceDictionary>
    12. <ResourceDictionary.MergedDictionaries>
    13. <materialDesign:BundledTheme
    14. BaseTheme="Dark"
    15. PrimaryColor="Red"
    16. SecondaryColor="Green" />
    17. <!--<materialDesign:BundledTheme
    18. BaseTheme="Light"
    19. PrimaryColor="Blue"
    20. SecondaryColor="Blue" />-->
    21. <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
    22. <ResourceDictionary Source="Style/StringResource.xaml" />
    23. </ResourceDictionary.MergedDictionaries>
    24. </ResourceDictionary>
    25. </Application.Resources>
    26. </Application>