<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://monobook.org/w/index.php?action=history&amp;feed=atom&amp;title=MAUI%E3%81%AEXAML%E3%81%A7%E3%83%9C%E3%82%BF%E3%83%B3%E3%81%AE%E4%B8%AD%E8%BA%AB%E3%82%92View%E3%81%AB%E3%81%97%E3%81%9F%E3%81%84</id>
	<title>MAUIのXAMLでボタンの中身をViewにしたい - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://monobook.org/w/index.php?action=history&amp;feed=atom&amp;title=MAUI%E3%81%AEXAML%E3%81%A7%E3%83%9C%E3%82%BF%E3%83%B3%E3%81%AE%E4%B8%AD%E8%BA%AB%E3%82%92View%E3%81%AB%E3%81%97%E3%81%9F%E3%81%84"/>
	<link rel="alternate" type="text/html" href="https://monobook.org/w/index.php?title=MAUI%E3%81%AEXAML%E3%81%A7%E3%83%9C%E3%82%BF%E3%83%B3%E3%81%AE%E4%B8%AD%E8%BA%AB%E3%82%92View%E3%81%AB%E3%81%97%E3%81%9F%E3%81%84&amp;action=history"/>
	<updated>2026-06-05T06:54:40Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://monobook.org/w/index.php?title=MAUI%E3%81%AEXAML%E3%81%A7%E3%83%9C%E3%82%BF%E3%83%B3%E3%81%AE%E4%B8%AD%E8%BA%AB%E3%82%92View%E3%81%AB%E3%81%97%E3%81%9F%E3%81%84&amp;diff=20458&amp;oldid=prev</id>
		<title>Administrator: /* 解決策：ContentView派生クラスのボタンを作る */</title>
		<link rel="alternate" type="text/html" href="https://monobook.org/w/index.php?title=MAUI%E3%81%AEXAML%E3%81%A7%E3%83%9C%E3%82%BF%E3%83%B3%E3%81%AE%E4%B8%AD%E8%BA%AB%E3%82%92View%E3%81%AB%E3%81%97%E3%81%9F%E3%81%84&amp;diff=20458&amp;oldid=prev"/>
		<updated>2024-04-03T02:32:55Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;解決策：ContentView派生クラスのボタンを作る&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2024年4月3日 (水) 02:32時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l37&quot;&gt;37行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;37行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     &amp;lt;StackLayout&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     &amp;lt;StackLayout&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         &amp;lt;!-- &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;スマホのカメラアによくある撮影ボタンのようなもの &lt;/del&gt;--&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         &amp;lt;!-- &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;スマホのカメラによくある撮影ボタンのようなもの &lt;/ins&gt;--&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         &amp;lt;local:ContentButton&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         &amp;lt;local:ContentButton&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             BackgroundColor=&amp;quot;CornflowerBlue&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             BackgroundColor=&amp;quot;CornflowerBlue&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Administrator</name></author>
	</entry>
	<entry>
		<id>https://monobook.org/w/index.php?title=MAUI%E3%81%AEXAML%E3%81%A7%E3%83%9C%E3%82%BF%E3%83%B3%E3%81%AE%E4%B8%AD%E8%BA%AB%E3%82%92View%E3%81%AB%E3%81%97%E3%81%9F%E3%81%84&amp;diff=20457&amp;oldid=prev</id>
		<title>2024年4月3日 (水) 02:32にAdministratorによる</title>
		<link rel="alternate" type="text/html" href="https://monobook.org/w/index.php?title=MAUI%E3%81%AEXAML%E3%81%A7%E3%83%9C%E3%82%BF%E3%83%B3%E3%81%AE%E4%B8%AD%E8%BA%AB%E3%82%92View%E3%81%AB%E3%81%97%E3%81%9F%E3%81%84&amp;diff=20457&amp;oldid=prev"/>
		<updated>2024-04-03T02:32:46Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2024年4月3日 (水) 02:32時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l37&quot;&gt;37行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;37行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     &amp;lt;StackLayout&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     &amp;lt;StackLayout&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         &amp;lt;!-- &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;カメラの撮影ボタンのようなもの &lt;/del&gt;--&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         &amp;lt;!-- &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;スマホのカメラアによくある撮影ボタンのようなもの &lt;/ins&gt;--&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         &amp;lt;local:ContentButton&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         &amp;lt;local:ContentButton&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             BackgroundColor=&amp;quot;CornflowerBlue&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             BackgroundColor=&amp;quot;CornflowerBlue&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Administrator</name></author>
	</entry>
	<entry>
		<id>https://monobook.org/w/index.php?title=MAUI%E3%81%AEXAML%E3%81%A7%E3%83%9C%E3%82%BF%E3%83%B3%E3%81%AE%E4%B8%AD%E8%BA%AB%E3%82%92View%E3%81%AB%E3%81%97%E3%81%9F%E3%81%84&amp;diff=20456&amp;oldid=prev</id>
		<title>Administrator: ページの作成:「  MAUIのButtonの中身をXAMLの図形機能でベクター画像として描画しようと思ったがMAUIのButtonの中に別Viewは配置できないらしい。 M…」</title>
		<link rel="alternate" type="text/html" href="https://monobook.org/w/index.php?title=MAUI%E3%81%AEXAML%E3%81%A7%E3%83%9C%E3%82%BF%E3%83%B3%E3%81%AE%E4%B8%AD%E8%BA%AB%E3%82%92View%E3%81%AB%E3%81%97%E3%81%9F%E3%81%84&amp;diff=20456&amp;oldid=prev"/>
		<updated>2024-04-03T02:32:20Z</updated>

		<summary type="html">&lt;p&gt;ページの作成:「  MAUIのButtonの中身をXAMLの図形機能でベクター画像として描画しようと思ったがMAUIのButtonの中に別Viewは配置できないらしい。 M…」&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
