图像从顶部切割,因为它们被放置在底部

时间:2016-08-18 15:38:57

标签: wpf vb.net runtime

我在vb.net wpf中遇到了问题。 我想在我们拥有的工具中做一些捐赠页面,你可以捐赠几个想法。此外,您应该能够评估捐赠的想法。因此,我制作了显示评级的明星。

问题是前两行的星星是正确显示的。但是第三个正从它的下方顶部消失。

The Stars are actually there

But seem to get cut off from the top

请查看我们使用的代码(当然,我们只是在我们的空闲时间执行此操作并尝试自行学习。请注意,请注意,此代码可能不是您见过的最好的代码 - 我们很高兴它或多或少地工作):

Imports System.Windows.Forms

Private Sub MetroWindow_Loaded(sender As Object, e As RoutedEventArgs)
    Dim OpenDonations As Integer = 3
    If OpenDonations <> 0 Then
        Try
            Dim needed As Double
            Dim reached As Double
            Dim Währung As String = ""
            Dim ratings(0) As String

            Dim i As Integer = OpenDonations

            Dim y As Double = 10
            Dim Z As Integer = 1

            Do While 0 < i

                'Set needed value from DB
                'Set reached value from DB
                'Set Währung value from DB

                '[...] creating the other objects like label, scrollviewer, textblock, image(on the left), button, progressbar..

                'create rating pictures

                Dim Leftstar1 As New Image()
                Dim rightstar1 As New Image()
                Dim Leftstar2 As New Image()
                Dim rightstar2 As New Image()
                Dim Leftstar3 As New Image()
                Dim rightstar3 As New Image()
                Dim Leftstar4 As New Image()
                Dim rightstar4 As New Image()
                Dim Leftstar5 As New Image()
                Dim rightstar5 As New Image()

                Leftstar1.Name = "StarImageLeft1" + Z.ToString
                rightstar1.Name = "StarImageright1" + Z.ToString
                Leftstar2.Name = "StarImageLeft2" + Z.ToString
                rightstar2.Name = "StarImageright2" + Z.ToString
                Leftstar3.Name = "StarImageLeft3" + Z.ToString
                rightstar3.Name = "StarImageright3" + Z.ToString
                Leftstar4.Name = "StarImageLeft4" + Z.ToString
                rightstar4.Name = "StarImageright4" + Z.ToString
                Leftstar5.Name = "StarImageLeft5" + Z.ToString
                rightstar5.Name = "StarImageright5" + Z.ToString

                Dim Bewertung As Double = 'get value from db

                Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Relative))
                rightstar1.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative))
                Leftstar2.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Relative))
                rightstar2.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative))
                Leftstar3.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Relative))
                rightstar3.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative))
                Leftstar4.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Relative))
                rightstar4.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative))
                Leftstar5.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Relative))
                rightstar5.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative))

                If Bewertung = 0 Then

                ElseIf Bewertung <= 0.5 Then
                    Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                ElseIf Bewertung <= 1 Then
                    Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar1.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                ElseIf Bewertung <= 1.5 Then
                    Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar1.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar2.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                ElseIf Bewertung <= 2 Then
                    Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar1.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar2.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar2.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                ElseIf Bewertung <= 2.5 Then
                    Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar1.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar2.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar2.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar3.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                ElseIf Bewertung <= 3 Then
                    Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar1.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar2.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar2.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar3.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar3.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                ElseIf Bewertung <= 3.5 Then
                    Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar1.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar2.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar2.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar3.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar3.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar4.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                ElseIf Bewertung <= 4 Then
                    Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar1.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar2.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar2.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar3.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar3.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar4.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar4.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                ElseIf Bewertung <= 4.5 Then
                    Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar1.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar2.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar2.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar3.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar3.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar4.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar4.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar5.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                ElseIf Bewertung <= 5 Then
                    Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar1.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar2.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar2.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar3.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar3.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar4.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar4.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                    Leftstar5.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative))
                    rightstar5.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative))
                End If

                Leftstar1.HorizontalAlignment = Windows.HorizontalAlignment.Left
                Leftstar1.VerticalAlignment = Windows.VerticalAlignment.Top
                Leftstar1.Height = 25
                Leftstar1.Width = 25
                'Leftstar1.Margin = New Thickness(x, y + 110 + Progressbar_reached.Height + 10, 0, 0)
                Leftstar1.Margin = New Thickness(x + 200, Z * 125, 0, 0)

                rightstar1.HorizontalAlignment = Windows.HorizontalAlignment.Left
                rightstar1.VerticalAlignment = Windows.VerticalAlignment.Top
                rightstar1.Height = 25
                rightstar1.Width = 25
                rightstar1.Margin = New Thickness(Leftstar1.Margin.Left + 13, Leftstar1.Margin.Top, 0, 0)

                Leftstar2.HorizontalAlignment = Windows.HorizontalAlignment.Left
                Leftstar2.VerticalAlignment = Windows.VerticalAlignment.Top
                Leftstar2.Height = 25
                Leftstar2.Width = 25
                Leftstar2.Margin = New Thickness(rightstar1.Margin.Left + 10, Leftstar1.Margin.Top, 0, 0)
                rightstar2.HorizontalAlignment = Windows.HorizontalAlignment.Left
                rightstar2.VerticalAlignment = Windows.VerticalAlignment.Top
                rightstar2.Height = 25
                rightstar2.Width = 25
                rightstar2.Margin = New Thickness(Leftstar2.Margin.Left + 13, Leftstar1.Margin.Top, 0, 0)

                Leftstar3.HorizontalAlignment = Windows.HorizontalAlignment.Left
                Leftstar3.VerticalAlignment = Windows.VerticalAlignment.Top
                Leftstar3.Height = 25
                Leftstar3.Width = 25
                Leftstar3.Margin = New Thickness(rightstar2.Margin.Left + 10, Leftstar1.Margin.Top, 0, 0)
                rightstar3.HorizontalAlignment = Windows.HorizontalAlignment.Left
                rightstar3.VerticalAlignment = Windows.VerticalAlignment.Top
                rightstar3.Height = 25
                rightstar3.Width = 25
                rightstar3.Margin = New Thickness(Leftstar3.Margin.Left + 13, Leftstar1.Margin.Top, 0, 0)

                Leftstar4.HorizontalAlignment = Windows.HorizontalAlignment.Left
                Leftstar4.VerticalAlignment = Windows.VerticalAlignment.Top
                Leftstar4.Height = 25
                Leftstar4.Width = 25
                Leftstar4.Margin = New Thickness(rightstar3.Margin.Left + 10, Leftstar1.Margin.Top, 0, 0)
                rightstar4.HorizontalAlignment = Windows.HorizontalAlignment.Left
                rightstar4.VerticalAlignment = Windows.VerticalAlignment.Top
                rightstar4.Height = 25
                rightstar4.Width = 25
                rightstar4.Margin = New Thickness(Leftstar4.Margin.Left + 13, Leftstar1.Margin.Top, 0, 0)

                Leftstar5.HorizontalAlignment = Windows.HorizontalAlignment.Left
                Leftstar5.VerticalAlignment = Windows.VerticalAlignment.Top
                Leftstar5.Height = 25
                Leftstar5.Width = 25
                Leftstar5.Margin = New Thickness(rightstar4.Margin.Left + 10, Leftstar1.Margin.Top, 0, 0)
                rightstar5.HorizontalAlignment = Windows.HorizontalAlignment.Left
                rightstar5.VerticalAlignment = Windows.VerticalAlignment.Top
                rightstar5.Height = 25
                rightstar5.Width = 25
                rightstar5.Margin = New Thickness(Leftstar5.Margin.Left + 13, Leftstar1.Margin.Top, 0, 0)


                '[...] here is actually some code for mouseover and mouselevave events of the starimages but had to be shortended so everything fits.

                Me.GridDonations.Children.Add(Leftstar1)
                Me.GridDonations.Children.Add(rightstar1)
                Me.GridDonations.Children.Add(Leftstar2)
                Me.GridDonations.Children.Add(rightstar2)
                Me.GridDonations.Children.Add(Leftstar3)
                Me.GridDonations.Children.Add(rightstar3)
                Me.GridDonations.Children.Add(Leftstar4)
                Me.GridDonations.Children.Add(rightstar4)
                Me.GridDonations.Children.Add(Leftstar5)
                Me.GridDonations.Children.Add(rightstar5)




                y = y + 10 + 100 + 10 + Progressbar_reached.Height + 10 + Leftstar1.Height + 15
                i = i - 1

                If Z <> 1 Then
                    Me.Height = Me.Height + Image.Height + 10 + Progressbar_reached.Height + 10 + 10 + Leftstar1.Height + 15
                Else
                    Me.Height = 30 + 10 + Image.Height + 10 + Progressbar_reached.Height + 10 + 10 + Leftstar1.Height + 15
                End If

                Z += 1

            Loop
        Catch
        End Try
    Else
        Dim NoDonations_Label As New System.Windows.Controls.Label()
        NoDonations_Label.Name = "NoDonationLabel"
        NoDonations_Label.Content = "No Donations needed!"
        Me.GridDonations.Children.Add(NoDonations_Label)

    End If

