質問編集履歴

3

不正な編集対応

2017/11/09 07:54

投稿

cancat
cancat

スコア313

test CHANGED
@@ -1 +1 @@
1
- 回答がな。回答がない。
1
+ Tileにイメージを表示した
test CHANGED
@@ -1 +1,131 @@
1
+ こんにちは。
2
+
3
+ Windows10でUWPのアプリケーションを開発しています。
4
+
5
+ Visual Studio 2017 Communityを使っています。
6
+
7
+
8
+
9
+ ###前提・実現したいこと
10
+
11
+ Tileにイメージを表示したいです。
12
+
13
+ 標準でイメージは出るものの、タイルに文字を表示している状態では、そのイメージがなく、単なるブルーバックになります。
14
+
15
+ 文字を表示するときにもイメージを表示するにはどうすればよいでしょう?
16
+
17
+
18
+
19
+
20
+
21
+ ###試したこと
22
+
23
+ NuGetでNotificationExtensions.Win10を入れました。
24
+
25
+
26
+
27
+ ###発生している問題・エラーメッセージ
28
+
29
+ 標準でイメージは出るものの、タイルに文字を表示している状態では、そのイメージがなく、単なるブルーバックになります。
30
+
31
+
32
+
33
+ ###該当のソースコード
34
+
35
+ ```C#
36
+
37
+
38
+
39
+ string title = "title";
40
+
41
+ string contenttext = "content";
42
+
43
+ var bindingContent = new TileBindingContentAdaptive
44
+
45
+ {
46
+
47
+ PeekImage = new TilePeekImage
48
+
49
+ {
50
+
1
- 回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。
51
+ Source = "Assets/Wide310x150Logo.scale-150.png"//<=ここでimage指定
52
+
53
+ },
54
+
55
+ Children =
56
+
57
+ {
58
+
59
+ new TileText{Text = title},
60
+
61
+ new TileText{Text = contenttext, Style=TileTextStyle.Caption}
62
+
63
+ }
64
+
65
+ };
66
+
67
+
68
+
69
+ var tileBinding = new TileBinding
70
+
71
+ {
72
+
73
+ Branding = TileBranding.NameAndLogo,
74
+
75
+ Content = bindingContent,
76
+
77
+ DisplayName = "MyNote",
78
+
79
+ };
80
+
81
+
82
+
83
+ var content = new TileContent
84
+
85
+ {
86
+
87
+ Visual = new TileVisual
88
+
89
+ {
90
+
91
+ TileSmall = tileBinding,
92
+
93
+ TileMedium = tileBinding,
94
+
95
+ TileLarge = tileBinding,
96
+
97
+ TileWide = tileBinding,
98
+
99
+ }
100
+
101
+ };
102
+
103
+
104
+
105
+ var n = new TileNotification(content.GetXml());
106
+
107
+ TileUpdateManager.CreateTileUpdaterForApplication()
108
+
109
+ .Update(n);
110
+
111
+
112
+
113
+ ```
114
+
115
+
116
+
117
+ ###補足情報(言語/FW/ツール等のバージョンなど)
118
+
119
+ Microsoft Visual Studio Community 2017
120
+
121
+ Version 15.0.26228.9 D15RTWSVC
122
+
123
+ Microsoft .NET Framework
124
+
125
+ Version 4.6.01586
126
+
127
+
128
+
129
+ です。
130
+
131
+ よろしくお願いします。

2

回答がない。

2017/11/09 07:54

投稿

退会済みユーザー
test CHANGED
@@ -1 +1 @@
1
- ボタンのコンテキストメニューに、フォントメニューを実装した
1
+ 回答がな。回答がない。
test CHANGED
@@ -1,111 +1 @@
1
- こんにちは。
2
-
3
- Windows10でWPFのアプリケーションを開発しています。
4
-
5
- Visual Studio 2017 Communityを使っています。
6
-
7
-
8
-
9
- ###前提・実現したいこと
10
-
11
- WPFのボタンのコンテキストメニューに、フォントメニューを実装したいです。
12
-
13
- 下記サイトを参照して、ListBoxをContextMenuにしようとしました、ListBoxにはあるItemTemplateの機能、ContextMenuにはないみたい。
1
+ 回答ない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。回答がない。
14
-
15
- どのように回避したらよいですか?
16
-
17
-
18
-
19
- ###試したこと
20
-
21
-
22
-
23
- ###発生している問題・エラーメッセージ
24
-
25
- ListBoxにはあるItemTemplateの機能が、ContextMenuにはない。
26
-
27
-
28
-
29
- ###該当のソースコード
30
-
31
- ```xaml
32
-
33
- original --http://sourcechord.hatenablog.com/entry/2014/04/25/013631
34
-
35
- <ListBox Width="200"
36
-
37
- Margin="10"
38
-
39
- HorizontalAlignment="Left"
40
-
41
- ItemsSource="{Binding FontList}">
42
-
43
- <ListBox.ItemTemplate>
44
-
45
- <DataTemplate>
46
-
47
- <TextBlock FontFamily="{Binding}"
48
-
49
- FontSize="16"
50
-
51
- Text="{Binding Converter={StaticResource FontFamilyToNameConverter},
52
-
53
- Mode=OneWay}" />
54
-
55
- </DataTemplate>
56
-
57
- </ListBox.ItemTemplate>
58
-
59
- </ListBox>
60
-
61
-
62
-
63
- ```
64
-
65
-
66
-
67
- ```xaml
68
-
69
- <Button x:Name="Font" Click="OnFontMenuClick">
70
-
71
- <Button.ContextMenu ItemsSource="{Binding FontList}">
72
-
73
- <ItemTemplate>
74
-
75
- <DataTemplate>
76
-
77
- <TextBlock FontFamily="{Binding}"
78
-
79
- FontSize="16"
80
-
81
- Text="{Binding Converter={StaticResource FontFamilyToNameConverter},
82
-
83
- Mode=OneWay}" />
84
-
85
- </DataTemplate>
86
-
87
- </ItemTemplate>
88
-
89
- </Button.ContextMenu> Font</Button>
90
-
91
- ```
92
-
93
-
94
-
95
-
96
-
97
- ###補足情報(言語/FW/ツール等のバージョンなど)
98
-
99
- Microsoft Visual Studio Community 2017
100
-
101
- Version 15.0.26228.9 D15RTWSVC
102
-
103
- Microsoft .NET Framework
104
-
105
- Version 4.6.01586
106
-
107
-
108
-
109
- です。
110
-
111
- よろしくお願いします。

1

add

2017/10/30 13:33

投稿

cancat
cancat

スコア313

test CHANGED
File without changes
test CHANGED
File without changes