2016-11-21 11 views
0

저는 Windows Phone 개발을 처음 사용하고 UserControl 내에서 배경 이미지를 설정하는 데 어려움을 겪고 있습니다. 정적 리소스로 사용하려는 경우 이미지가 특정 xaml에 대한 것입니다. 파일. 내 프로젝트의 Assets 폴더에 이미 에 저장되어 있습니다. 자원 컬렉션에서 코드에서UserControl 내 배경 이미지 정의

<UserControl 
x:Class="OrangePulse.LoginControl" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:local="using:OrangePulse" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
mc:Ignorable="d" 
d:DesignHeight="800" 
d:DesignWidth="500"> 

<UserControl.Resources> 

    <BitmapImage x:Key="splashScreen" UriSource="/Assets/loginBgd.png"/> 
</UserControl.Resources> 

답변

0

만 추가 한 이미지 : 아직도 내가 아래의 코드는 미리보기 창

에 내 이미지를 볼 수 없습니다 여기 내 XAML 파일입니다.

<UserControl.Resources> 
    <BitmapImage x:Key="splashScreen" UriSource="/Assets/loginBgd.png"/> 
</UserControl.Resources> 

당신이 타격 라인을 추가하는 경우는 이미지가 표시됩니다 것처럼 ... 이미지를 표시 할 수있는 컨트롤이 자원을 결합해야 ..

<UserControl.Resources> 
    <BitmapImage x:Key="splashScreen" UriSource="/Assets/loginBgd.png"/> 
    </UserControl.Resources> 
**<Image Source="{StaticResource splashScreen}"/>**