• xaf--自定义窗口标题


     

    第二种效果:

    public partial class CustomizeWindowController : WindowController
        {
            public CustomizeWindowController()
            {
                TargetWindowType = WindowType.Main;
            }
    
            protected override void OnActivated()
            {
                base.OnActivated();
                WindowTemplateController controller = Frame.GetController<WindowTemplateController>();
                controller.CustomizeWindowCaption += Controller_CustomizeWindowCaption;
            }
    
            private void Controller_CustomizeWindowCaption(object sender, CustomizeWindowCaptionEventArgs e)
            {
                //e.WindowCaption.Text = "我是窗口标题";
                e.WindowCaption.SecondPart += " (Powered by XAF)";
            }
    
            protected override void OnDeactivated()
            {
                base.OnDeactivated();
                WindowTemplateController controller = Frame.GetController<WindowTemplateController>();
                controller.CustomizeWindowCaption -= Controller_CustomizeWindowCaption;
            }
        }
    View Code

     第三种效果:自定义分隔符号(默认是一个Dash)

    public partial class CustomizeWindowController : WindowController
        {
            public CustomizeWindowController()
            {
                TargetWindowType = WindowType.Main;
            }
    
            protected override void OnActivated()
            {
                base.OnActivated();
                WindowTemplateController controller = Frame.GetController<WindowTemplateController>();
                controller.CustomizeWindowCaption += Controller_CustomizeWindowCaption;
            }
    
            private void Controller_CustomizeWindowCaption(object sender, CustomizeWindowCaptionEventArgs e)
            {
                //e.WindowCaption.Text = "我是窗口标题";
                e.WindowCaption.SecondPart += " (Powered by XAF)";
                e.WindowCaption.Separator = "";
            }
    
            protected override void OnDeactivated()
            {
                base.OnDeactivated();
                WindowTemplateController controller = Frame.GetController<WindowTemplateController>();
                controller.CustomizeWindowCaption -= Controller_CustomizeWindowCaption;
            }
        }
    View Code

     

      

     第四种:前后两部分,位值互换

    private void Controller_CustomizeWindowCaption(object sender, CustomizeWindowCaptionEventArgs e) {
        string TmpString = e.WindowCaption.FirstPart;
        e.WindowCaption.FirstPart = e.WindowCaption.SecondPart;
        e.WindowCaption.SecondPart = TmpString;
    }
    View Code

     

    第五种:前后两部分,只展示一部分

    (完) 

  • 相关阅读:
    云计算下一浪潮,腾讯云抢占 Serverless 制高点
    Serverless + GitHub Actions 完美自动化部署静态网站
    Serverless 技术在格灵深瞳的落地实践
    万物皆可 Serverless 之我的 Serverless 之路
    LeetCode 哈希表 136:只出现一次的数字(计数哈希表,异或)
    Spring 01 IOC
    LeetCode 数组:1.两数之和 11. 盛最多水的容器
    LeetCode 链表:21合并两个有序链表 19删除链表的倒数第N个节点
    Maybatis的一些总结(三:增删改查)
    Maybatis的一些总结(一:了解)
  • 原文地址:https://www.cnblogs.com/lishidefengchen/p/15308002.html
Copyright © 2020-2023  润新知