티스토리 뷰
반응형
자마린에서의 settings란 Shared Message라고 보면 된다.
안드로이드로 치면 Shared Preference 정도이다.
사용법은 다음과 같다.
1. 자마린 폼 프로젝트에서 인터페이스 만들기
파일명 : ISettings.cs
public interface ISettings
{
bool GetAuto();
void SetAuto(bool isAuto);
void SetDeviceRotationEnable(bool isEnabled);
}
2. 드로이드 프로젝트에서 인터페이스 구현
파일명 : SettingsProvider.cs
[assembly: Dependency (typeof(SettingsProvider))]
namespace TTMobile.Droid
{
public class SettingsProvider : ISettings
{
public bool GetAuto()
{
return Settings.AutoLoginSettings;
}
public void SetAuto(bool isAuto)
{
Settings.AutoLoginSettings = isAuto;
}
public void SetDeviceRotationEnable(bool isEnabled)
{
if(isEnabled)
{
//Activity.RequestedOrientation = ScreenOrientation.;
}
Settings.DeviceRotationSettings = isEnabled;
}
}
}
3. 자마린 폼 프로젝트에서 사용
DependencyService.Get<ISettings>().SetAuto(true);
반응형
'Programming > Old' 카테고리의 다른 글
#event (0) | 2016.04.11 |
---|---|
# The differences between Observer/Observable and Publisher/Subscriber Patterns (0) | 2016.04.11 |
Separation of Concerns [ 관심사 분리 ] (0) | 2016.04.09 |
#[스크랩]iOS9 App Transport Security 설정법 출처 (0) | 2016.04.07 |
#[MS Prism] UI Composition Quick Start Exam. (0) | 2016.04.06 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 동시성
- PFF
- 차이
- grpc
- 세그먼테이션
- QT
- 고독
- 병렬성
- 메시지지향미들웨어
- 파이썬
- SSTF
- MoM
- 페이징
- 스와핑
- 섹터 큐잉
- C-LOOK
- look
- c#
- N-step SCAN
- 병행성
- 주식
- FCFS
- Cocos2d-x
- 중요성
- 크로스플랫폼
- scan
- 스위프트
- 수요
- vmin
- C-SCAN
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
글 보관함