为什么我的位图图像显示在设计器中而不显示在.EXE中

问题描述 投票:0回答:1

我在控件库中有一个资源字典,用于声明我的位图图像。 key =刷新-M

UriSource = “ / Resources / Icons / Basic / refresh-100.png”

您可以在下面的代码中在按钮视图框中看到它的实例。

由于我的样式字典是appart形式的,所以我制作了包含所有内容的“ WPFStyle_Ascendecies.xaml”作为主要项目,因此我只需要在app.xaml中包括此内容即可。

/ ------ 图像

----- \

View Designer

App.exe

/ ------ #查看最后一个按钮

----- \
<!--Left Top to DownMenu -->
        <StackPanel  Background="DimGray" Grid.Row="0" Grid.RowSpan="3" Grid.Column="0" Grid.ColumnSpan="2">



            <TextBlock Text="{Binding Title}"  Padding="0,14,0,0" Height="56" Margin="0,0,0,0" FontSize="18"  Background="Black" Foreground="White" TextAlignment="Center" />
            <Button x:Name="Homepage"          Content="Home Page" Height="30" Margin="0,0,0,1" Click="Homepage_Click"                  />
            <Button x:Name="Clients"           Content="Clients"   Height="30" Margin="0,0,0,1" Click="Clients_Click"                   />
            <Button                            Content="Hello"     Height="30" Margin="0,0,0,1"                                         />
            <Button  Height="30" Margin="0,0,0,1" >
                <Viewbox>
                    <Image Source="{StaticResource Refresh -M}"/>
                </Viewbox>
            </Button>


        </StackPanel>


        <!--PagesPresenterFrame-->
        <Frame x:Name="Main" Grid.Column="2" Margin="0,34,0,0" Grid.RowSpan="2"/>


    </Grid>
</Border>

我在控件库中有一个资源字典,用于声明我的位图图像。 key =刷新-M UriSource =“ / Resources / Icons / Basic / refresh-100.png”您可以在下面的代码中看到其在...

wpf visual-studio xaml bitmap xbap
1个回答
0
投票
父亲uri是exe所在的文件夹
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.