简体   繁体   中英

Deploying a silverlight site

I have just tried to deploy my silverlight 4 site and ran across a problem. I keep all of my styles etc. in a resource file and reference them like this:

 <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Resources/Styles.xaml" />
                <ResourceDictionary Source="Resources/Templates.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>

After deploying my website, my listbox (which has an overriden item template which i store in my templates.xaml) looked empty. However i know that i should see three items in my listbox, and i am able select three lines in the listbox they are just all empty. The problem seems to be that nothing gets drawn in the listbox items because i can not get to the resource file to get my style. I have tried making the resource files embeded resources but no help. Any ideas?

Ensure that the Templates.xaml file is part of your xap file.

To do that make sure the "Build Action" (in the properties of the Templates.xaml file) is set to "Resource"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM