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

  • 相关阅读:
    【团队分享之二】IT团队绩效提升的一些见解
    我的ef连接mysql之旅
    Python3.5-20190501-廖老师的
    新装ubantu 18.04(自用)
    nginx配置url重写
    docker中crontab无法执行
    bootstrap
    mysql set
    mysqldump导出数据
    XGBoost 学习调参的例子
  • 原文地址:https://www.cnblogs.com/wzwyc/p/7645908.html
Copyright © 2011-2022 走看看