سؤال

أنا ألعب مع قالب صفحة بدء تشغيل مخصص في VS.

كيف أذهب حول تضمين صورة يمكنني استخدامها في صفحة البدء XAML.لقد جربت الطريقة العادية لوضع الصورة على الموارد وإعداد الخاصية المصدر على عنصر تحكم الصورة إلى اسم الملف. giveacodicetagpre.

لكنه لا يعمل ... يبني موافق وتدور صفحة البدء موافق، ولكن لا يظهر الصورة.إذا كنت ألتصق بعنوان URL للمصدر الذي يعمل بشكل جيد.

تشك ستيف

هل كانت مفيدة؟

المحلول

I believe that if you have to set the Source like this:

<Image Source="pack://application:,,,/logo.jpg" />

نصائح أخرى

If the Build Action is Resource in the Properties window:

<Image Source="pack://application:,,,/AssemblyName;component/Resources/logo.jpg" />

If the Build Action is Content and Include in VSIX is True in the Properties window:

<Image Source="pack://application:,/Resources/logo.jpg" />

Considering the logo.jpg is in the Resources folder.

You need to set the Source like this

   <Image Source="pack://application:,/Resources/view.png" Margin="5"/>

Then you had to mark the picture in the Properties Section as Content and set the Include in VSIX to True.

Hope that would help, Greetings from Noxum

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top