0

I have several image files defined in the <Application.Resources> section of the App.xaml file. Is it possible to do the same with text files? If yes, how to do it?

<Application.Resources>
    <Image x:Key="Img_DefaultCover" Source="/Images/defaultCover.png" />
</Application.Resources>
Jose Afonso
  • 117
  • 8
  • 2
    What do you want to do with the text file? I don't think there's a built-in element that sources from a text file similar tot he way Image does with image files. Check the answers to https://stackoverflow.com/questions/1995325/bind-wpf-textblock-to-text-file for possible ways to do what you're wanting to do. – Paul Dempsey Feb 16 '23 at 23:39
  • 1
    Application.Resources does not support this, you need to use Api to read the file content. You can refer to the link provided by @PaulDempsey. – Junjie Zhu - MSFT Feb 17 '23 at 09:16

0 Answers0