zoukankan      html  css  js  c++  java
  • WPF 全屏后任务栏被遮挡

    开始有个需求是自定义任务栏,但是在使用【Application.Current.MainWindow.WindowState = WindowState.Maximized;】做到最大化得时候使用 发现窗口最大化了会遮挡任务栏, 网上搜索了一下,原来指定窗口得最大长款就行了

    <Window x:Class="EvalutionScaner.App.Views.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:prism="http://prismlibrary.com/"
            xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
            xmlns:model="clr-namespace:EvalutionScaner.App.Models"
            xmlns:consts="clr-namespace:EvalutionScaner.App.Models.Consts"
            xmlns:i ="http://schemas.microsoft.com/xaml/behaviors"
            mc:Ignorable="d"
            Title="MainWindow"
            TextElement.Foreground="{DynamicResource MaterialDesignBody}"
            Background="{DynamicResource MaterialDesignPaper}"
            prism:ViewModelLocator.AutoWireViewModel="True"
            x:Name="mainWindow"
            WindowStyle="None" 
            MaxHeight="{StaticResource {x:Static SystemParameters.MaximizedPrimaryScreenHeightKey}}"
            MaxWidth="{StaticResource {x:Static SystemParameters.MaximizedPrimaryScreenWidthKey}}"
        xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf"
        xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf">
    .....界面代码......
    <Window>
    

      红色为对应得设置属性,思路就是把窗口得最大宽度和最大高度分别绑定屏幕得长宽

  • 相关阅读:
    网络编程- struct模块定制报头ftp实践(九)
    网络编程- strcuct模块定制报头的理论(八)
    SQL查询原理及执行顺序
    web应用的组成结构
    web开发相关知识介绍
    java--调整JVM内存的大小
    java中的泛型系列五:自定义泛型
    java中的反射技术系列四:反射类的字段
    Android Sharedpreference
    Android OnScrollListener
  • 原文地址:https://www.cnblogs.com/txb1989/p/15723885.html
Copyright © 2011-2022 走看看