wpf下图标无法显示的问题记录

<TextBlock Cursor="Hand" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,0" 
Name="btnMin" Text="{Binding RowData.Row.TypeIcon.IconCode}"
Style="{StaticResource FIcon}" FontSize="16" Foreground="{Binding RowData.Row.TypeIcon.IconColor}">
</TextBlock>

 

上面红色的部分一直显示找不到对象,图标那里一直报错,原因就是忘了从另外一个项目里拷到一段代码到app.xaml里,如下:

<Application x:Class="Main.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:Main"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/DataResource;component/skin/style.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

留此贴备用

posted @ 2019-11-12 20:51  星星c#  阅读(1544)  评论(0编辑  收藏  举报