c# - WPF 设计器问题(mahapps Metro)?
问题描述
我刚开始使用 WPF,但是我有一个问题,它在设计器中看起来像这样是否正常: Designer
但如果我运行我的应用程序,它看起来像这样:运行
有没有办法解决这个问题,或者它在 WPF 中是否正常?
XAML 源代码:
<Controls:MetroWindow
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="IXWare_Designed.MainWindow"
Title="Test"
WindowStartupLocation="CenterScreen" WindowStyle="SingleBorderWindow" ResizeMode="CanMinimize" d:DesignWidth="906" d:DesignHeight="474">
<Controls:MetroWindow.RightWindowCommands>
<Controls:WindowCommands>
<Button Content="settings" Click="Button_Click" />
</Controls:WindowCommands>
</Controls:MetroWindow.RightWindowCommands>
<Grid>
<TabControl HorizontalAlignment="Left" VerticalAlignment="Top" Height="445" Width="900">
<TabItem Header="TabItem" Margin="0,0,-60,0">
<TabControl HorizontalAlignment="Left" Margin="0,0,-6,-1" Width="900">
<TabItem Header="TabItem"/>
<TabItem Header="TabItem"/>
<Button Content="Button" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75"/>
<Button Content="Button" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75"/>
</TabControl>
</TabItem>
<TabItem Header="TabItem" Margin="0,0,-60,0"/>
<TabItem Header="TabItem" Margin="0,0,-60,0"/>
<TabItem Header="TabItem" Margin="0,0,-60,0"/>
<TabItem Header="TabItem" Margin="0,0,-60,0"/>
<TabItem Header="TabItem" Margin="0,0,-60,0"/>
<TabItem Header="TabItem" Margin="0,0,-60,0"/>
<TabItem Header="TabItem" Margin="0,0,-48,0"/>
</TabControl>
</Grid>
</Controls:MetroWindow>
解决方案
推荐阅读
- reactjs - React - 状态挂钩映射不是函数
- python - 运行破折号代码时出现 SSLCertVerificationError
- android - 将可绘制资源配置为与标准 android 背景具有相同的背景颜色
- centos - 单条消息的最差延迟
- javascript - 如何在 IE 版本 11 中以 pdf 格式下载 base64 字符串,对于 mozilla firefox 也是如此
- android - android textview可绘制自动镜像不适用于RTL支持
- sql - 需要一些基于表示例的 MS-Access 查询 SQL 建议
- php - PHP:以秒和毫秒为单位使用/识别时间戳
- javascript - 在加载或单击时将新页面滚动到顶部
- wordpress - Wordpress:ajax_url 未定义