【问题标题】:Metro Style in WPF applications _ Packages differencesWPF 应用程序中的 Metro Style _ 包差异
【发布时间】:2014-03-24 11:10:06
【问题描述】:

我想创建一个 Metro 风格的应用程序,我做了一些研究,发现了很多关于此的文章和教程。

但我仍然需要在 Modern UI for WPFElysiumMahApps 之间进行明确的比较。

测试所有这些需要太多时间!我需要了解每个人的特点来决定从哪个开始。

谢谢,

【问题讨论】:

    标签: wpf microsoft-metro


    【解决方案1】:

    第一:Download the WPF Shell Integration Library Here

    然后使用这个 XML 代码:

    <Window x:Class="MyLibrary.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:shell="http://schemas.microsoft.com/winfx/2006/xaml/presentation/shell"
            Title="MainWindow"
            WindowStyle="SingleBorderWindow"
            ResizeMode="CanResizeWithGrip"
            mc:Ignorable="d"
            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
            d:DesignHeight="449"
            d:DesignWidth="677"
            Foreground="White"
            removed="Black">
    
        <shell:WindowChrome.WindowChrome>
            <shell:WindowChrome CaptionHeight="35"
                                GlassFrameThickness="0,0,0,1"
                                ResizeBorderThickness="5" />
        </shell:WindowChrome.WindowChrome>
    
        <Grid x:Name="LayoutRoot">
    
        </Grid>
    </Window>
    

    (注意,您需要引用 Microsoft.Windows.Shell)

    这确实是最好的方法。它适用于所有 Windows 版本。

    编辑: 如果要在窗口顶部添加标题按钮,请将此 XAML 代码添加到顶部的任何控件:(以按钮为例)

    <button shell:WindowChrome.IsHitTestVisibleInChrome="True"/>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-26
      • 1970-01-01
      相关资源
      最近更新 更多