c# - 如果已经设置了高度,可以设置设计高度
问题描述
c# 如果设置了高度,可以设置设计高度
<Controls:MetroWindow x:Class="SQL_Reports.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:local="clr-namespace:SQL_Reports"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
mc:Ignorable="d"
Width="669"
Title="Daily SQL Reports"
WindowStartupLocation="CenterScreen"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.CanContentScroll="True"
MinHeight="530"
TitleAlignment="Center"
MinWidth="677"
d:DesignHeight="927" >
我正在尝试设置设计高度,以便可以在 Visual Studio 中查看我的内容,但我也希望 WPF 的高度为 530,但是当我设置高度时,设计器保持为 530,而不是我设置的设计高度.
解决方案
只需在设计时去掉 MinHeight="530" 即可。完成后再次添加。
我不相信您可以同时定义运行时高度和设计高度。也许您可以尝试 d:LayoutOverrides 属性。
推荐阅读
- ios - 使用 MapKit API 时,MKErrorDomain code=3 是什么意思?
- python - 在 pandas 中拆分时间戳日期
- django - Django paypal 返回错误:render() got an unexpected keyword argument 'renderer'
- c++ - 为自定义变体类实现按索引获取值
- oracle - oracle Alter Session NLS FORMAT for bulk insert statements - 行为不符合预期
- c# - 为什么 NotificationManager notificationManager = (NotificationManager)GetSystemService(LocalNotificationService); 显示错误?
- c# - 具有多个数据库的存储库模式
- javascript - 接收数组并将数组添加到状态
- audiokit - 后端音频套件
- python - 如何将文件从本地文件服务器 (SFTP) 直接移动到 Snowflake?