zoukankan      html  css  js  c++  java
  • WPF使用Fluent.Ribbon修改标题栏背景颜色

    使用NuGet安装:Install-Package Fluent.Ribbon

    修改App.xaml:

    <Application.Resources>
        <!-- Attach default Theme -->
        <ResourceDictionary Source="pack://application:,,,/Fluent;Component/Themes/Generic.xaml" />
    </Application.Resources>

    前台代码:

    <Fluent:RibbonWindow x:Class="WpfDemo.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
            xmlns:Fluent="urn:fluent-ribbon"
            xmlns:local="clr-namespace:WpfDemo"
            mc:Ignorable="d" Background="Bisque"
            Title="MainWindow" Height="350" Width="525">
        <Grid>
            <Button Click="Button_Click" />
        </Grid>
    </Fluent:RibbonWindow>

    后台代码:

    using System.Windows;
    
    namespace WpfDemo
    {
        /// <summary>
        /// MainWindow.xaml 的交互逻辑
        /// </summary>
        public partial class MainWindow : Fluent.RibbonWindow
        {
            public MainWindow()
            {
                InitializeComponent();
            }
    
            private void Button_Click(object sender, RoutedEventArgs e)
            {
                var win = new MainWindow();
                win.Owner = this;
                win.ShowDialog();
            }
        }
    }

    参考资料:http://fluentribbon.github.io/documentation/basic-setup

  • 相关阅读:
    福大软工1816 · 第四次作业
    福大软工1816 · 第三次作业
    福大软工1816 · 第二次作业
    福大软工1816 · 第四次作业
    福大软工1816 · 第三次作业
    Alpha 冲刺 (4/10)
    Alpha 冲刺 (3/10)
    Alpha 冲刺 (2/10)
    Alpha 冲刺 (1/10)
    项目需求分析
  • 原文地址:https://www.cnblogs.com/wzwyc/p/7645908.html
Copyright © 2011-2022 走看看