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

  • 相关阅读:
    [Apio2014]回文串
    省队集训day6 C
    省队集训day6 B
    省队集训Day3 light
    省队集训Day3 tree
    多串匹配
    ubuntu卸载福昕阅读器
    greenlet
    python multithread task_done
    mysql参数调优
  • 原文地址:https://www.cnblogs.com/wzwyc/p/7645908.html
Copyright © 2011-2022 走看看