App.xaml是Application类的XAML部分 - 您可以在其中定义应用程序范围的逻辑和资源的单一集中位置.虽然Generic.xaml位于Themes项目目录中,但是您可以在其中为所有自定义控件定义默认样式.当Themes文件夹中没有特定于Windows主题的字典时,将使用此字典.例如,您可能具有以下Themes目录结构:
MyProject
- Themes
- Generic.xaml // Default styles if current theme is non of the themes below
- Classic.xaml // Styles for “Classic” Windows 9x/2000 look on Windows XP.
- Luna.NormalColor.xaml // Styles for default blue theme on Windows XP.
- Luna.Homestead.xaml // Styles for olive theme on Windows XP.
- Luna.Metallic.xaml // Styles for silver theme on Windows XP.
- Royale.NormalColor.xaml // Styles for default theme on Windows XP Media Center Edition.
- Aero.NormalColor.xaml // Styles for default theme on Windows Vista
Run Code Online (Sandbox Code Playgroud)
如果您希望自定义控件在任何Windows主题上看起来相同,则只需创建Generic.xaml.
因此,基本上您应该Generic.xaml只使用自定义控件和App.xaml其他所有内容定义样式(例如,您的画笔,颜色等,或者您自己的标准控件样式).
另请参阅这个问题的答案:Generic.xaml有什么特别之处?
| 归档时间: |
|
| 查看次数: |
4024 次 |
| 最近记录: |