{"id":546,"date":"2019-12-23T02:50:36","date_gmt":"2019-12-22T17:50:36","guid":{"rendered":"http:\/\/marius.main.jp\/software\/blog\/?p=546"},"modified":"2021-03-14T05:41:02","modified_gmt":"2021-03-13T20:41:02","slug":"post-546","status":"publish","type":"post","link":"https:\/\/todosoft.net\/blog\/?p=546","title":{"rendered":"\u30c6\u30ad\u30b9\u30c8\u306b\u7e01\u53d6\u308a\u3092\u4ed8\u3051\u308b"},"content":{"rendered":"\n<p>\u53c2\u7167<br><a rel=\"noreferrer noopener\" aria-label=\"WPF  \u2013  \u6587\u5b57\u306e\u7e01\u53d6\u308a\u65b9\u6cd5   \u2013   astel-labs.net  (\u65b0\u3057\u3044\u30bf\u30d6\u3067\u958b\u304f)\" href=\"http:\/\/astel-labs.net\/blog\/diary\/2011\/01\/110120-1.html\" target=\"_blank\">WPF  \u2013  \u6587\u5b57\u306e\u7e01\u53d6\u308a\u65b9\u6cd5   \u2013   astel-labs.net <\/a><br><a rel=\"noreferrer noopener\" aria-label=\"WPF  \u2013  \u6587\u5b57\u306e\u7e01\u53d6\u308a\u3092\u3059\u308b   \u2013   astel-labs.net  (\u65b0\u3057\u3044\u30bf\u30d6\u3067\u958b\u304f)\" href=\"http:\/\/astel-labs.net\/blog\/diary\/2012\/05\/06-1.html\" target=\"_blank\">WPF  \u2013  \u6587\u5b57\u306e\u7e01\u53d6\u308a\u3092\u3059\u308b   \u2013   astel-labs.net <\/a><\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">FontBorderTextBlock.xaml<\/h2>\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-csharp\"><code class=\"language-csharp\">&lt;Grid x:Class=\"FontBorder.FontBorderTextBlock\"\n        xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"\n        xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"\n        xmlns:d=\"http:\/\/schemas.microsoft.com\/expression\/blend\/2008\"\n        xmlns:mc=\"http:\/\/schemas.openxmlformats.org\/markup-compatibility\/2006\"\n        xmlns:local=\"clr-namespace:FontBorder\"\n        mc:Ignorable=\"d\">\n\n    &lt;TextBlock Text=\"{Binding Text}\" Foreground=\"{Binding BorderColor}\" FontSize=\"{Binding FontSize}\">\n        &lt;TextBlock.RenderTransform>\n            &lt;TranslateTransform X=\"0\" Y=\"1\" \/>\n        &lt;\/TextBlock.RenderTransform>\n    &lt;\/TextBlock>\n    &lt;TextBlock Text=\"{Binding Text}\" Foreground=\"{Binding BorderColor}\" FontSize=\"{Binding FontSize}\">\n        &lt;TextBlock.RenderTransform>\n            &lt;TranslateTransform X=\"0\" Y=\"-1\" \/>\n        &lt;\/TextBlock.RenderTransform>\n    &lt;\/TextBlock>\n    &lt;TextBlock Text=\"{Binding Text}\" Foreground=\"{Binding BorderColor}\" FontSize=\"{Binding FontSize}\">\n        &lt;TextBlock.RenderTransform>\n            &lt;TranslateTransform X=\"1\" Y=\"0\" \/>\n        &lt;\/TextBlock.RenderTransform>\n    &lt;\/TextBlock>\n    &lt;TextBlock Text=\"{Binding Text}\" Foreground=\"{Binding BorderColor}\" FontSize=\"{Binding FontSize}\">\n        &lt;TextBlock.RenderTransform>\n            &lt;TranslateTransform X=\"-1\" Y=\"0\" \/>\n        &lt;\/TextBlock.RenderTransform>\n    &lt;\/TextBlock>\n    &lt;TextBlock Text=\"{Binding Text}\" Foreground=\"{Binding Foreground}\" FontSize=\"{Binding FontSize}\" \/>\n\n&lt;\/Grid><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">FontBorderTextBlock.xaml.cs<\/h2>\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-csharp\"><code class=\"language-csharp\">using System.Windows;\nusing System.Windows.Controls;\n\nnamespace FontBorder\n{\n    \/\/\/ &lt;summary>\n    \/\/\/ FontBorderTextBlock.xaml \u306e\u76f8\u4e92\u4f5c\u7528\u30ed\u30b8\u30c3\u30af\n    \/\/\/ &lt;\/summary>\n    public partial class FontBorderTextBlock : Grid\n    {\n        public string Text { get; set; } = \"\";\n\n        public string Foreground { get; set; } = \"Black\";\n\n        public string BorderColor { get; set; } = \"White\";\n\n        public double FontSize { get; set; } = SystemFonts.MessageFontSize;\n\n        public FontBorderTextBlock()\n        {\n            InitializeComponent();\n\n            this.DataContext = this;\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">MainWindow.xaml<\/h2>\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-csharp\"><code class=\"language-csharp\">&lt;Window x:Class=\"WpfApp16.MainWindow\"\n        xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"\n        xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"\n        xmlns:d=\"http:\/\/schemas.microsoft.com\/expression\/blend\/2008\"\n        xmlns:mc=\"http:\/\/schemas.openxmlformats.org\/markup-compatibility\/2006\"\n        xmlns:local=\"clr-namespace:WpfApp16\"\n        xmlns:fontborder=\"clr-namespace:FontBorder;assembly=FontBorder\"\n        mc:Ignorable=\"d\"\n        Title=\"MainWindow\" Height=\"100\" Width=\"300\">\n    &lt;Grid>\n        &lt;fontborder:FontBorderTextBlock Text=\"\u672c\u65e5\u306f\u6674\u5929\u306a\u308a\" Foreground=\"White\" BorderColor=\"Black\" FontSize=\"30\"\/>\n    &lt;\/Grid>\n&lt;\/Window><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"286\" height=\"93\" src=\"http:\/\/marius.main.jp\/software\/blog\/wp-content\/uploads\/2019\/12\/WpfApp16.png\" alt=\"\" class=\"wp-image-547\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u53c2\u7167WPF \u2013 \u6587\u5b57\u306e\u7e01\u53d6\u308a\u65b9\u6cd5 \u2013 astel-labs.net WPF \u2013 \u6587\u5b57\u306e\u7e01\u53d6\u308a\u3092\u3059\u308b \u2013 astel-labs.net<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,20,15],"tags":[51,50],"class_list":["post-546","post","type-post","status-publish","format-standard","hentry","category-c","category-wpf","category-15","tag-textblock","tag-50"],"_links":{"self":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=546"}],"version-history":[{"count":3,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/546\/revisions"}],"predecessor-version":[{"id":704,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/546\/revisions\/704"}],"wp:attachment":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}