2008/03/25 11:56
퍼가기 시의 Application.Current.Host.Source의 각종 프로퍼티 확인
2008/03/25 11:56 in Silverlight 2/Experiment

실험의 목적
Application.Current.Host.Source의 주석은 아래와 같습니다.
xap 파일을 활용하여 object 태그를 사용하여 퍼가기를 한 경우
실버라이트 객체가 자기가 호스팅되는 위치를 Application.Current.Host.Source를
통해서 정확히 참조 할 수 있는지 확인하는 것입니다.
퍼가기 코드
테스트
아래 버튼을 클릭해 보십시오.
결과
사용자가 object 객체의 Parameter 중 source로 입력한 경로를
무조건 '상대경로'로 인식하여 프로퍼티에 저장하고 있는 문제를 확인하였습니다.
웹서비스를 사용 시 로컬에서 실행될 때와 서버에서 실행될 경우에 관계없이
자동으로 Host 인식해서 Service Reference를 현재 서버경로로 바꿔주는
방식을 구현하는데 Application.Current.Host.Source를 사용할 경우 주의가 필요할 것 같습니다.
Application.Current.Host.Source의 주석은 아래와 같습니다.
// Summary:
// Gets the URI of the XAML file that specifies the XAML content to render.
//
// Returns:
// The URI of the XAML file or XAML scripting tag that contains the content
// to load into the Silverlight plug-in. Generally, this is a reference to a
// XAML file. The URI can also be an inline XAML reference using the "#" prefix;
// see Remarks.
// Gets the URI of the XAML file that specifies the XAML content to render.
//
// Returns:
// The URI of the XAML file or XAML scripting tag that contains the content
// to load into the Silverlight plug-in. Generally, this is a reference to a
// XAML file. The URI can also be an inline XAML reference using the "#" prefix;
// see Remarks.
xap 파일을 활용하여 object 태그를 사용하여 퍼가기를 한 경우
실버라이트 객체가 자기가 호스팅되는 위치를 Application.Current.Host.Source를
통해서 정확히 참조 할 수 있는지 확인하는 것입니다.
퍼가기 코드
<object data="data:application/x-silverlight," type="application/x-silverlight-2-b1" width="630" height="300"> <param name="source" value="http://shiverlight.net/Sample/HostSourceTest.xap"/> <param name="onerror" value="onSilverlightError" /> <param name="background" value="white" /> <a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;"> <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/> </a> </object>
테스트
아래 버튼을 클릭해 보십시오.
결과
사용자가 object 객체의 Parameter 중 source로 입력한 경로를
무조건 '상대경로'로 인식하여 프로퍼티에 저장하고 있는 문제를 확인하였습니다.
웹서비스를 사용 시 로컬에서 실행될 때와 서버에서 실행될 경우에 관계없이
자동으로 Host 인식해서 Service Reference를 현재 서버경로로 바꿔주는
방식을 구현하는데 Application.Current.Host.Source를 사용할 경우 주의가 필요할 것 같습니다.
이올린에 북마크하기
이올린에 추천하기
Prev

Rss Feed