質問編集履歴
3
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -45,7 +45,7 @@
|
|
45
45
|
```
|
46
46
|
**呼び出し側 : MobileTrader **
|
47
47
|
```
|
48
|
-
IPlatformInfo info = DependencyService.
|
48
|
+
IPlatformInfo info = DependencyService.Get<IPlatformInfo>();
|
49
49
|
```
|
50
50
|
|
51
51
|
**実行時エラー : 呼び出し側のコードで発生**
|
2
補足説明追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -15,4 +15,40 @@
|
|
15
15
|
|
16
16
|
### 試したこと
|
17
17
|
|
18
|
-
using でXamarin.iOSも読み込むこともできませんMobileTrader.iOSも読み込むことができませんでした。
|
18
|
+
using でXamarin.iOSも読み込むこともできませんMobileTrader.iOSも読み込むことができませんでした。
|
19
|
+
|
20
|
+
### DependencyService 検証コード
|
21
|
+
|
22
|
+
**MobileTrader / IPlatformInfo.cs**
|
23
|
+
```
|
24
|
+
namespace MobileTrader
|
25
|
+
{
|
26
|
+
public interface IPlatformInfo
|
27
|
+
{
|
28
|
+
string GetDeviceModel();
|
29
|
+
}
|
30
|
+
}
|
31
|
+
```
|
32
|
+
**MobileTrader.iOS / PlatformInfo.cs**
|
33
|
+
```
|
34
|
+
[assembly: Xamarin.Forms.Dependency(typeof(MobileTrader.iOS.PlatformInfo))]
|
35
|
+
namespace MobileTrader.iOS
|
36
|
+
{
|
37
|
+
public class PlatformInfo : IPlatformInfo
|
38
|
+
{
|
39
|
+
public string GetDeviceModel()
|
40
|
+
{
|
41
|
+
return Xamarin.iOS.DeviceHardware.Model;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}
|
45
|
+
```
|
46
|
+
**呼び出し側 : MobileTrader **
|
47
|
+
```
|
48
|
+
IPlatformInfo info = DependencyService.GET<IPlatformInfo>();
|
49
|
+
```
|
50
|
+
|
51
|
+
**実行時エラー : 呼び出し側のコードで発生**
|
52
|
+
```
|
53
|
+
System.MissingException : <Timeout exceeded setting exception details>
|
54
|
+
```
|
1
詳細追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -11,4 +11,8 @@
|
|
11
11
|
```
|
12
12
|
// 端末情報取得 ( 例: iPhone X Emulator )
|
13
13
|
DeviceData = Xamarin.iOS.DeviceHardware.Model
|
14
|
-
```
|
14
|
+
```
|
15
|
+
|
16
|
+
### 試したこと
|
17
|
+
|
18
|
+
using でXamarin.iOSも読み込むこともできませんMobileTrader.iOSも読み込むことができませんでした。
|