MAUIのButtonの中身をXAMLの図形機能でベクター画像として描画しようと思ったがMAUIのButtonの中に別Viewは配置できないらしい。&lt;br /&gt;
MAUIのButtonクラスはViewの派生クラスでありダイレクトコンテンツをサポートしていないらしい。&lt;br /&gt;
Buttonクラスは文字を表示するしかできない。&lt;br /&gt;
まじでゴミ。&lt;br /&gt;
&lt;br /&gt;
Gridなどで代用しようと試みたがGridにはClickedなどのイベントも見当たらない。&lt;br /&gt;
まじでゴミ。&lt;br /&gt;
&lt;br /&gt;
== 解決策：ContentView派生クラスのボタンを作る ==&lt;br /&gt;
ViewではなくContentViewを基底クラスとするボタンを作る。&lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using Microsoft.Maui.Controls;&lt;br /&gt;
&lt;br /&gt;
public class ContentButton : ContentView&lt;br /&gt;
{&lt;br /&gt;
    public event EventHandler? Clicked;&lt;br /&gt;
&lt;br /&gt;
    public ContentButton()&lt;br /&gt;
    {&lt;br /&gt;
        var tapGestureRecognizer = new TapGestureRecognizer();&lt;br /&gt;
        tapGestureRecognizer.Tapped += (s, e) =&amp;gt; Clicked?.Invoke(this, e);&lt;br /&gt;
        GestureRecognizers.Add(tapGestureRecognizer);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
こんな感じで使う。&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; ?&amp;gt;&lt;br /&gt;
&amp;lt;ContentPage xmlns=&amp;quot;http://schemas.microsoft.com/dotnet/2021/maui&amp;quot;&lt;br /&gt;
             xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2009/xaml&amp;quot;&lt;br /&gt;
             xmlns:local=&amp;quot;using:Capture8&amp;quot;&lt;br /&gt;
             x:Class=&amp;quot;Capture8.MainPage&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;StackLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;!-- カメラの撮影ボタンのようなもの --&amp;gt;&lt;br /&gt;
        &amp;lt;local:ContentButton&lt;br /&gt;
            BackgroundColor=&amp;quot;CornflowerBlue&amp;quot;&lt;br /&gt;
            WidthRequest=&amp;quot;80&amp;quot;&lt;br /&gt;
            HeightRequest=&amp;quot;80&amp;quot;&lt;br /&gt;
            HorizontalOptions=&amp;quot;CenterAndExpand&amp;quot;&lt;br /&gt;
            VerticalOptions=&amp;quot;CenterAndExpand&amp;quot;&lt;br /&gt;
            Clicked=&amp;quot;OnCaptureButtonClicked&amp;quot; &amp;gt;&lt;br /&gt;
            &amp;lt;Grid&amp;gt;&lt;br /&gt;
                &amp;lt;Ellipse WidthRequest=&amp;quot;70&amp;quot; HeightRequest=&amp;quot;70&amp;quot; Fill=&amp;quot;Red&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;Ellipse WidthRequest=&amp;quot;60&amp;quot; HeightRequest=&amp;quot;60&amp;quot; Fill=&amp;quot;White&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/Grid&amp;gt;&lt;br /&gt;
        &amp;lt;/local:ContentButton&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/StackLayout&amp;gt;          &lt;br /&gt;
&amp;lt;/ContentPage&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category: MAUI]]&lt;/div&gt;</summary>
		<author><name>Administrator</name></author>
	</entry>
</feed>