質問編集履歴
6
xaml.csコードを追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -82,4 +82,20 @@
|
|
82
82
|
|
83
83
|
</ContentPage>
|
84
84
|
```
|
85
|
+
【Testプロジェクト】MainPage.xaml.cs
|
86
|
+
```
|
87
|
+
using Xamarin.Forms;
|
88
|
+
using Plugin.Feature1;
|
89
|
+
|
90
|
+
namespace Test.Views
|
91
|
+
{
|
92
|
+
public partial class MainPage : ContentPage
|
93
|
+
{
|
94
|
+
public MainPage ()
|
95
|
+
{
|
96
|
+
InitializeComponent ();
|
97
|
+
}
|
98
|
+
}
|
99
|
+
}
|
100
|
+
```
|
85
101
|
よろしくお願い致します。
|
5
クラス名の間違いを修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -67,7 +67,7 @@
|
|
67
67
|
}
|
68
68
|
}
|
69
69
|
```
|
70
|
-
【Testプロジェクト】
|
70
|
+
【Testプロジェクト】MainPage.xaml
|
71
71
|
```
|
72
72
|
<?xml version="1.0" encoding="utf-8" ?>
|
73
73
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
4
View1クラスの活用クラスを追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
- その場合通常プロジェクトで画面を作るときと異なる点はどこになるでしょうか?
|
19
19
|
|
20
20
|
以下ソースコードです
|
21
|
-
View1.xaml
|
21
|
+
【Feature1プロジェクト】View1.xaml
|
22
22
|
```
|
23
23
|
<?xml version="1.0" encoding="UTF-8"?>
|
24
24
|
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
|
@@ -32,7 +32,7 @@
|
|
32
32
|
</ContentView>
|
33
33
|
```
|
34
34
|
|
35
|
-
View1.xaml.cs
|
35
|
+
【Feature1プロジェクト】View1.xaml.cs
|
36
36
|
```
|
37
37
|
using System;
|
38
38
|
using System.Collections.Generic;
|
@@ -56,7 +56,7 @@
|
|
56
56
|
}
|
57
57
|
```
|
58
58
|
|
59
|
-
IFeature1.shared.cs
|
59
|
+
【Feature1プロジェクト】IFeature1.shared.cs
|
60
60
|
```
|
61
61
|
using Xamarin.Forms;
|
62
62
|
|
@@ -67,5 +67,19 @@
|
|
67
67
|
}
|
68
68
|
}
|
69
69
|
```
|
70
|
+
【Testプロジェクト】Main.xaml
|
71
|
+
```
|
72
|
+
<?xml version="1.0" encoding="utf-8" ?>
|
73
|
+
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
74
|
+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
75
|
+
xmlns:hoge="clr-namespace:Plugin.Feature1;assembly=Plugin.Feature1"
|
76
|
+
x:Class="Test.Views.MainPage"
|
77
|
+
Title="{Binding Title}">
|
70
78
|
|
79
|
+
<StackLayout HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand">
|
80
|
+
<hoge:View1/>
|
81
|
+
</StackLayout>
|
82
|
+
|
83
|
+
</ContentPage>
|
84
|
+
```
|
71
85
|
よろしくお願い致します。
|
3
コード追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -17,4 +17,55 @@
|
|
17
17
|
- xamlから作ることは可能でしょうか?
|
18
18
|
- その場合通常プロジェクトで画面を作るときと異なる点はどこになるでしょうか?
|
19
19
|
|
20
|
+
以下ソースコードです
|
21
|
+
View1.xaml
|
22
|
+
```
|
23
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
24
|
+
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
|
25
|
+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
26
|
+
x:Class="Plugin.Feature1.View1">
|
27
|
+
<ContentView.Content>
|
28
|
+
<StackLayout HorizontalOptions="Center" VerticalOptions="Center" BackgroundColor="Black">
|
29
|
+
<Label Text="Hello Xamarin.Forms!" TextColor="White"/>
|
30
|
+
</StackLayout>
|
31
|
+
</ContentView.Content>
|
32
|
+
</ContentView>
|
33
|
+
```
|
34
|
+
|
35
|
+
View1.xaml.cs
|
36
|
+
```
|
37
|
+
using System;
|
38
|
+
using System.Collections.Generic;
|
39
|
+
using System.Linq;
|
40
|
+
using System.Text;
|
41
|
+
using System.Threading.Tasks;
|
42
|
+
|
43
|
+
using Xamarin.Forms;
|
44
|
+
using Xamarin.Forms.Xaml;
|
45
|
+
|
46
|
+
namespace Plugin.Feature1
|
47
|
+
{
|
48
|
+
[XamlCompilation(XamlCompilationOptions.Compile)]
|
49
|
+
public partial class View1 : ContentView
|
50
|
+
{
|
51
|
+
public View1 ()
|
52
|
+
{
|
53
|
+
InitializeComponent ();
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
```
|
58
|
+
|
59
|
+
IFeature1.shared.cs
|
60
|
+
```
|
61
|
+
using Xamarin.Forms;
|
62
|
+
|
63
|
+
namespace Plugin.Feature1
|
64
|
+
{
|
65
|
+
public interface IFeature1
|
66
|
+
{
|
67
|
+
}
|
68
|
+
}
|
69
|
+
```
|
70
|
+
|
20
71
|
よろしくお願い致します。
|
2
質問内容を箇条書きに
title
CHANGED
File without changes
|
body
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
xamlを追加し、ルートをcontentViewに変更するなどしてみましたが、
|
15
15
|
呼び出した際にエラーこそでないものの、画面に表示されません。
|
16
16
|
|
17
|
-
xamlから作ることは可能でしょうか?
|
17
|
+
- xamlから作ることは可能でしょうか?
|
18
|
-
|
18
|
+
- その場合通常プロジェクトで画面を作るときと異なる点はどこになるでしょうか?
|
19
19
|
|
20
20
|
よろしくお願い致します。
|
1
試したことを追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -11,6 +11,9 @@
|
|
11
11
|
といったことはできました。
|
12
12
|
しかし可能であれば、xamlでUIを作り、呼び出せるようしたいと考えています。
|
13
13
|
|
14
|
+
xamlを追加し、ルートをcontentViewに変更するなどしてみましたが、
|
15
|
+
呼び出した際にエラーこそでないものの、画面に表示されません。
|
16
|
+
|
14
17
|
xamlから作ることは可能でしょうか?
|
15
18
|
また、その場合通常プロジェクトで画面を作るときと異なる点はどこになるでしょうか?
|
16
19
|
|