-1
A
답변
0
나는 일반적으로 다음과 같습니다 속성이라는 기본에 세션라는 클래스 생성 :
이public class SessionBase<T> : INotifyPropertyChanged where T : class
{
public static T Default
{
get
{
var instance = Application.Current.Resources["SessionName"] as T;
if (instance == null)
{
instance = Activator.CreateInstance<T>();
Application.Current.Resources.Add("SessionName", instance);
}
return instance;
}
}
}
그런 다음 내 app.xaml에 내가 가진를 :
<Classes:Session x:Name="SessionName"/>
이 방법을 사용하면 바인딩 및 C# (코드 숨김)을 사용하여 동일한 인스턴스에 액세스 할 수 있습니다. T는 SessionBase를 상속받으며 해당 클래스에서 원하는 정보를 저장할 수 있으며 응용 프로그램 세션 동안 계속 사용할 수 있습니다. 예 :
public class Session : SessionBase<Session>
{
public int X { get; set; }
}
당신이 말하는 "다른 페이지에서 리콜"때와 C#
관련 문제
- 1. Silverlight ChildWindow Memory Leak
- 2. getmem memory leak, delphi
- 3. AVCaptureStillImageOutput outputSettings memory leak
- 4. Software Transactional Memory + Spring
- 5. GridView Exceding Memory Budget
- 6. getpwnam_r memory leak
- 7. sun.font.TrueTypeFont Memory Leak?
- 8. UITextView memory leak
- 9. web.py memory leak
- 10. Eclipse Memory Analyzer [MAT]
- 11. ": memory : '데이터베이스에있는 테이블
- 12. NSDate & Memory management
- 13. pthread_create memory leak?
- 14. javascript jsonp memory leak
- 15. JGroups eating memory
- 16. Java : Memory efficient ByteArrayOutputStream
- 17. Spring in-memory 데이터베이스
- 18. PHP Imagick memory leak
- 19. cuda memory allocation cudaMalloc
- 20. NSArray sortedArrayUsingSelector memory leak
- 21. Delphi Memory Issue (FastMM4)
- 22. android app memory question
- 23. TreeView.Items.Filter Memory Leak, HELP!
- 24. iOS Memory malady madness
- 25. Out of Memory 예외
- 26. "php : // memory"스트림에서 포함
- 27. android calculator : memory function
- 28. android java memory management
- 29. Perl substr memory leak
- 30. CreateRemoteThread : Memory Managment
에서 액세스합니다 (두 바인딩 방법에 대해하여 PropertyChanged를 인상 할 필요가) 그런 다음 X에 결합 할 수있을 것입니다, 당신은 의미합니까 Silverlight 컨트롤을 실행할 다른 페이지 또는 다른 HTML 페이지? 모든 것이 실버 컨트롤에 있다면 격리 된 저장소를 사용하십시오. 그렇지 않은 경우 데이터를 일부 백엔드에 저장하고 RIA 서비스를 사용하여 Silverlight에서 데이터를 쓰고 페이지에서 읽을 수 있습니다. – vcsjones
SL 구성 요소가 내장 된 ASP.NET 웹 사이트를 제작하고 있는지 또는 100 % SL 사이트를 만들고 있는지 명확하게 설명하십시오. –
동일한 실버 라이트 프로젝트의 다른 페이지를 의미합니다. Isolated Storage가 내가 찾고있는 것으로 생각합니다. 지금 시도하고 있습니다. –