我正在尝试使用ModernUI窗口元素,并坚持使用第一个元素上边距(放置渐变的位置)。 我使用Modern UI Light风格。设置零保证金并不起作用。
如何重新定义样式/减少上边距?
查看xaml部分:
<mui:ModernWindow x:Class="MyProject.Views.LoginWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mui="http://firstfloorsoftware.com/ModernUI"
Height="380" Width="300">
<Grid Style="{StaticResource ContentRoot}">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="2*" />
<RowDefinition Height="2*" />
<RowDefinition Height="30" />
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
<Label Grid.Row="0"
Content="ВХОД В СИСТЕМУ"
FontWeight="Bold" FontSize="20"
VerticalAlignment="Top"
Margin="5"/>
...
</Grid>
答案 0 :(得分:1)
终于明白了。
引用程序集FirstFloor.ModernUI.dll出现问题。
我的项目目标框架是4.5,我通过Nuget Package Manager安装了新版的ModernUI。 之后安装的版本是1.0.6.0。
当我更改对先前版本1.0.5.0的引用时,问题就消失了,现在所有窗口元素都适合它们。
并且还消除了所有xaml警告:资源无法解决。