Search code examples
c#wpfmodern-ui

Wpf ModernUI window elements arrangement


I am trying to use ModernUI window element, and stuck with first element top margin (where gradient placed). I use Modern UI Light style. Setting zero margin doesn't work.

How can i redefine style/decrease top margin?

My window view

View xaml part:

<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>


Solution

  • Finally figured it out.

    Problem was in referenced assembly FirstFloor.ModernUI.dll.

    My project target framework is 4.5 and i installed fresh version of ModernUI through Nuget Package Manager. After that the installed version was 1.0.6.0.

    When i changed the reference to previous version 1.0.5.0, the problem is gone, and now all window elements fit, as they should.

    And also dissapeared all xaml warnings like: resource could not be resolved.