{"id":87448,"date":"2026-07-30T10:56:21","date_gmt":"2026-07-30T02:56:21","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/87448.html"},"modified":"2026-07-30T10:56:21","modified_gmt":"2026-07-30T02:56:21","slug":"002004001_uielement%e7%b1%bb","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/87448.html","title":{"rendered":"002004001_UIElement\u7c7b"},"content":{"rendered":"<h2>002004001_UIElement\u7c7b<\/h2>\n<p>\u6458\u8981&#xff1a;UIElement \u662f WPF \u53ef\u89c6\u5316\u4f53\u7cfb\u4e2d\u8854\u63a5\u5e95\u5c42 Visual&#xff08;\u6e32\u67d3&#xff09;\u4e0e\u9ad8\u5c42 FrameworkElement&#xff08;\u6837\u5f0f\u3001\u6570\u636e\u7ed1\u5b9a&#xff09;\u7684\u6838\u5fc3\u62bd\u8c61\u57fa\u7c7b\u3002\u5b83\u5728 Visual \u7684\u57fa\u7840\u4e0a\u65b0\u589e\u4e86\u5e03\u5c40\u7cfb\u7edf&#xff08;Measure-Arrange \u6a21\u578b&#xff09;\u3001\u8def\u7531\u4e8b\u4ef6&#xff08;\u5192\u6ce1\/\u96a7\u9053\/\u76f4\u63a5&#xff09;\u3001\u8f93\u5165\u4ea4\u4e92&#xff08;\u9f20\u6807\/\u952e\u76d8\/\u89e6\u6478&#xff09;\u3001\u7126\u70b9\u7ba1\u7406\u3001\u52a8\u753b\u652f\u6301\u7b49\u6838\u5fc3\u80fd\u529b&#xff0c;\u662f\u6240\u6709\u5177\u5907\u201c\u4ea4\u4e92 &#043; \u5e03\u5c40\u201d\u80fd\u529b\u7684 WPF \u5143\u7d20\u7684\u57fa\u7840\u3002\u672c\u6587\u4ece\u5b98\u65b9\u5b9a\u4e49\u3001\u7ee7\u627f\u5173\u7cfb\u3001\u6838\u5fc3\u529f\u80fd\u8be6\u89e3\u3001\u5173\u952e\u7279\u6027\u3001\u5e38\u89c1\u6d3e\u751f\u7c7b\u3001\u4e0e Visual \u7684\u5bf9\u6bd4\u4ee5\u53ca\u5b8c\u6574\u5b9e\u6218\u793a\u4f8b\u7b49\u65b9\u9762&#xff0c;\u7cfb\u7edf\u68b3\u7406 UIElement \u7c7b\u7684\u8bbe\u8ba1\u7406\u5ff5\u4e0e\u4f7f\u7528\u65b9\u6cd5\u3002<\/p>\n<p>\u200bUIElement \u662f WPF \u53ef\u89c6\u5316\u5143\u7d20\u4f53\u7cfb\u4e2d\u8854\u63a5\u5e95\u5c42\u4e0e\u9ad8\u5c42\u7684\u6838\u5fc3\u62bd\u8c61\u57fa\u7c7b\u2014\u2014 \u5b83\u5728Visual&#xff08;\u5e95\u5c42\u89c6\u89c9\u753b\u5e08&#xff09;\u7684\u57fa\u7840\u4e0a&#xff0c;\u65b0\u589e\u4e86 \u201c\u5e03\u5c40\u3001\u8f93\u5165\u4ea4\u4e92\u3001\u52a8\u753b\u3001\u7126\u70b9\u7ba1\u7406\u3001\u8def\u7531\u4e8b\u4ef6\u201d \u7b49\u6838\u5fc3\u80fd\u529b&#xff0c;\u662f\u6240\u6709\u5177\u5907 \u201c\u4ea4\u4e92 &#043; \u5e03\u5c40\u201d \u80fd\u529b\u7684 WPF \u5143\u7d20\u7684\u57fa\u7840\u3002\u7b80\u800c\u8a00\u4e4b&#xff1a;Visual\u53ea\u8d1f\u8d23 \u201c\u753b\u51fa\u6765\u201d&#xff0c;\u800cUIElement\u8d1f\u8d23 \u201c\u600e\u4e48\u6446\u3001\u600e\u4e48\u4ea4\u4e92\u3001\u600e\u4e48\u52a8\u201d&#xff0c;\u662f WPF \u4ece \u201c\u7eaf\u89c6\u89c9\u6e32\u67d3\u201d \u5230 \u201c\u53ef\u4ea4\u4e92 UI\u201d \u7684\u5173\u952e\u6865\u6881\u3002<\/p>\n<h3>\u4e00\u3001UIElement \u7c7b\u7684\u5b98\u65b9\u5b9a\u4e49&#xff08;\u7cbe\u51c6\u7248&#xff09;<\/h3>\n<p>UIElement is an abstract base class that provides core layout, input, focus, animation, and routed event capabilities for WPF elements. It inherits from Visual (the base for rendering) and extends it with high-level UI behaviors, serving as the foundation for all interactive and layout-aware WPF elements (e.g., panels, shapes, controls).<\/p>\n<p>\u901a\u4fd7\u7ffb\u8bd1 &#043; \u6838\u5fc3\u89e3\u8bfb&#xff1a;<\/p>\n<p>\u200bUIElement \u662f\u62bd\u8c61\u57fa\u7c7b&#xff0c;\u4e3a WPF \u5143\u7d20\u63d0\u4f9b\u6838\u5fc3\u7684\u5e03\u5c40\u3001\u8f93\u5165\u3001\u7126\u70b9\u3001\u52a8\u753b\u548c\u8def\u7531\u4e8b\u4ef6\u80fd\u529b&#xff1b;\u5b83\u7ee7\u627f\u81eaVisual&#xff08;\u6e32\u67d3\u57fa\u7840&#xff09;\u5e76\u6269\u5c55\u4e86\u9ad8\u5c42\u7ea7 UI \u884c\u4e3a&#xff0c;\u662f\u6240\u6709\u5177\u5907\u4ea4\u4e92\u6027\u548c\u5e03\u5c40\u611f\u77e5\u80fd\u529b\u7684 WPF \u5143\u7d20&#xff08;\u5982\u9762\u677f\u3001\u56fe\u5f62\u3001\u63a7\u4ef6&#xff09;\u7684\u57fa\u7840\u3002<\/p>\n<h4>\u5b9a\u4e49\u62c6\u89e3&#xff08;\u5173\u952e\u672f\u8bed&#xff09;<\/h4>\n<li>\u62bd\u8c61\u57fa\u7c7b&#xff1a;\u65e0\u6cd5\u76f4\u63a5\u5b9e\u4f8b\u5316&#xff08;new UIElement()\u62a5\u9519&#xff09;&#xff0c;\u5fc5\u987b\u901a\u8fc7\u7ee7\u627f&#xff08;\u5982Panel\u3001Button\u3001\u81ea\u5b9a\u4e49UIElement&#xff09;\u4f7f\u7528&#xff1b;<\/li>\n<li>\u8854\u63a5\u5e95\u5c42\u4e0e\u9ad8\u5c42&#xff1a;\u5411\u4e0b\u7ee7\u627fVisual\u7684\u6e32\u67d3 \/ \u547d\u4e2d\u6d4b\u8bd5\u80fd\u529b&#xff0c;\u5411\u4e0a\u63d0\u4f9b \u201c\u4ea4\u4e92 &#043; \u5e03\u5c40\u201d \u7684\u9ad8\u5c42\u7ea7\u80fd\u529b&#xff1b;<\/li>\n<li>\u6838\u5fc3\u5b9a\u4f4d&#xff1a;WPF \u201c\u53ef\u4ea4\u4e92\u89c6\u89c9\u5143\u7d20\u201d \u7684\u6700\u5c0f\u5355\u5143 \u2014\u2014 \u53ea\u8981\u5143\u7d20\u9700\u8981 \u201c\u88ab\u5e03\u5c40\u201d \u6216 \u201c\u54cd\u5e94\u7528\u6237\u64cd\u4f5c\u201d&#xff0c;\u5c31\u5fc5\u7136\u7ee7\u627f\u81eaUIElement\u3002<\/li>\n<h3>\u4e8c\u3001UIElement \u7684\u7ee7\u627f\u5173\u7cfb&#xff08;\u7406\u6e05 WPF UI \u4f53\u7cfb&#xff09;<\/h3>\n<p>\u200bUIElement\u7684\u7ee7\u627f\u94fe\u662f\u7406\u89e3 WPF UI \u4f53\u7cfb\u7684\u5173\u952e&#xff0c;\u5b83\u65e2\u8854\u63a5\u5e95\u5c42\u4e0e\u9ad8\u5c42&#xff0c;\u53c8\u4e3a\u4e0a\u5c42\u63a7\u4ef6\u94fa\u8def&#xff1a;<\/p>\n<p>System.Object<br \/>\n\u2514\u2500 System.Windows.Threading.DispatcherObject &#xff08;\u7ebf\u7a0b\u95e8\u7981&#xff1a;UI\u7ebf\u7a0b\u89c4\u5219&#xff09;<br \/>\n   \u2514\u2500 System.Windows.DependencyObject &#xff08;\u5c5e\u6027\u7ba1\u5bb6&#xff1a;\u4f9d\u8d56\u5c5e\u6027\u7ba1\u7406&#xff09;<br \/>\n      \u2514\u2500 System.Windows.Media.Visual &#xff08;\u89c6\u89c9\u753b\u5e08&#xff1a;\u6e32\u67d3&#043;\u547d\u4e2d\u6d4b\u8bd5&#xff09;<br \/>\n         \u2514\u2500 System.Windows.UIElement &#xff08;\u4ea4\u4e92\u8bbe\u8ba1\u5e08&#xff1a;\u5e03\u5c40&#043;\u8f93\u5165&#043;\u52a8\u753b&#043;\u8def\u7531\u4e8b\u4ef6&#xff09;<br \/>\n            \u2514\u2500 System.Windows.FrameworkElement &#xff08;UI\u9879\u76ee\u7ecf\u7406&#xff1a;\u6837\u5f0f&#043;\u6570\u636e\u7ed1\u5b9a&#043;\u5c5e\u6027\u7ee7\u627f&#xff09;<br \/>\n               \u2514\u2500 \u5177\u4f53\u63a7\u4ef6&#xff08;Button\u3001Grid\u3001TextBlock\u3001Rectangle\u7b49&#xff09;<\/p>\n<h4>\u7ee7\u627f\u7684\u6838\u5fc3\u610f\u4e49<\/h4>\n<table>\n<tr>\u7ee7\u627f\u81ea\u83b7\u5f97\u7684\u6838\u5fc3\u80fd\u529b\u653e\u5f03\u7684 \u201c\u5197\u4f59\u201d<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">Visual<\/td>\n<td align=\"left\">\u786c\u4ef6\u52a0\u901f\u6e32\u67d3\u3001\u547d\u4e2d\u6d4b\u8bd5\u3001\u5750\u6807\u53d8\u6362\u3001\u89c6\u89c9\u6811\u7ba1\u7406<\/td>\n<td align=\"left\">\u2014<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u81ea\u8eab\u65b0\u589e<\/td>\n<td align=\"left\">\u5e03\u5c40\u7cfb\u7edf\u3001\u8f93\u5165\u4e8b\u4ef6&#xff08;\u9f20\u6807 \/ \u952e\u76d8&#xff09;\u3001\u8def\u7531\u4e8b\u4ef6\u3001\u7126\u70b9\u7ba1\u7406\u3001\u52a8\u753b\u3001\u5931\u6548\u91cd\u7ed8<\/td>\n<td align=\"left\">\u2014<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u6d3e\u751f\u51faFrameworkElement<\/td>\n<td align=\"left\">\u6837\u5f0f\u3001\u6570\u636e\u7ed1\u5b9a\u3001\u6a21\u677f\u3001\u5c5e\u6027\u7ee7\u627f<\/td>\n<td align=\"left\">\u2014<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u4e09\u3001UIElement \u7c7b\u7684\u6838\u5fc3\u529f\u80fd&#xff08;\u6838\u5fc3\u80fd\u529b\u8be6\u89e3&#xff09;<\/h3>\n<p>\u200bUIElement\u7684\u6240\u6709\u529f\u80fd\u90fd\u56f4\u7ed5 \u201c\u8ba9\u89c6\u89c9\u5143\u7d20\u5177\u5907\u4ea4\u4e92\u6027\u548c\u57fa\u7840\u5e03\u5c40\u80fd\u529b\u201d&#xff0c;\u662f WPF UI \u4ea4\u4e92\u7684\u6838\u5fc3\u8f7d\u4f53&#xff1a;<\/p>\n<h4>1. \u5e03\u5c40\u7cfb\u7edf&#xff08;\u6838\u5fc3\u4e2d\u7684\u6838\u5fc3&#xff09;<\/h4>\n<p>\u200bVisual\u53ea\u8d1f\u8d23 \u201c\u753b\u201d&#xff0c;\u4f46\u4e0d\u7ba1 \u201c\u6446\u5728\u54ea\u201d&#xff1b;UIElement\u65b0\u589e\u4e86\u5b8c\u6574\u7684\u5e03\u5c40\u903b\u8f91&#xff0c;\u8ba9\u5143\u7d20\u80fd \u201c\u81ea\u52a8\u53c2\u4e0e\u5e03\u5c40\u8ba1\u7b97\u201d&#xff08;\u6bd4\u5982 Grid \u91cc\u7684\u6309\u94ae\u81ea\u52a8\u5bf9\u9f50\u3001StackPanel \u91cc\u7684\u5143\u7d20\u5782\u76f4\u6392\u5217&#xff09;\u3002<\/p>\n<h5>\u5e03\u5c40\u7684\u6838\u5fc3\u6d41\u7a0b&#xff08;Measure \u2192 Arrange&#xff09;<\/h5>\n<p>\u200bWPF \u7684\u5e03\u5c40\u662f \u201c\u4e24\u6b65\u8d70\u201d&#xff0c;\u7531UIElement\u5b9a\u4e49\u6807\u51c6&#xff0c;\u6240\u6709\u5e03\u5c40\u5143\u7d20&#xff08;Panel \/ \u63a7\u4ef6&#xff09;\u90fd\u9075\u5faa&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u7b2c\u4e00\u6b65&#xff1a;\u6d4b\u91cf&#xff08;Measure&#xff09;<\/p>\n<p>\u7236\u5143\u7d20\u95ee\u5b50\u5143\u7d20&#xff1a;\u201c\u4f60\u6700\u591a\u9700\u8981\u591a\u5927\u7a7a\u95f4&#xff1f;\u201d&#xff0c;\u5b50\u5143\u7d20\u901a\u8fc7<\/p>\n<p>&#096;Measure(Size availableSize)&#096;<\/p>\n<p>\u65b9\u6cd5\u8fd4\u56de\u81ea\u5df1\u7684 \u201c\u671f\u671b\u5c3a\u5bf8\u201d&#xff1b;<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e8c\u6b65&#xff1a;\u6392\u5217&#xff08;Arrange&#xff09;<\/p>\n<p>\u7236\u5143\u7d20\u6839\u636e\u5b50\u5143\u7d20\u7684\u671f\u671b\u5c3a\u5bf8&#xff0c;\u5206\u914d\u5b9e\u9645\u7a7a\u95f4&#xff1a;\u201c\u7ed9\u4f60\u8fd9\u4e48\u5927\u5730\u65b9&#xff0c;\u6446\u5230\u8fd9\u4e2a\u4f4d\u7f6e\u201d&#xff0c;\u5b50\u5143\u7d20\u901a\u8fc7<\/p>\n<p>&#096;Arrange(Rect finalRect)&#096;<\/p>\n<p>\u65b9\u6cd5\u5b8c\u6210\u4f4d\u7f6e \/ \u5927\u5c0f\u7684\u6700\u7ec8\u786e\u5b9a\u3002<\/p>\n<\/li>\n<\/ul>\n<h5>\u6838\u5fc3\u5e03\u5c40\u65b9\u6cd5 \/ \u5c5e\u6027<\/h5>\n<table>\n<tr>\u65b9\u6cd5 \/ \u5c5e\u6027\u4f5c\u7528\u901a\u4fd7\u793a\u4f8b<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">Measure(Size availableSize)<\/td>\n<td align=\"left\">\u89e6\u53d1\u6d4b\u91cf\u6d41\u7a0b&#xff0c;\u4f20\u5165\u7236\u5143\u7d20\u63d0\u4f9b\u7684\u53ef\u7528\u7a7a\u95f4<\/td>\n<td align=\"left\">button.Measure(new Size(200, 50)) \u2192 \u6309\u94ae\u8ba1\u7b97\u81ea\u5df1\u9700\u8981 100&#215;30 \u7684\u7a7a\u95f4<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">Arrange(Rect finalRect)<\/td>\n<td align=\"left\">\u89e6\u53d1\u6392\u5217\u6d41\u7a0b&#xff0c;\u4f20\u5165\u7236\u5143\u7d20\u5206\u914d\u7684\u6700\u7ec8\u4f4d\u7f6e \/ \u5927\u5c0f<\/td>\n<td align=\"left\">button.Arrange(new Rect(50, 50, 100, 30)) \u2192 \u6309\u94ae\u6446\u5230 (50,50) \u4f4d\u7f6e&#xff0c;\u5927\u5c0f 100&#215;30<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">DesiredSize<\/td>\n<td align=\"left\">\u6d4b\u91cf\u540e\u8fd4\u56de\u7684 \u201c\u671f\u671b\u5c3a\u5bf8\u201d&#xff08;\u5b50\u5143\u7d20\u60f3\u8981\u7684\u7a7a\u95f4&#xff09;<\/td>\n<td align=\"left\">\u6309\u94aeDesiredSize &#061; new Size(100, 30)<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">RenderSize<\/td>\n<td align=\"left\">\u6392\u5217\u540e\u5b9e\u9645\u7684\u6e32\u67d3\u5c3a\u5bf8&#xff08;\u6700\u7ec8\u663e\u793a\u7684\u5927\u5c0f&#xff09;<\/td>\n<td align=\"left\">\u6309\u94aeRenderSize &#061; new Size(100, 30)<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">LayoutTransform<\/td>\n<td align=\"left\">\u5e03\u5c40\u524d\u7684\u53d8\u6362&#xff08;\u4f1a\u5f71\u54cd\u6d4b\u91cf \/ \u6392\u5217&#xff09;<\/td>\n<td align=\"left\">\u6309\u94ae\u65cb\u8f6c 45 \u5ea6\u540e&#xff0c;\u7236\u5143\u7d20\u4f1a\u6309\u65cb\u8f6c\u540e\u7684\u5c3a\u5bf8\u91cd\u65b0\u5e03\u5c40<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h5>\u793a\u4f8b&#xff1a;\u81ea\u5b9a\u4e49 UIElement \u5b9e\u73b0\u7b80\u5355\u5e03\u5c40<\/h5>\n<p>\/\/ \u81ea\u5b9a\u4e49UIElement&#xff1a;\u5b9e\u73b0\u6d4b\u91cf\u548c\u6392\u5217\u903b\u8f91<br \/>\npublic class MyCustomUIElement : UIElement<br \/>\n{<br \/>\n    \/\/ \u91cd\u5199\u6d4b\u91cf\u65b9\u6cd5&#xff1a;\u544a\u8bc9\u7236\u5143\u7d20\u201c\u6211\u9700\u8981100&#215;50\u7684\u7a7a\u95f4\u201d<br \/>\n    protected override Size MeasureCore(Size availableSize)<br \/>\n    {<br \/>\n        \/\/ availableSize&#xff1a;\u7236\u5143\u7d20\u7ed9\u7684\u6700\u5927\u53ef\u7528\u7a7a\u95f4&#xff08;\u6bd4\u5982Grid\u7684\u5bbd\u5ea6&#xff09;<br \/>\n        \/\/ \u8fd4\u56de\u671f\u671b\u5c3a\u5bf8&#xff08;\u4e0d\u8d85\u8fc7\u53ef\u7528\u5c3a\u5bf8&#xff09;<br \/>\n        return new Size(<br \/>\n            Math.Min(100, availableSize.Width),<br \/>\n            Math.Min(50, availableSize.Height)<br \/>\n        );<br \/>\n    }<\/p>\n<p>    \/\/ \u91cd\u5199\u6392\u5217\u65b9\u6cd5&#xff1a;\u786e\u5b9a\u6700\u7ec8\u7684\u4f4d\u7f6e\u548c\u5927\u5c0f<br \/>\n    protected override Size ArrangeCore(Rect finalRect)<br \/>\n    {<br \/>\n        \/\/ finalRect&#xff1a;\u7236\u5143\u7d20\u5206\u914d\u7684\u6700\u7ec8\u4f4d\u7f6e\/\u5927\u5c0f<br \/>\n        \/\/ \u8bb0\u5f55\u6700\u7ec8\u6e32\u67d3\u5c3a\u5bf8&#xff08;\u5fc5\u987b\u8d4b\u503c&#xff0c;\u5426\u5219RenderSize\u4e3a\u7a7a&#xff09;<br \/>\n        RenderSize &#061; finalRect.Size;<br \/>\n        \/\/ \u8fd4\u56de\u5b9e\u9645\u5360\u7528\u7684\u5c3a\u5bf8<br \/>\n        return finalRect.Size;<br \/>\n    }<\/p>\n<p>    \/\/ \u91cd\u5199OnRender&#xff1a;\u5229\u7528Visual\u7684\u6e32\u67d3\u80fd\u529b\u5448\u73b0\u56fe\u50cf<br \/>\n    protected override void OnRender(DrawingContext dc)<br \/>\n    {<br \/>\n        base.OnRender(dc);<br \/>\n        \/\/ \u6309\u6392\u5217\u540e\u7684\u5c3a\u5bf8\u753b\u4e00\u4e2a\u7eff\u8272\u77e9\u5f62<br \/>\n        dc.DrawRectangle(<br \/>\n            Brushes.LightGreen,<br \/>\n            new Pen(Brushes.Green, 2),<br \/>\n            new Rect(0, 0, RenderSize.Width, RenderSize.Height)<br \/>\n        );<br \/>\n    }<br \/>\n}<\/p>\n<h4>2. \u8f93\u5165\u4e8b\u4ef6&#xff08;\u9f20\u6807 \/ \u952e\u76d8 \/ \u89e6\u6478&#xff09;<\/h4>\n<p>\u200bUIElement\u662f WPF \u8f93\u5165\u4e8b\u4ef6\u7684\u6838\u5fc3\u8f7d\u4f53&#xff0c;\u6240\u6709\u9f20\u6807\u3001\u952e\u76d8\u3001\u89e6\u6478\u4ea4\u4e92\u90fd\u901a\u8fc7\u5b83\u7684\u4e8b\u4ef6\u4f53\u7cfb\u5b9e\u73b0&#xff0c;\u4e14\u652f\u6301\u8def\u7531\u4e8b\u4ef6&#xff08;WPF \u7279\u6709\u7684\u4e8b\u4ef6\u4f20\u64ad\u673a\u5236&#xff09;\u3002<\/p>\n<h5>\u6838\u5fc3\u8f93\u5165\u4e8b\u4ef6&#xff08;\u5e38\u7528&#xff09;<\/h5>\n<table>\n<tr>\u4e8b\u4ef6\u7c7b\u578b\u6838\u5fc3\u4e8b\u4ef6\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u9f20\u6807\u4e8b\u4ef6<\/td>\n<td align=\"left\">MouseDown\/MouseUp\/MouseMove\/MouseEnter\/MouseLeave<\/td>\n<td align=\"left\">\u54cd\u5e94\u9f20\u6807\u70b9\u51fb\u3001\u79fb\u52a8\u3001\u60ac\u505c \/ \u79bb\u5f00<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u952e\u76d8\u4e8b\u4ef6<\/td>\n<td align=\"left\">KeyDown\/KeyUp\/GotKeyboardFocus\/LostKeyboardFocus<\/td>\n<td align=\"left\">\u54cd\u5e94\u952e\u76d8\u6309\u952e\u3001\u7126\u70b9\u83b7\u53d6 \/ \u5931\u53bb<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u89e6\u6478\u4e8b\u4ef6<\/td>\n<td align=\"left\">TouchDown\/TouchUp\/TouchMove<\/td>\n<td align=\"left\">\u54cd\u5e94\u89e6\u6478\u5c4f\u5e55\u64cd\u4f5c&#xff08;\u89e6\u5c4f\u8bbe\u5907&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u901a\u7528\u4ea4\u4e92<\/td>\n<td align=\"left\">MouseLeftButtonDown&#xff08;\u5de6\u952e\u70b9\u51fb&#xff09;\u3001PreviewMouseDown&#xff08;\u9884\u89c8\u4e8b\u4ef6&#xff09;<\/td>\n<td align=\"left\">\u66f4\u7cbe\u51c6\u7684\u4ea4\u4e92\u89e6\u53d1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h5>\u8def\u7531\u4e8b\u4ef6&#xff08;UIElement \u7684\u6838\u5fc3\u7279\u6027&#xff09;<\/h5>\n<p>\u200b\u5e38\u89c4.NET \u4e8b\u4ef6&#xff08;CLR\u4e8b\u4ef6&#xff09;\u662f \u201c\u76f4\u63a5\u89e6\u53d1\u201d&#xff08;\u53ea\u901a\u77e5\u81ea\u8eab&#xff09;&#xff0c;\u800cUIElement\u7684\u8f93\u5165\u4e8b\u4ef6\u662f\u8def\u7531\u4e8b\u4ef6\u2014\u2014 \u4e8b\u4ef6\u4f1a\u5728\u89c6\u89c9\u6811\u4e2d \u201c\u4f20\u64ad\u201d&#xff0c;\u5206\u4e09\u79cd\u4f20\u64ad\u65b9\u5f0f&#xff1a;<\/p>\n<ul>\n<li>\u5192\u6ce1&#xff08;Bubble&#xff09;&#xff1a;\u4ece\u89e6\u53d1\u5143\u7d20\u5411\u4e0a\u4f20\u64ad\u5230\u7236\u5143\u7d20&#xff08;\u6bd4\u5982\u70b9\u51fb\u6309\u94ae&#xff0c;\u4e8b\u4ef6\u5148\u5230 Button\u2192Grid\u2192Window&#xff09;&#xff1b;<\/li>\n<li>\u96a7\u9053&#xff08;Tunnel&#xff09;&#xff1a;\u4ece\u6839\u5143\u7d20\u5411\u4e0b\u4f20\u64ad\u5230\u89e6\u53d1\u5143\u7d20&#xff08;\u4ee5Preview\u5f00\u5934\u7684\u4e8b\u4ef6&#xff0c;\u6bd4\u5982PreviewMouseDown\u2192Window\u2192Grid\u2192Button&#xff09;&#xff1b;<\/li>\n<li>\u76f4\u63a5&#xff08;Direct&#xff09;&#xff1a;\u53ea\u89e6\u53d1\u81ea\u8eab&#xff0c;\u4e0d\u4f20\u64ad\u3002<\/li>\n<\/ul>\n<h5>\u793a\u4f8b&#xff1a;\u8def\u7531\u4e8b\u4ef6\u7684\u5192\u6ce1\u673a\u5236<\/h5>\n<p>xaml:<\/p>\n<p>&lt;!&#8211; XAML&#xff1a;Window\u5305\u542bGrid&#xff0c;Grid\u5305\u542bButton &#8211;&gt;<br \/>\n&lt;Window x:Class&#061;&#034;UIElementDemo.MainWindow&#034;<br \/>\n        MouseDown&#061;&#034;Window_MouseDown&#034;&gt;<br \/>\n    &lt;Grid MouseDown&#061;&#034;Grid_MouseDown&#034;&gt;<br \/>\n        &lt;Button Content&#061;&#034;\u70b9\u51fb\u6211&#034; MouseDown&#061;&#034;Button_MouseDown&#034; Width&#061;&#034;100&#034; Height&#061;&#034;30&#034;\/&gt;<br \/>\n    &lt;\/Grid&gt;<br \/>\n&lt;\/Window&gt;<\/p>\n<p>csharp:<\/p>\n<p>\/\/ \u4e8b\u4ef6\u5904\u7406&#xff1a;\u70b9\u51fb\u6309\u94ae\u540e&#xff0c;\u4e8b\u4ef6\u5192\u6ce1\u987a\u5e8f&#xff1a;Button \u2192 Grid \u2192 Window<br \/>\nprivate void Button_MouseDown(object sender, MouseButtonEventArgs e)<br \/>\n{<br \/>\n    Console.WriteLine(&#034;\u6309\u94ae\u88ab\u70b9\u51fb&#xff08;\u5192\u6ce1\u7b2c1\u5c42&#xff1a;Button&#xff09;&#034;);<br \/>\n    \/\/ e.Handled &#061; true; \/\/ \u963b\u6b62\u4e8b\u4ef6\u7ee7\u7eed\u5192\u6ce1&#xff08;Grid\u548cWindow\u4e0d\u4f1a\u6536\u5230&#xff09;<br \/>\n}<\/p>\n<p>private void Grid_MouseDown(object sender, MouseButtonEventArgs e)<br \/>\n{<br \/>\n    Console.WriteLine(&#034;Grid\u6536\u5230\u70b9\u51fb\u4e8b\u4ef6&#xff08;\u5192\u6ce1\u7b2c2\u5c42&#xff1a;Grid&#xff09;&#034;);<br \/>\n}<\/p>\n<p>private void Window_MouseDown(object sender, MouseButtonEventArgs e)<br \/>\n{<br \/>\n    Console.WriteLine(&#034;Window\u6536\u5230\u70b9\u51fb\u4e8b\u4ef6&#xff08;\u5192\u6ce1\u7b2c3\u5c42&#xff1a;Window&#xff09;&#034;);<br \/>\n}<\/p>\n<h4>3. \u7126\u70b9\u7ba1\u7406<\/h4>\n<p>\u200bUIElement\u63d0\u4f9b\u4e86\u5b8c\u6574\u7684\u7126\u70b9\u7ba1\u7406\u80fd\u529b&#xff0c;\u8ba9\u5143\u7d20\u80fd \u201c\u83b7\u53d6 \/ \u5931\u53bb\u7126\u70b9\u201d&#xff08;\u6bd4\u5982\u6587\u672c\u6846\u83b7\u53d6\u7126\u70b9\u540e\u8f93\u5165\u6587\u5b57&#xff0c;\u6309\u94ae\u83b7\u53d6\u7126\u70b9\u540e\u6309\u56de\u8f66\u89e6\u53d1&#xff09;\u3002<\/p>\n<h5>\u6838\u5fc3\u7126\u70b9\u5c5e\u6027 \/ \u65b9\u6cd5<\/h5>\n<table>\n<tr>\u6210\u5458\u4f5c\u7528\u793a\u4f8b<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">Focusable<\/td>\n<td align=\"left\">\u662f\u5426\u53ef\u83b7\u53d6\u7126\u70b9&#xff08;\u9ed8\u8ba4&#xff1a;Button&#061;true&#xff0c;Grid&#061;false&#xff0c;TextBlock&#061;false&#xff09;<\/td>\n<td align=\"left\">button.Focusable &#061; true;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">IsFocused<\/td>\n<td align=\"left\">\u662f\u5426\u6b63\u5904\u4e8e\u7126\u70b9\u72b6\u6001<\/td>\n<td align=\"left\">if (textBox.IsFocused) { &#8230; }<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">Focus()<\/td>\n<td align=\"left\">\u7f16\u7a0b\u5f0f\u83b7\u53d6\u7126\u70b9<\/td>\n<td align=\"left\">textBox.Focus();&#xff08;\u6587\u672c\u6846\u6fc0\u6d3b&#xff0c;\u5149\u6807\u95ea\u70c1&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">GotFocus\/LostFocus<\/td>\n<td align=\"left\">\u83b7\u53d6 \/ \u5931\u53bb\u7126\u70b9\u65f6\u89e6\u53d1\u7684\u4e8b\u4ef6<\/td>\n<td align=\"left\">\u6587\u672c\u6846\u83b7\u53d6\u7126\u70b9\u65f6\u9009\u4e2d\u6240\u6709\u6587\u5b57<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>4. \u52a8\u753b\u652f\u6301<\/h4>\n<p>\u200bUIElement\u5185\u7f6e\u4e86\u5bf9 WPF \u52a8\u753b\u7684\u539f\u751f\u652f\u6301&#xff0c;\u65e0\u9700\u989d\u5916\u4ee3\u7801\u5373\u53ef\u4e3a\u5143\u7d20\u6dfb\u52a0\u5e73\u79fb\u3001\u65cb\u8f6c\u3001\u900f\u660e\u5ea6\u7b49\u52a8\u753b&#xff0c;\u5e95\u5c42\u590d\u7528Visual\u7684\u6e32\u67d3\u80fd\u529b\u3002<\/p>\n<h5>\u6838\u5fc3\u52a8\u753b\u76f8\u5173\u5c5e\u6027 \/ \u65b9\u6cd5<\/h5>\n<table>\n<tr>\u6210\u5458\u4f5c\u7528\u793a\u4f8b<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">BeginAnimation(DependencyProperty, AnimationTimeline)<\/td>\n<td align=\"left\">\u542f\u52a8\u52a8\u753b<\/td>\n<td align=\"left\">\u7ed9\u6309\u94ae\u7684Width\u5c5e\u6027\u52a0\u4ece 100 \u5230 200 \u7684\u52a8\u753b<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">RenderTransform<\/td>\n<td align=\"left\">\u6e32\u67d3\u53d8\u6362&#xff08;\u52a8\u753b\u5e38\u7528&#xff0c;\u4e0d\u5f71\u54cd\u5e03\u5c40&#xff09;<\/td>\n<td align=\"left\">\u6309\u94ae\u5e73\u79fb\u52a8\u753b&#xff1a;TranslateTransform<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">Opacity<\/td>\n<td align=\"left\">\u900f\u660e\u5ea6&#xff08;\u52a8\u753b\u5e38\u7528&#xff09;<\/td>\n<td align=\"left\">\u6309\u94ae\u6de1\u5165\u6de1\u51fa\u52a8\u753b&#xff1a;Opacity \u4ece 0 \u5230 1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h5>\u793a\u4f8b&#xff1a;\u7ed9 UIElement \u52a0\u5e73\u79fb\u52a8\u753b<\/h5>\n<p>csharp:<\/p>\n<p>\/\/ \u7ed9\u81ea\u5b9a\u4e49UIElement\u6dfb\u52a0\u4ece\u5de6\u5230\u53f3\u7684\u5e73\u79fb\u52a8\u753b<br \/>\nvar translateAnim &#061; new DoubleAnimation<br \/>\n{<br \/>\n    From &#061; 0,<br \/>\n    To &#061; 200,<br \/>\n    Duration &#061; TimeSpan.FromSeconds(2),<br \/>\n    RepeatBehavior &#061; RepeatBehavior.Forever, \/\/ \u5faa\u73af\u64ad\u653e<br \/>\n    AutoReverse &#061; true \/\/ \u53cd\u5411\u64ad\u653e<br \/>\n};<br \/>\n\/\/ \u7ed1\u5b9a\u5230RenderTransform\u7684X\u5c5e\u6027<br \/>\nmyUIElement.RenderTransform &#061; new TranslateTransform();<br \/>\nmyUIElement.RenderTransform.BeginAnimation(TranslateTransform.XProperty, translateAnim);<\/p>\n<h4>5. \u5931\u6548\u4e0e\u91cd\u7ed8&#xff08;\u6027\u80fd\u4f18\u5316&#xff09;<\/h4>\n<p>\u200bUIElement\u63d0\u4f9b\u4e86 \u201c\u5931\u6548 &#8211; \u91cd\u7ed8\u201d \u673a\u5236&#xff0c;\u786e\u4fdd\u53ea\u6709\u5143\u7d20\u53d8\u5316\u65f6\u624d\u89e6\u53d1\u5e03\u5c40 \/ \u6e32\u67d3&#xff0c;\u907f\u514d\u65e0\u6548\u8ba1\u7b97&#xff1a;<\/p>\n<ul>\n<li>\u5e03\u5c40\u5931\u6548&#xff1a;InvalidateMeasure()\/InvalidateArrange() \u2192 \u6807\u8bb0\u5143\u7d20\u9700\u8981\u91cd\u65b0\u6d4b\u91cf \/ \u6392\u5217&#xff0c;WPF \u4f1a\u5728\u5408\u9002\u65f6\u673a\u81ea\u52a8\u6267\u884c\u5e03\u5c40&#xff1b;<\/li>\n<li>\u6e32\u67d3\u5931\u6548&#xff1a;InvalidateVisual() \u2192 \u6807\u8bb0\u5143\u7d20\u9700\u8981\u91cd\u65b0\u6e32\u67d3&#xff0c;WPF \u4f1a\u8c03\u7528OnRender()\u91cd\u7ed8&#xff1b;<\/li>\n<li>\u81ea\u52a8\u4f18\u5316&#xff1a;WPF \u4e0d\u4f1a\u7acb\u5373\u6267\u884c\u5931\u6548\u540e\u7684\u64cd\u4f5c&#xff0c;\u800c\u662f\u5c06\u5931\u6548\u64cd\u4f5c\u6392\u961f&#xff0c;\u5728\u4e0b\u4e00\u4e2a\u5e03\u5c40\/\u6e32\u67d3\u5468\u671f\u4e2d\u7edf\u4e00\u6279\u91cf\u5904\u7406&#xff0c;\u63d0\u5347\u6027\u80fd\u3002<\/li>\n<\/ul>\n<h4>6. \u5176\u4ed6\u6838\u5fc3\u80fd\u529b<\/h4>\n<table>\n<tr>\u80fd\u529b\u6838\u5fc3\u6210\u5458\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u62d6\u62fd\u652f\u6301<\/td>\n<td align=\"left\">AllowDrop\/Drop\/DragEnter<\/td>\n<td align=\"left\">\u5b9e\u73b0\u5143\u7d20\u7684\u62d6\u653e\u4ea4\u4e92&#xff08;\u6bd4\u5982\u6587\u4ef6\u62d6\u5165\u3001\u63a7\u4ef6\u95f4\u62d6\u653e&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u547d\u4e2d\u6d4b\u8bd5\u589e\u5f3a<\/td>\n<td align=\"left\">IsHitTestVisible<\/td>\n<td align=\"left\">\u63a7\u5236\u5143\u7d20\u662f\u5426\u54cd\u5e94\u547d\u4e2d\u6d4b\u8bd5&#xff08;\u8bbe\u4e3a false \u5219\u9f20\u6807\u7a7f\u900f&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u6355\u83b7\u9f20\u6807 \/ \u89e6\u6478<\/td>\n<td align=\"left\">CaptureMouse()\/ReleaseMouseCapture()<\/td>\n<td align=\"left\">\u6355\u83b7\u9f20\u6807&#xff08;\u6bd4\u5982\u62d6\u62fd\u65f6\u9f20\u6807\u79bb\u5f00\u5143\u7d20\u4ecd\u54cd\u5e94&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u56db\u3001UIElement \u7c7b\u7684\u5173\u952e\u7279\u6027<\/h3>\n<li>\u62bd\u8c61\u6027&#xff1a;\u65e0\u6cd5\u76f4\u63a5\u5b9e\u4f8b\u5316&#xff0c;\u5fc5\u987b\u7ee7\u627f\u5b9e\u73b0&#xff08;\u81ea\u5b9a\u4e49UIElement\u6216\u4f7f\u7528\u6d3e\u751f\u7c7b&#xff09;&#xff1b;<\/li>\n<li>\u8f7b\u91cf\u7ea7\u4ea4\u4e92&#xff1a;\u6bd4FrameworkElement\u66f4\u8f7b&#xff08;\u65e0\u6837\u5f0f\u3001\u6570\u636e\u7ed1\u5b9a&#xff09;&#xff0c;\u9002\u5408\u4ec5\u9700 \u201c\u57fa\u7840\u5e03\u5c40 &#043; \u8f7b\u4ea4\u4e92\u201d \u7684\u573a\u666f&#xff1b;<\/li>\n<li>\u8def\u7531\u4e8b\u4ef6\u6838\u5fc3&#xff1a;\u6240\u6709 WPF \u8def\u7531\u4e8b\u4ef6\u90fd\u57fa\u4e8eUIElement\u7684\u4e8b\u4ef6\u4f53\u7cfb&#xff1b;<\/li>\n<li>\u5e03\u5c40\u6807\u51c6\u5236\u5b9a\u8005&#xff1a;Measure-Arrange\u5e03\u5c40\u6a21\u578b\u7531UIElement\u5b9a\u4e49&#xff0c;\u6240\u6709\u5e03\u5c40\u5143\u7d20\u90fd\u9075\u5faa&#xff1b;<\/li>\n<li>\u517c\u5bb9\u6027&#xff1a;\u5b8c\u5168\u517c\u5bb9Visual\u7684\u6240\u6709\u80fd\u529b&#xff08;\u6e32\u67d3\u3001\u547d\u4e2d\u6d4b\u8bd5\u7b49&#xff09;&#xff0c;\u662f \u201c\u89c6\u89c9 &#043; \u4ea4\u4e92\u201d \u7684\u7edf\u4e00\u8f7d\u4f53\u3002<\/li>\n<h3>\u4e94\u3001UIElement \u7c7b\u7684\u5e38\u89c1\u6d3e\u751f\u7c7b&#xff08;\u5b9e\u9645\u5f00\u53d1\u5e38\u7528&#xff09;<\/h3>\n<p>\u200b\u5e38\u89c4\u5f00\u53d1\u4e0d\u4f1a\u76f4\u63a5\u5199UIElement&#xff0c;\u800c\u662f\u4f7f\u7528\u5b83\u7684\u6d3e\u751f\u7c7b&#xff0c;\u6838\u5fc3\u6d3e\u751f\u7c7b\u5982\u4e0b&#xff1a;<\/p>\n<table>\n<tr>\u6d3e\u751f\u7c7b\u6838\u5fc3\u7279\u70b9\u5178\u578b\u793a\u4f8b<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">FrameworkElement<\/td>\n<td align=\"left\">\u65b0\u589e\u6837\u5f0f\u3001\u6570\u636e\u7ed1\u5b9a\u3001\u6a21\u677f\u3001\u5c5e\u6027\u7ee7\u627f<\/td>\n<td align=\"left\">Button\u3001Grid\u3001TextBlock\u3001Window<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">Shape<\/td>\n<td align=\"left\">2D \u56fe\u5f62\u5143\u7d20&#xff08;\u57fa\u4e8e UIElement&#xff09;<\/td>\n<td align=\"left\">Rectangle\u3001Ellipse\u3001Line\u3001Path<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">Panel<\/td>\n<td align=\"left\">\u5e03\u5c40\u5bb9\u5668&#xff08;\u7ba1\u7406\u5b50\u5143\u7d20\u7684\u5e03\u5c40&#xff09;<\/td>\n<td align=\"left\">Grid\u3001StackPanel\u3001Canvas\u3001WrapPanel<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">MediaElement<\/td>\n<td align=\"left\">\u5a92\u4f53\u64ad\u653e\u5143\u7d20<\/td>\n<td align=\"left\">\u64ad\u653e\u89c6\u9891 \/ \u97f3\u9891<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">TextElement<\/td>\n<td align=\"left\">\u6587\u672c\u5143\u7d20\u7684\u57fa\u7c7b&#xff08;\u975e\u53ef\u89c6\u5316&#xff0c;\u4f46\u7ee7\u627f UIElement&#xff09;<\/td>\n<td align=\"left\">Run\u3001Paragraph&#xff08;FlowDocument \u4e2d&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u516d\u3001UIElement vs Visual&#xff08;\u6838\u5fc3\u5dee\u5f02&#xff09;<\/h3>\n<table>\n<tr>\u7ef4\u5ea6VisualUIElement<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u6838\u5fc3\u5b9a\u4f4d<\/td>\n<td align=\"left\">\u7eaf\u89c6\u89c9\u6e32\u67d3&#xff08;\u5448\u73b0\u56fe\u50cf&#xff09;<\/td>\n<td align=\"left\">\u89c6\u89c9 &#043; \u4ea4\u4e92 &#043; \u5e03\u5c40&#xff08;\u6446\u597d &#043; \u80fd\u70b9&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u4e8b\u4ef6\u4f53\u7cfb<\/td>\n<td align=\"left\">\u65e0&#xff08;\u4ec5\u547d\u4e2d\u6d4b\u8bd5&#xff09;<\/td>\n<td align=\"left\">\u5b8c\u6574\u7684\u8def\u7531\u4e8b\u4ef6&#xff08;\u9f20\u6807 \/ \u952e\u76d8&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u5e03\u5c40\u80fd\u529b<\/td>\n<td align=\"left\">\u65e0&#xff08;\u4e0d\u7ba1\u4f4d\u7f6e&#xff09;<\/td>\n<td align=\"left\">\u5b8c\u6574\u7684 Measure-Arrange \u5e03\u5c40\u6a21\u578b<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u4ea4\u4e92\u80fd\u529b<\/td>\n<td align=\"left\">\u4ec5\u547d\u4e2d\u6d4b\u8bd5<\/td>\n<td align=\"left\">\u7126\u70b9\u3001\u62d6\u62fd\u3001\u52a8\u753b\u3001\u6355\u83b7\u9f20\u6807<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u6027\u80fd<\/td>\n<td align=\"left\">\u6781\u9ad8&#xff08;\u7eaf\u6e32\u67d3&#xff09;<\/td>\n<td align=\"left\">\u9ad8&#xff08;\u65b0\u589e\u4ea4\u4e92\u903b\u8f91&#xff0c;\u7565\u91cd&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u9002\u7528\u573a\u666f<\/td>\n<td align=\"left\">\u5927\u91cf\u7eaf\u89c6\u89c9\u5143\u7d20&#xff08;\u5982 \u4e0a\u5343\u4e2a\u6570\u636e\u70b9&#xff09;<\/td>\n<td align=\"left\">\u9700\u5e03\u5c40 \/ \u4ea4\u4e92\u7684\u89c6\u89c9\u5143\u7d20&#xff08;\u5982\u6309\u94ae\u3001\u9762\u677f&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u4e03\u3001\u5b9e\u6218\u793a\u4f8b&#xff1a;\u5b8c\u6574\u7684\u81ea\u5b9a\u4e49 UIElement<\/h3>\n<p>\u200b\u4ee5\u4e0b\u793a\u4f8b\u5b9e\u73b0\u4e00\u4e2a \u201c\u53ef\u70b9\u51fb\u3001\u53ef\u52a8\u753b\u3001\u53ef\u5e03\u5c40\u201d \u7684\u81ea\u5b9a\u4e49UIElement&#xff08;\u5706\u5f62\u6309\u94ae&#xff09;&#xff1a;<\/p>\n<p>csharp:<\/p>\n<p>using System.Windows;<br \/>\nusing System.Windows.Media;<br \/>\nusing System.Windows.Input;<br \/>\nusing System.Windows.Media.Animation;<\/p>\n<p>namespace UIElementDemo<br \/>\n{<br \/>\n    \/\/ \u81ea\u5b9a\u4e49UIElement&#xff1a;\u5706\u5f62\u6309\u94ae&#xff08;\u652f\u6301\u70b9\u51fb\u3001\u5e03\u5c40\u3001\u52a8\u753b&#xff09;<br \/>\n    public class CircleButton : UIElement<br \/>\n    {<br \/>\n        private double _radius &#061; 30;<br \/>\n        private bool _isHovered; \/\/ \u662f\u5426\u9f20\u6807\u60ac\u505c<\/p>\n<p>        \/\/ \u91cd\u5199\u6d4b\u91cf\u65b9\u6cd5&#xff1a;\u671f\u671b\u5c3a\u5bf8\u4e3a\u76f4\u5f84&#xff08;2*\u534a\u5f84&#xff09;<br \/>\n        protected override Size MeasureCore(Size availableSize)<br \/>\n        {<br \/>\n            var desiredSize &#061; new Size(_radius * 2, _radius * 2);<br \/>\n            \/\/ \u4e0d\u8d85\u8fc7\u7236\u5143\u7d20\u63d0\u4f9b\u7684\u53ef\u7528\u5c3a\u5bf8<br \/>\n            return new Size(<br \/>\n                Math.Min(desiredSize.Width, availableSize.Width),<br \/>\n                Math.Min(desiredSize.Height, availableSize.Height)<br \/>\n            );<br \/>\n        }<\/p>\n<p>        \/\/ \u91cd\u5199\u6392\u5217\u65b9\u6cd5&#xff1a;\u786e\u5b9a\u6700\u7ec8\u5c3a\u5bf8<br \/>\n        protected override Size ArrangeCore(Rect finalRect)<br \/>\n        {<br \/>\n            RenderSize &#061; finalRect.Size;<br \/>\n            _radius &#061; Math.Min(finalRect.Width, finalRect.Height) \/ 2;<br \/>\n            return finalRect.Size;<br \/>\n        }<\/p>\n<p>        \/\/ \u91cd\u5199\u6e32\u67d3\u65b9\u6cd5&#xff1a;\u753b\u5706\u5f62&#xff08;\u60ac\u505c\u65f6\u53d8\u8272&#xff09;<br \/>\n        protected override void OnRender(DrawingContext dc)<br \/>\n        {<br \/>\n            base.OnRender(dc);<br \/>\n            \/\/ \u5706\u5fc3\u5728\u5143\u7d20\u4e2d\u5fc3<br \/>\n            var center &#061; new Point(RenderSize.Width \/ 2, RenderSize.Height \/ 2);<br \/>\n            \/\/ \u989c\u8272&#xff1a;\u60ac\u505c\u65f6\u84dd\u8272&#xff0c;\u9ed8\u8ba4\u7070\u8272<br \/>\n            var fillColor &#061; _isHovered ? Brushes.LightBlue : Brushes.LightGray;<br \/>\n            \/\/ \u753b\u5706\u5f62<br \/>\n            dc.DrawEllipse(<br \/>\n                fillColor,<br \/>\n                new Pen(Brushes.Black, 2),<br \/>\n                center,<br \/>\n                _radius,<br \/>\n                _radius<br \/>\n            );<br \/>\n            \/\/ \u753b\u6587\u5b57<br \/>\n            dc.DrawText(<br \/>\n                new FormattedText(&#034;\u70b9\u6211&#034;, System.Globalization.CultureInfo.CurrentCulture,<br \/>\n                                 FlowDirection.LeftToRight, new Typeface(&#034;\u5fae\u8f6f\u96c5\u9ed1&#034;),<br \/>\n                                 12, Brushes.Black),<br \/>\n                new Point(center.X &#8211; 15, center.Y &#8211; 8)<br \/>\n            );<br \/>\n        }<\/p>\n<p>        \/\/ \u91cd\u5199\u9f20\u6807\u4e8b\u4ef6&#xff1a;\u5904\u7406\u60ac\u505c\u548c\u70b9\u51fb<br \/>\n        protected override void OnMouseEnter(MouseEventArgs e)<br \/>\n        {<br \/>\n            base.OnMouseEnter(e);<br \/>\n            _isHovered &#061; true;<br \/>\n            InvalidateVisual(); \/\/ \u6807\u8bb0\u9700\u8981\u91cd\u7ed8&#xff08;\u53d8\u8272&#xff09;<br \/>\n        }<\/p>\n<p>        protected override void OnMouseLeave(MouseEventArgs e)<br \/>\n        {<br \/>\n            base.OnMouseLeave(e);<br \/>\n            _isHovered &#061; false;<br \/>\n            InvalidateVisual(); \/\/ \u91cd\u7ed8\u56de\u9ed8\u8ba4\u8272<br \/>\n        }<\/p>\n<p>        protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)<br \/>\n        {<br \/>\n            base.OnMouseLeftButtonDown(e);<br \/>\n            \/\/ \u70b9\u51fb\u65f6\u64ad\u653e\u7f29\u653e\u52a8\u753b<br \/>\n            var scaleAnim &#061; new DoubleAnimation<br \/>\n            {<br \/>\n                From &#061; 1,<br \/>\n                To &#061; 1.2,<br \/>\n                Duration &#061; TimeSpan.FromSeconds(0.2),<br \/>\n                AutoReverse &#061; true<br \/>\n            };<br \/>\n            RenderTransform &#061; new ScaleTransform();<br \/>\n            RenderTransform.BeginAnimation(ScaleTransform.ScaleXProperty, scaleAnim);<br \/>\n            RenderTransform.BeginAnimation(ScaleTransform.ScaleYProperty, scaleAnim);<\/p>\n<p>            MessageBox.Show(&#034;\u81ea\u5b9a\u4e49UIElement\u88ab\u70b9\u51fb\u4e86&#xff01;&#034;);<br \/>\n        }<br \/>\n    }<\/p>\n<p>    \/\/ \u5728Window\u4e2d\u4f7f\u7528<br \/>\n    public partial class MainWindow : Window<br \/>\n    {<br \/>\n        public MainWindow()<br \/>\n        {<br \/>\n            InitializeComponent();<br \/>\n            \/\/ \u6dfb\u52a0\u81ea\u5b9a\u4e49CircleButton\u5230\u7a97\u53e3<br \/>\n            var circleBtn &#061; new CircleButton();<br \/>\n            this.Content &#061; circleBtn;<br \/>\n            \/\/ \u8bbe\u7f6e\u7a97\u53e3\u5927\u5c0f<br \/>\n            this.Width &#061; 300;<br \/>\n            this.Height &#061; 300;<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p>\u200b&#x1f449; \u8fd0\u884c\u6548\u679c&#xff1a;\u7a97\u53e3\u4e2d\u663e\u793a\u4e00\u4e2a\u5706\u5f62\u6309\u94ae&#xff0c;\u9f20\u6807\u60ac\u505c\u65f6\u53d8\u84dd\u8272&#xff0c;\u70b9\u51fb\u65f6\u7f29\u653e\u52a8\u753b &#043; \u5f39\u7a97&#xff0c;\u4e14\u6309\u94ae\u4f1a\u6839\u636e\u7a97\u53e3\u5927\u5c0f\u81ea\u52a8\u8c03\u6574&#xff08;\u5e03\u5c40\u80fd\u529b&#xff09;\u3002<\/p>\n<h3>\u516b\u3001\u603b\u7ed3&#xff08;\u6838\u5fc3\u8bb0\u5fc6\u70b9&#xff09;<\/h3>\n<li>UIElement\u662f WPF \u201c\u53ef\u4ea4\u4e92\u89c6\u89c9\u5143\u7d20\u201d \u7684\u6838\u5fc3\u57fa\u7c7b&#xff0c;\u5728Visual&#xff08;\u6e32\u67d3&#xff09;\u57fa\u7840\u4e0a\u65b0\u589e\u5e03\u5c40\u3001\u8def\u7531\u4e8b\u4ef6\u3001\u8f93\u5165\u4ea4\u4e92\u3001\u7126\u70b9\u3001\u52a8\u753b \u80fd\u529b&#xff1b;<\/li>\n<li>\u6838\u5fc3\u5e03\u5c40\u6a21\u578b\u662fMeasure-Arrange&#xff08;\u6d4b\u91cf &#8211; \u6392\u5217&#xff09;&#xff0c;\u6240\u6709 WPF \u5e03\u5c40\u5143\u7d20\u90fd\u9075\u5faa&#xff1b;<\/li>\n<li>\u8def\u7531\u4e8b\u4ef6\u662f\u5176\u6838\u5fc3\u7279\u6027&#xff0c;\u4e8b\u4ef6\u4f1a\u5728\u89c6\u89c9\u6811\u4e2d\u5192\u6ce1 \/ \u96a7\u9053\u4f20\u64ad&#xff1b;<\/li>\n<li>\u6bd4FrameworkElement\u8f7b\u91cf&#xff08;\u65e0\u6837\u5f0f\u3001\u6570\u636e\u7ed1\u5b9a&#xff09;&#xff0c;\u9002\u5408\u57fa\u7840\u4ea4\u4e92\u573a\u666f&#xff1b;<\/li>\n<li>\u662f WPF \u4ece \u201c\u7eaf\u6e32\u67d3\u201d \u5230 \u201c\u53ef\u4ea4\u4e92 UI\u201d \u7684\u5173\u952e\u6865\u6881&#xff0c;\u6240\u6709\u6309\u94ae\u3001\u9762\u677f\u3001\u56fe\u5f62\u90fd\u57fa\u4e8e\u5b83\u3002<\/li>\n<p>\u200b\u7b80\u5355\u6765\u8bf4&#xff1a;Visual\u8ba9\u5143\u7d20 \u201c\u80fd\u88ab\u770b\u89c1\u201d&#xff0c;\u800cUIElement\u8ba9\u5143\u7d20 \u201c\u80fd\u88ab\u6446\u597d\u3001\u80fd\u88ab\u70b9\u51fb\u80fd\u54cd\u5e94\u52a8\u753b\u4e0e\u4ea4\u4e92\u6765\u201d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>002004001_UIElement\u7c7b\u6458\u8981&#xff1a;UIElement \u662f WPF \u53ef\u89c6\u5316\u4f53\u7cfb\u4e2d\u8854\u63a5\u5e95\u5c42 Visual&#xff08;\u6e32\u67d3&#xff09;\u4e0e\u9ad8\u5c42 FrameworkElement&#xff08;\u6837\u5f0f\u3001\u6570\u636e\u7ed1\u5b9a&#xff09;\u7684\u6838\u5fc3\u62bd\u8c61\u57fa\u7c7b\u3002\u5b83\u5728 Visual \u7684\u57fa\u7840\u4e0a\u65b0\u589e\u4e86\u5e03\u5c40\u7cfb\u7edf&#xff08;Measure-Arrange \u6a21\u578b&#xff09;\u3001\u8def\u7531\u4e8b\u4ef6&#xff08;\u5192\u6ce1\/\u96a7\u9053\/\u76f4\u63a5&#xff09;\u3001\u8f93\u5165\u4ea4\u4e92&#xff08;\u9f20\u6807\/\u952e\u76d8\/\u89e6\u6478&amp;#x<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[55,790,149,190,427],"topic":[],"class_list":["post-87448","post","type-post","status-publish","format-standard","hentry","category-server","tag-c","tag-visual-studio","tag-windows","tag-190","tag-427"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>002004001_UIElement\u7c7b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/87448.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"002004001_UIElement\u7c7b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"002004001_UIElement\u7c7b\u6458\u8981&#xff1a;UIElement \u662f WPF \u53ef\u89c6\u5316\u4f53\u7cfb\u4e2d\u8854\u63a5\u5e95\u5c42 Visual&#xff08;\u6e32\u67d3&#xff09;\u4e0e\u9ad8\u5c42 FrameworkElement&#xff08;\u6837\u5f0f\u3001\u6570\u636e\u7ed1\u5b9a&#xff09;\u7684\u6838\u5fc3\u62bd\u8c61\u57fa\u7c7b\u3002\u5b83\u5728 Visual \u7684\u57fa\u7840\u4e0a\u65b0\u589e\u4e86\u5e03\u5c40\u7cfb\u7edf&#xff08;Measure-Arrange \u6a21\u578b&#xff09;\u3001\u8def\u7531\u4e8b\u4ef6&#xff08;\u5192\u6ce1\/\u96a7\u9053\/\u76f4\u63a5&#xff09;\u3001\u8f93\u5165\u4ea4\u4e92&#xff08;\u9f20\u6807\/\u952e\u76d8\/\u89e6\u6478&amp;#x\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/87448.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-30T02:56:21+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/87448.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/87448.html\",\"name\":\"002004001_UIElement\u7c7b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-30T02:56:21+00:00\",\"dateModified\":\"2026-07-30T02:56:21+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/87448.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/87448.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/87448.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"002004001_UIElement\u7c7b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"002004001_UIElement\u7c7b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/87448.html","og_locale":"zh_CN","og_type":"article","og_title":"002004001_UIElement\u7c7b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"002004001_UIElement\u7c7b\u6458\u8981&#xff1a;UIElement \u662f WPF \u53ef\u89c6\u5316\u4f53\u7cfb\u4e2d\u8854\u63a5\u5e95\u5c42 Visual&#xff08;\u6e32\u67d3&#xff09;\u4e0e\u9ad8\u5c42 FrameworkElement&#xff08;\u6837\u5f0f\u3001\u6570\u636e\u7ed1\u5b9a&#xff09;\u7684\u6838\u5fc3\u62bd\u8c61\u57fa\u7c7b\u3002\u5b83\u5728 Visual \u7684\u57fa\u7840\u4e0a\u65b0\u589e\u4e86\u5e03\u5c40\u7cfb\u7edf&#xff08;Measure-Arrange \u6a21\u578b&#xff09;\u3001\u8def\u7531\u4e8b\u4ef6&#xff08;\u5192\u6ce1\/\u96a7\u9053\/\u76f4\u63a5&#xff09;\u3001\u8f93\u5165\u4ea4\u4e92&#xff08;\u9f20\u6807\/\u952e\u76d8\/\u89e6\u6478&amp;#x","og_url":"https:\/\/www.wsisp.com\/helps\/87448.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-30T02:56:21+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/87448.html","url":"https:\/\/www.wsisp.com\/helps\/87448.html","name":"002004001_UIElement\u7c7b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-30T02:56:21+00:00","dateModified":"2026-07-30T02:56:21+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/87448.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/87448.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/87448.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"002004001_UIElement\u7c7b"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/87448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=87448"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/87448\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=87448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=87448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=87448"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=87448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}