End Sub

我试图从一开始就再次这样做,并想知道当我只添加它们时星星是否已经消失。不幸的是,他们这样做了。 这是我这次使用的代码:

Imports System.Windows.Forms

Public Class Donations
    Dim funktionen As New Methoden
    Dim leftstarsource_empty As String = "/LiquidMustard;component/pics/leftstar_empty.png"
    Dim rightstarsource_empty As String = "/LiquidMustard;component/pics/rightstar_empty.png"
    Dim leftstarsource_full As String = "/LiquidMustard;component/pics/leftstar_full.png"
    Dim rightstarsource_full As String = "/LiquidMustard;component/pics/rightstar_full.png"
    Private Sub MetroWindow_Loaded(sender As Object, e As RoutedEventArgs)
        Dim OpenDonations As Integer = funktionen.getvaluebyquery("Select Count(*) from lm_donations")

    'Neues Grid anlegen
    Dim DonationGrid As New Grid()
    DonationGrid.Name = "DonationGrid"
    DonationGrid.VerticalAlignment = Windows.VerticalAlignment.Top
    DonationGrid.HorizontalAlignment = Windows.HorizontalAlignment.Left
    DonationGrid.Margin = New Thickness(0)

    Try
        Dim needed As Double
        Dim reached As Double
        Dim Währung As String = ""
        Dim heightvalue As Integer = 10

        Dim i As Integer = 1

        Do While 0 < OpenDonations

            needed = funktionen.getvaluebyquery("Select needed from lm_donations where DonationName = 'Donation" & i & "'")
            reached = funktionen.getvaluebyquery("Select reached_confirmed from lm_donations where DonationName = 'Donation" & i & "'")
            Währung = funktionen.getvaluebyquery("Select Währung from lm_donations where DonationName = 'Donation" & i & "'")

            Dim Starimage_left_1 As New Image()
            Dim Starimage_left_2 As New Image()
            Dim Starimage_left_3 As New Image()
            Dim Starimage_left_4 As New Image()
            Dim Starimage_left_5 As New Image()
            Dim Starimage_right_1 As New Image()
            Dim Starimage_right_2 As New Image()
            Dim Starimage_right_3 As New Image()
            Dim Starimage_right_4 As New Image()
            Dim Starimage_right_5 As New Image()

            Starimage_left_1.Name = "Starimage_left_1" & i.ToString
            Starimage_left_2.Name = "Starimage_left_2" & i.ToString
            Starimage_left_3.Name = "Starimage_left_3" & i.ToString
            Starimage_left_4.Name = "Starimage_left_4" & i.ToString
            Starimage_left_5.Name = "Starimage_left_5" & i.ToString
            Starimage_right_1.Name = "Starimage_right_1" & i.ToString
            Starimage_right_2.Name = "Starimage_right_2" & i.ToString
            Starimage_right_3.Name = "Starimage_right_3" & i.ToString
            Starimage_right_4.Name = "Starimage_right_4" & i.ToString
            Starimage_right_5.Name = "Starimage_right_5" & i.ToString

            Starimage_left_1.Margin = New Thickness(10, heightvalue, 0, 0)
            Starimage_right_1.Margin = New Thickness(Starimage_left_1.Margin.Left + 13, Starimage_left_1.Margin.Top, 0, 0)

            Starimage_left_2.Margin = New Thickness(Starimage_right_1.Margin.Left + 13, Starimage_left_1.Margin.Top, 0, 0)
            Starimage_right_2.Margin = New Thickness(Starimage_left_2.Margin.Left + 13, Starimage_left_1.Margin.Top, 0, 0)

            Starimage_left_3.Margin = New Thickness(Starimage_right_2.Margin.Left + 13, Starimage_left_1.Margin.Top, 0, 0)
            Starimage_right_3.Margin = New Thickness(Starimage_left_3.Margin.Left + 13, Starimage_left_1.Margin.Top, 0, 0)

            Starimage_left_4.Margin = New Thickness(Starimage_right_3.Margin.Left + 13, Starimage_left_1.Margin.Top, 0, 0)
            Starimage_right_4.Margin = New Thickness(Starimage_left_4.Margin.Left + 13, Starimage_left_1.Margin.Top, 0, 0)

            Starimage_left_5.Margin = New Thickness(Starimage_right_4.Margin.Left + 13, Starimage_left_1.Margin.Top, 0, 0)
            Starimage_right_5.Margin = New Thickness(Starimage_left_5.Margin.Left + 13, Starimage_left_1.Margin.Top, 0, 0)


            Starimage_left_1.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Absolute))
            Starimage_right_1.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative))
            Starimage_left_2.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Relative))
            Starimage_right_2.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative))
            Starimage_left_3.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Relative))
            Starimage_right_3.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative))
            Starimage_left_4.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Relative))
            Starimage_right_4.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative))
            Starimage_left_5.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Relative))
            Starimage_right_5.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative))

            Starimage_left_1.Height = 25
            Starimage_left_1.Width = 25
            Starimage_left_2.Height = 25
            Starimage_left_2.Width = 25
            Starimage_left_3.Height = 25
            Starimage_left_3.Width = 25
            Starimage_left_4.Height = 25
            Starimage_left_4.Width = 25
            Starimage_left_5.Height = 25
            Starimage_left_5.Width = 25
            Starimage_right_1.Height = 25
            Starimage_right_1.Width = 25
            Starimage_right_2.Height = 25
            Starimage_right_2.Width = 25
            Starimage_right_3.Height = 25
            Starimage_right_3.Width = 25
            Starimage_right_4.Height = 25
            Starimage_right_4.Width = 25
            Starimage_right_5.Height = 25
            Starimage_right_5.Width = 25

            Starimage_left_1.HorizontalAlignment = Windows.HorizontalAlignment.Left
            Starimage_left_2.HorizontalAlignment = Windows.HorizontalAlignment.Left
            Starimage_left_3.HorizontalAlignment = Windows.HorizontalAlignment.Left
            Starimage_left_4.HorizontalAlignment = Windows.HorizontalAlignment.Left
            Starimage_left_5.HorizontalAlignment = Windows.HorizontalAlignment.Left
            Starimage_right_1.HorizontalAlignment = Windows.HorizontalAlignment.Left
            Starimage_right_2.HorizontalAlignment = Windows.HorizontalAlignment.Left
            Starimage_right_3.HorizontalAlignment = Windows.HorizontalAlignment.Left
            Starimage_right_4.HorizontalAlignment = Windows.HorizontalAlignment.Left
            Starimage_right_5.HorizontalAlignment = Windows.HorizontalAlignment.Left

            Starimage_left_1.VerticalAlignment = Windows.VerticalAlignment.Top
            Starimage_left_2.VerticalAlignment = Windows.VerticalAlignment.Top
            Starimage_left_3.VerticalAlignment = Windows.VerticalAlignment.Top
            Starimage_left_4.VerticalAlignment = Windows.VerticalAlignment.Top
            Starimage_left_5.VerticalAlignment = Windows.VerticalAlignment.Top
            Starimage_right_1.VerticalAlignment = Windows.VerticalAlignment.Top
            Starimage_right_2.VerticalAlignment = Windows.VerticalAlignment.Top
            Starimage_right_3.VerticalAlignment = Windows.VerticalAlignment.Top
            Starimage_right_4.VerticalAlignment = Windows.VerticalAlignment.Top
            Starimage_right_5.VerticalAlignment = Windows.VerticalAlignment.Top

            DonationGrid.Children.Add(Starimage_left_1)
            DonationGrid.Children.Add(Starimage_left_2)
            DonationGrid.Children.Add(Starimage_left_3)
            DonationGrid.Children.Add(Starimage_left_4)
            DonationGrid.Children.Add(Starimage_left_5)
            DonationGrid.Children.Add(Starimage_right_1)
            DonationGrid.Children.Add(Starimage_right_2)
            DonationGrid.Children.Add(Starimage_right_3)
            DonationGrid.Children.Add(Starimage_right_4)
            DonationGrid.Children.Add(Starimage_right_5)

            Me.Height = Starimage_left_1.Margin.Top + 26 + 25 + 10
            DonationGrid.Height = Me.Height + 200

            OpenDonations -= 1
            i += 1
            heightvalue += 205

        Loop

        Me.AddChild(DonationGrid)

    Catch
    End Try

End Sub
End Class

这是窗口的XAML:

<Controls:MetroWindow x:Class="Donations"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
Title="Donations" Icon="/LiquidMustard;component/pics/Mustard.ico" WindowStyle="SingleBorderWindow" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" ResizeMode="NoResize" ShowInTaskbar="False" Height="210.596" Width="510" Loaded="MetroWindow_Loaded">
<Window.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colours.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedTabControl.xaml" />
            <ResourceDictionary Source="Liquidstyle.xaml" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Window.Resources>
<Controls:MetroWindow.WindowCommands>
    <Controls:WindowCommands/>
</Controls:MetroWindow.WindowCommands>

1 个答案:

答案 0 :(得分:0)

我解决了这个问题。 我刚刚创建了一些新图片并使用它们。 我不知道为什么旧星影不起作用,但是新的星影像是按照预期工作的。