0

So I have this code in XAML and basically I'm adding image icons to it. However they only show up in the design view and I have no idea how I'm going to make them show up in the runtime view :( Ps. I'm new to both xaml and stackoverflow so I hope the display of this message will be fine...

Thanks. Here is the code:

<UserControl x:Class="NewspaperArticle.TextEditorToolbar"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
         mc:Ignorable="d" 
         d:DesignHeight="300" d:DesignWidth="300">

<ToolBarTray x:Name="top"
             DockPanel.Dock="Top">

    <ToolBar>
        <Button ToolTip="Open"
                Click="Open_Click">

            <Image Source="Icons/open.png"
                   Height="30"
                   Width="30"/>
        </Button>

        <Button ToolTip="Save"
                Click="Save_Click">

            <Image Source="Icons/save.png"
                   Height="30"
                   Width="30"/>
        </Button>


            <Button ToolTip="Cut"
                    Command="ApplicationCommands.Cut">
                <Image Source="Icons/cut-icon.gif"
                       Height="30"
                       Width="30"/>
            </Button>

        <Button ToolTip="Open">
            <Image Source="Icons/open.png"
                   Height="30"
                   Width="30"/>

        </Button>

        <Button ToolTip="Coyp"
                Command="ApplicationCommands.Copy">
            <Image Source="Icons/copy.png"
                   Height="30"
                   Width="30"/>
        </Button>

        <Button ToolTip="Paste"
                Command="ApplicationCommands.Paste">
            <Image Source="Icons/Paste.png"
                   Height="30"
                   Width="30"/>
        </Button>

    </ToolBar>

    <ToolBar>

        <ToggleButton x:Name="boldButton"
                      ToolTip="Bold"
                      Command="EditingCommands.ToggleBold">

            <Image Source="Icons/text_bold.png"
                   Height="25"
                   Width="25"/>
        </ToggleButton>

        <ToggleButton x:Name="italicButton"
                      ToolTip="Italic"
                      Command="EditingCommands.ToggleItalic">

            <Image Source="Icons/text_italic.png"
                   Height="25"
                   Width="25"/>
        </ToggleButton>

        <ToggleButton x:Name="underlineButton"
                      ToolTip="Underline"
                      Command="EditingCommands.ToggleUnderline">

            <Image Source="Icons/text_underline.png"
                   Height="25"
                   Width="25"/>
        </ToggleButton>

        <Separator/>

        <ComboBox x:Name="fonts"
                  MinWidth="100"
                  ItemsSource="{x:Static Fonts.SystemFontFamilies}"
                  ToolTip="Fonts"/>

        <ComboBox x:Name="fontsize"
                  MinWidth="40"
                  ToolTip="Font Size"
                  SelectedIndex="0">

        </ComboBox>

    </ToolBar>

</ToolBarTray>
NBoymanns
  • 686
  • 6
  • 16
  • Possible duplicate of [In my WPF application, my loaded PNG logo in image shows at design time but not at run time](http://stackoverflow.com/questions/15653105/in-my-wpf-application-my-loaded-png-logo-in-image-shows-at-design-time-but-not) – Clemens Dec 02 '15 at 15:29
  • Try add "ms-appx://" e.g. Source="ms-appx:///Icons/open.png" – Michal Kania Dec 03 '15 at 11:05

0 Answers0