diff --git a/README-zh.md b/README-zh.md
index ddcd5d99..df5d2ae3 100644
--- a/README-zh.md
+++ b/README-zh.md
@@ -26,7 +26,7 @@
### [ Wiki→ 正在进行快速更新](https://gitee.com/WPFDevelopersOrg/WPFDevelopers/wikis/pages)
-### 此项目包含了 微信公众号 《 WPF开发者》 日常开发分享,欢迎Star🌟。
+### 此项目包含了 微信公众号 《 WPF开发者》 日常开发分享,欢迎Star。
### 运行环境 Visual Studio 2022
diff --git a/src/WPFDevelopers.Net40/Themes/Theme.xaml b/src/WPFDevelopers.Net40/Themes/Theme.xaml
index 03ddea0a..e69de29b 100644
--- a/src/WPFDevelopers.Net40/Themes/Theme.xaml
+++ b/src/WPFDevelopers.Net40/Themes/Theme.xaml
@@ -1,6703 +0,0 @@
-
-
- #AA000000
- #909399
- #C0C4CC
- #409EFF
- #99FA68
- #EFFCE9
- #67C23A
- #85CE61
- #5DAF34
- #F8DBAF
- #FAF2E5
- #E6A23C
- #EBB563
- #CF9236
- #F88C8C
- #FCE5E5
- #F56C6C
- #F78989
- #DD6161
- #909399
- #A6A9AD
- #82848A
- #F2F6FC
- #000000
- #BAE766
- #B0D440
-
-
-
-
- 13
- 14
- 16
-
- Helvetica Neue For Number,
- -apple-system,
- BlinkMacSystemFont,
- Segoe UI,
- Roboto,
- PingFang SC,
- Hiragino Sans GB,
- Microsoft YaHei,
- Helvetica Neue,
- Helvetica, Arial,
- sans-serif
-
- Normal
- Normal
- Normal
- M384 690l452-452 60 60-512 512-238-238 60-60z
- M998 352c0 -8 -4 -17 -10 -23l-50 -50c-6 -6 -14 -10 -23 -10c-8 0 -17 4 -23 10l-393 393l-393 -393c-6 -6 -15 -10 -23 -10s-17 4 -23 10l-50 50c-6 6 -10 15 -10 23s4 17 10 23l466 466c6 6 15 10 23 10s17 -4 23 -10l466 -466c6 -6 10 -15 10 -23z
-
- M8.1772461,11.029181 L10.433105,
- 11.029181 L11.700684,12.801641 L12.973633,
- 11.029181 L15.191895,11.029181 L12.844727,
- 13.999395 L15.21875,17.060919 L12.962891,
- 17.060919 L11.673828,15.256231 L10.352539,
- 17.060919 L8.1396484,17.060919 L10.519043,
- 14.042364 z
-
- M658 316l-196 196 196 196-60 60-256-256 256-256z
- M426 256l256 256-256 256-60-60 196-196-196-196z
-
- M11.426758,8.4305077 L11.749023,8.4305077
- L11.749023,16.331387 L10.674805,16.331387
- L10.674805,10.299648 L9.0742188,11.298672
- L9.0742188,10.294277 C9.4788408,10.090176
- 9.9094238,9.8090878 10.365967,9.4510155
- C10.82251,9.0929432 11.176106,8.7527733
- 11.426758,8.4305077 z M14.65086,8.4305077
- L18.566387,8.4305077 L18.566387,9.3435936
- L15.671368,9.3435936 L15.671368,11.255703
- C15.936341,11.058764 16.27293,10.960293
- 16.681133,10.960293 C17.411602,10.960293
- 17.969301,11.178717 18.354229,11.615566
- C18.739157,12.052416 18.931622,12.673672
- 18.931622,13.479336 C18.931622,15.452317
- 18.052553,16.438808 16.294415,16.438808
- C15.560365,16.438808 14.951641,16.234707
- 14.468243,15.826504 L14.881817,14.929531
- C15.368796,15.326992 15.837872,15.525723
- 16.289043,15.525723 C17.298809,15.525723
- 17.803692,14.895514 17.803692,13.635098
- C17.803692,12.460618 17.305971,11.873379
- 16.310528,11.873379 C15.83071,11.873379
- 15.399232,12.079271 15.016094,12.491055
- L14.65086,12.238613 z
-
- M678.4 512l-365.619-379.904c-13.722-13.824-13.722-36.198 0-50.125 13.722-13.824 35.891-13.824 49.613 0l400.896 404.89c13.722 13.875 13.722 36.301 0 50.125l-400.896 404.89c-13.722 13.875-35.891 13.824-49.613 0-13.722-13.773-13.722-36.198 0-50.125l365.619-379.75z
- M854 512l-342 342-342-342 62-60 238 238v-520h84v520l240-238z
- M0.99999994,0.99999994 L0.99999994,9 9,9 9,0.99999994 z M0,0 L10,0 10,10 0,10 z
- M1,3 L1,9 7,9 7,3 z M3,0.99999994 L3,2 8,2 8,7 9,7 9,0.99999994 z M2,0 L10,0 10,8 8,8 8,10 0,10 0,2 2,2 z
- M 1301 69.6875 L 1305.3049 74 L 1300.9375 78.5313 L 1301.6324 79.2263 L 1306 74.735 L 1310.4263 79.2613 L 1311.1563 78.5313 L 1306.7 74 L 1310.9375 69.6875 L 1310.2075 68.9575 L 1306 73.265 L 1301.6949 68.9925 L 1301 69.6875 Z
- M426 726l384-384-60-62-324 324-152-152-60 60zM512 86c236 0 426 190 426 426s-190 426-426 426-426-190-426-426 190-426 426-426z
- M512 960c-281.6 0-512-230.4-512-512s230.4-512 512-512 512 230.4 512 512-230.4 512-512 512zM576 128h-128v448h128v-448zM576 640h-128v128h128v-128z
- M10 20a10 10 0 1 1 0-20 10 10 0 0 1 0 20zm2-13c0 .28-.21.8-.42 1L10 9.58c-.57.58-1 1.6-1 2.42v1h2v-1c0-.29.21-.8.42-1L13 9.42c.57-.58 1-1.6 1-2.42a4 4 0 1 0-8 0h2a2 2 0 1 1 4 0zm-3 8v2h2v-2H9z
- M264 456Q210 456 164 429 118 402 91 356 64 310 64 256 64 202 91 156 118 110 164 83 210 56 264 56 318 56 364 83 410 110 437 156 464 202 464 256 464 310 437 356 410 402 364 429 318 456 264 456ZM264 288L328 352 360 320 296 256 360 192 328 160 264 224 200 160 168 192 232 256 168 320 200 352 264 288Z
- M14.36,14.23a3.76,3.76,0,0,1-4.72,0,1,1,0,0,0-1.28,1.54,5.68,5.68,0,0,0,7.28,0,1,1,0,1,0-1.28-1.54ZM9,11a1,1,0,1,0-1-1A1,1,0,0,0,9,11Zm6-2a1,1,0,1,0,1,1A1,1,0,0,0,15,9ZM12,2A10,10,0,1,0,22,12,10,10,0,0,0,12,2Zm0,18a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z
- M18,11H6V6H18M16.5,17A1.5,1.5 0 0,1 15,15.5A1.5,1.5 0 0,1 16.5,14A1.5,1.5 0 0,1 18,15.5A1.5,1.5 0 0,1 16.5,17M7.5,17A1.5,1.5 0 0,1 6,15.5A1.5,1.5 0 0,1 7.5,14A1.5,1.5 0 0,1 9,15.5A1.5,1.5 0 0,1 7.5,17M4,16C4,16.88 4.39,17.67 5,18.22V20A1,1 0 0,0 6,21H7A1,1 0 0,0 8,20V19H16V20A1,1 0 0,0 17,21H18A1,1 0 0,0 19,20V18.22C19.61,17.67 20,16.88 20,16V6C20,2.5 16.42,2 12,2C7.58,2 4,2.5 4,6V16Z
- M12.3,12.22A4.92,4.92,0,0,0,14,8.5a5,5,0,0,0-10,0,4.92,4.92,0,0,0,1.7,3.72A8,8,0,0,0,1,19.5a1,1,0,0,0,2,0,6,6,0,0,1,12,0,1,1,0,0,0,2,0A8,8,0,0,0,12.3,12.22ZM9,11.5a3,3,0,1,1,3-3A3,3,0,0,1,9,11.5Zm9.74.32A5,5,0,0,0,15,3.5a1,1,0,0,0,0,2,3,3,0,0,1,3,3,3,3,0,0,1-1.5,2.59,1,1,0,0,0-.5.84,1,1,0,0,0,.45.86l.39.26.13.07a7,7,0,0,1,4,6.38,1,1,0,0,0,2,0A9,9,0,0,0,18.74,11.82Z
- M128 148v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12zm140 12h40c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12zm-128 96h40c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12zm128 0h40c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12zm-76 84v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm76 12h40c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12zm180 124v36H0v-36c0-6.6 5.4-12 12-12h19.5V24c0-13.3 10.7-24 24-24h337c13.3 0 24 10.7 24 24v440H436c6.6 0 12 5.4 12 12zM79.5 463H192v-67c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v67h112.5V49L80 48l-.5 415z
- M470 124.837l-98.443-81.78-27.814 32.931 98.442 81.769L470 124.837zM167.192 74.919L139.366 42 42 124.837l27.814 32.919 97.378-82.837zm99.509 97.709H234.6v127.446l101.649 60.539L352.3 334.06l-85.6-49.917V172.628zM256 87.665c-107 0-192.601 86.021-192.601 191.166C63.399 383.98 149 470 256 470c105.936 0 192.601-86.02 192.601-191.169 0-105.144-86.665-191.166-192.601-191.166zm0 339.855c-82.393 0-149.8-66.906-149.8-148.688 0-81.777 67.407-148.684 149.8-148.684 82.394 0 149.8 66.906 149.8 148.684 0 82.839-67.406 148.688-149.8 148.688z
- M687.5 125C500 125 375 13.7 187.5 62.5V31.3C187.5 31.3 187.5 0 156.3 0C125 0 125 31.3 125 31.3V1000H187.5V625C375 562.5 500 687.5 687.5 687.5C875 687.5 937.5 625 937.5 625V62.5C937.5 62.5 875 125 687.5 125Z
- M 200,200 0,200 A 200,200 0 0 1 58.6,58.6z
- M810 554h-256v256h-84v-256h-256v-84h256v-256h84v256h256v84z
- M365.714 256v512q0 14.857-10.857 25.714t-25.714 10.857-25.714-10.857l-256-256q-10.857-10.857-10.857-25.714t10.857-25.714l256-256q10.857-10.857 25.714-10.857t25.714 10.857 10.857 25.714z
- M329.143 512q0 14.857-10.857 25.714l-256 256q-10.857 10.857-25.714 10.857t-25.714-10.857-10.857-25.714v-512q0-14.857 10.857-25.714t25.714-10.857 25.714 10.857l256 256q10.857 10.857 10.857 25.714z
- M649.714 573.714l174.857-169.714-241.143-35.429-108-218.286-108 218.286-241.143 35.429 174.857 169.714-41.714 240.571 216-113.714 215.429 113.714zM950.857 369.714q0 12.571-14.857 27.429l-207.429 202.286 49.143 285.714q0.571 4 0.571 11.429 0 28.571-23.429 28.571-10.857 0-22.857-6.857l-256.571-134.857-256.571 134.857q-12.571 6.857-22.857 6.857-12 0-18-8.286t-6-20.286q0-3.429 1.143-11.429l49.143-285.714-208-202.286q-14.286-15.429-14.286-27.429 0-21.143 32-26.286l286.857-41.714 128.571-260q10.857-23.429 28-23.429t28 23.429l128.571 260 286.857 41.714q32 5.143 32 26.286z
- M384 690l452-452 60 60-512 512-238-238 60-60z
- M810.667 170.667q18.333 0 30.5 12.167t12.167 30.5q0 18-12.333 30.333l-268.667 268.333 268.667 268.333q12.333 12.333 12.333 30.333 0 18.333-12.167 30.5t-30.5 12.167q-18 0-30.333-12.333l-268.333-268.667-268.333 268.667q-12.333 12.333-30.333 12.333-18.333 0-30.5-12.167t-12.167-30.5q0-18 12.333-30.333l268.667-268.333-268.667-268.333q-12.333-12.333-12.333-30.333 0-18.333 12.167-30.5t30.5-12.167q18 0 30.333 12.333l268.333 268.667 268.333-268.667q12.333-12.333 30.333-12.333z
- M512 42.667q17.667 0 30.167 12.5t12.5 30.167v494.333l140.333-140.667q12.333-12.333 30.333-12.333 18.333 0 30.5 12.167t12.167 30.5q0 18-12.333 30.333l-213.333 213.333q-12.333 12.333-30.333 12.333t-30.333-12.333l-213.333-213.333q-12.333-13-12.333-30.333 0-17.667 12.5-30.167t30.167-12.5q18 0 30.333 12.333l140.333 140.667v-494.333q0-17.667 12.5-30.167t30.167-12.5zM938.667 640q17.667 0 30.167 12.5t12.5 30.167v170.667q0 53.333-37 90.333-37.667 37.667-90 37.667h-683.667q-52.333 0-90.667-37.333-37.333-38.333-37.333-90.667v-170.667q0-17.667 12.5-30.167t30.167-12.5 30.167 12.5 12.5 30.167v170.667q0 17.667 12.5 30.167t30.167 12.5h683.667q17.333 0 29.5-12.5t12.167-30.167v-170.667q0-17.667 12.5-30.167t30.167-12.5z
- M2,15.5L22,15.5 22,17.5 2,17.5 2,15.5z M2,10.5L22,10.5 22,12.5 2,12.5 2,10.5z M2,5.5L22,5.5 22,7.5 2,7.5 2,5.5z
- M 200,200 0,200 A 200,200 0 0 1 58.6,58.6z
- M282.419 728.269c-115.814-124.518-113.766-319.693 6.554-440.883 49.254-49.613 110.797-79.206 174.797-88.883l-3.533-106.342c-89.856 10.906-176.742 50.995-245.606 120.371-161.229 162.304-163.174 424.397-6.298 590.387l-89.139 89.702 282.112 15.411-0.768-298.701-118.118 118.938zM622.746 115.968l0.768 298.701 118.118-118.886c115.814 124.621 113.766 319.795-6.554 440.883-49.203 49.613-110.797 79.206-174.797 88.883l3.533 106.291c89.856-10.906 176.742-50.995 245.658-120.32 161.178-162.406 163.123-424.499 6.246-590.387l89.139-89.805-282.112-15.36z
- M344.96 362.647l-146.526 150.83L347.89 664.314c79.122-82.808 79.122-218.856-2.93-301.667z
- M494.413 214.765l-73.263 73.941c123.083 124.215 123.083 325.328 0 449.546l73.263 73.938c164.11-165.625 164.11-431.797 0-597.425z
- M640.944 63.934l-73.266 73.941c205.138 207.023 205.138 541.221 0 748.256l73.266 73.935c246.163-245.478 246.163-647.699 0-896.132z
- M640 146.286h-475.429q-37.714 0-64.571 26.857t-26.857 64.571v475.429q0 37.714 26.857 64.571t64.571 26.857h475.429q37.714 0 64.571-26.857t26.857-64.571v-475.429q0-37.714-26.857-64.571t-64.571-26.857zM804.571 237.714v475.429q0 68-48.286 116.286t-116.286 48.286h-475.429q-68 0-116.286-48.286t-48.286-116.286v-475.429q0-68 48.286-116.286t116.286-48.286h475.429q68 0 116.286 48.286t48.286 116.286z
- M438.857 201.143q-84.571 0-156 41.714t-113.143 113.143-41.714 156 41.714 156 113.143 113.143 156 41.714 156-41.714 113.143-113.143 41.714-156-41.714-156-113.143-113.143-156-41.714zM877.714 512q0 119.429-58.857 220.286t-159.714 159.714-220.286 58.857-220.286-58.857-159.714-159.714-58.857-220.286 58.857-220.286 159.714-159.714 220.286-58.857 220.286 58.857 159.714 159.714 58.857 220.286z
- M768 716.8h-512l256-460.8 256 460.8z
- M2.8421711E-14,30 L30,15 2.8421711E-14,3.5527137E-15 5.3751788,15 z
- M384 214h426v426h-84v-282l-496 496-60-60 496-496h-282v-84z
- M458.361,207.01328 L574.12778,224.42874 574,184 458.361,204.52536
- M8.394,7.3850001 L18,7.3850001 18,8.9495381 14.071471,8.9495381 14.071471,21 12.304952,21 12.304952,8.9495381 8.394,8.9495381 z M5.2364039,2.4000326 C4.4364113,2.4000326 3.7515685,2.6937805 3.1818757,3.2812766 2.612183,3.8687721 2.3273365,4.5750159 2.3273365,5.4000081 L2.3273365,20.999992 C2.3273365,21.824983 2.612183,22.531227 3.1818757,23.118723 3.7515685,23.706219 4.4364113,23.999966 5.2364039,23.999966 L20.363661,23.999966 C21.163652,23.999966 21.848495,23.706219 22.418188,23.118723 22.987883,22.531227 23.272728,21.824983 23.272728,20.999992 L23.272728,5.4000081 C23.272728,4.5750159 22.987883,3.8687721 22.418188,3.2812766 21.848495,2.6937805 21.163652,2.4000326 20.363661,2.4000326 z M5.2363719,0 L20.36363,0 C21.806051,0 23.039387,0.52812719 24.063631,1.5843812 25.087877,2.6406356 25.6,3.912511 25.6,5.4000081 L25.6,20.999992 C25.6,22.487488 25.087877,23.759365 24.063631,24.815618 23.039387,25.871874 21.806051,26.399999 20.36363,26.399999 L5.2363719,26.399999 C3.7939503,26.399999 2.5606164,25.871874 1.5363699,24.815618 0.51212323,23.759365 -5.3697355E-08,22.487488 3.5527137E-15,20.999992 L3.5527137E-15,5.4000081 C-5.3697355E-08,3.912511 0.51212323,2.6406356 1.5363699,1.5843812 2.5606164,0.52812719 3.7939503,0 5.2363719,0 z
- M986.466 37.502c-49.982-49.982-131.004-49.982-180.986 0l-483.984 484.144c43.262 11.264 83.262 32.99 115.74 65.502 32.99 32.99 54.014 73.246 65.246 115.484l483.984-484.144c50.014-49.982 50.014-131.002 0-180.986zM346.742 858.63c49.982-49.982 49.982-131.004 0-180.986s-131.004-49.982-180.986 0l-165.756 346.356 346.742-165.37z
- M16.001007,0L20.944,10.533997 32,12.223022 23.998993,20.421997 25.889008,32 16.001007,26.533997 6.1109924,32 8,20.421997 0,12.223022 11.057007,10.533997z
- M356.667 155q17.333 0 30 12.5t12.667 30.167-12.667 30.333l-198.667 198.667h409.333q78 0 149.167 30.333t122.5 81.833 81.833 122.5 30.5 149.333v42.667q0 17.667-12.5 30.167t-30.167 12.5q-17.333 0-30-12.667t-12.667-30v-42.667q0-60.667-23.667-116t-63.667-95.333-95.333-63.667-116-23.667h-409.333l198.667 199q12.667 12.667 12.667 30 0 17.667-12.5 30.333t-30.167 12.667-30.333-12.667l-271.333-271.667q-12.333-12.333-12.333-30.333 0-17.667 12.333-30l271.333-271.667q12.667-12.667 30.333-12.667z
- M804.571 566.857v274.286q0 14.857-10.857 25.714t-25.714 10.857h-219.429v-219.429h-146.286v219.429h-219.429q-14.857 0-25.714-10.857t-10.857-25.714v-274.286q0-0.571 0.286-1.714t0.286-1.714l328.571-270.857 328.571 270.857q0.571 1.143 0.571 3.429zM932 527.429l-35.429 42.286q-4.571 5.143-12 6.286h-1.714q-7.429 0-12-4l-395.429-329.714-395.429 329.714q-6.857 4.571-13.714 4-7.429-1.143-12-6.286l-35.429-42.286q-4.571-5.714-4-13.429t6.286-12.286l410.857-342.286q18.286-14.857 43.429-14.857t43.429 14.857l139.429 116.571v-111.429q0-8 5.143-13.143t13.143-5.143h109.714q8 0 13.143 5.143t5.143 13.143v233.143l125.143 104q5.714 4.571 6.286 12.286t-4 13.429z
- M336.998 621.619c-13.875 13.722-36.301 13.722-50.074 0s-13.926-35.891 0-49.613l200.090-196.096c13.824-13.722 36.198-13.722 50.125 0l200.090 196.096c13.824 13.67 13.824 35.891 0 49.613-13.875 13.722-36.301 13.722-50.125 0l-175.104-160.819-175.002 160.819z
- M512 776l136-136 60 60-196 196-196-196 60-60zM512 248l-136 136-60-60 196-196 196 196-60 60z
- M512 112c-229.792 0-416 186.24-416 416s186.208 416 416 416c229.728 0 416-186.24 416-416s-186.24-416-416-416zM508.64 864.864c-185.568 0-336-150.432-336-336s150.432-336 336-336c185.536 0 336 150.432 336 336 0 185.568-150.464 336-336 336zM605.76 548.192h-95.36v-161.024c0-17.472-14.176-31.68-31.648-31.68-17.504 0-31.68 14.176-31.68 31.68v192.672c0 17.504 14.176 31.648 31.68 31.648h127.008c17.504 0 31.68-14.144 31.68-31.648 0-17.472-14.176-31.648-31.68-31.648z
-
-
-
-
-
-
- 0.7
- 4
- 32
- 16
- 8
- 6
- 6
-
-
-
- 0,0,0,2
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/WPFDevelopers.Net40/WPFDevelopers.Net40.csproj b/src/WPFDevelopers.Net40/WPFDevelopers.Net40.csproj
index 686e2ba2..38427bc8 100644
--- a/src/WPFDevelopers.Net40/WPFDevelopers.Net40.csproj
+++ b/src/WPFDevelopers.Net40/WPFDevelopers.Net40.csproj
@@ -3,7 +3,6 @@
net40
True
- E:\Code\git\WPFDevelopers\WPFDevelopersMultiple\WPFDevelopers.snk
diff --git a/src/WPFDevelopers.Net45x/Themes/Theme.xaml b/src/WPFDevelopers.Net45x/Themes/Theme.xaml
index a09c4935..5f282702 100644
--- a/src/WPFDevelopers.Net45x/Themes/Theme.xaml
+++ b/src/WPFDevelopers.Net45x/Themes/Theme.xaml
@@ -1,6704 +1 @@
-
-
- #AA000000
- #909399
- #C0C4CC
- #409EFF
- #99FA68
- #EFFCE9
- #67C23A
- #85CE61
- #5DAF34
- #F8DBAF
- #FAF2E5
- #E6A23C
- #EBB563
- #CF9236
- #F88C8C
- #FCE5E5
- #F56C6C
- #F78989
- #DD6161
- #909399
- #A6A9AD
- #82848A
- #F2F6FC
- #000000
- #BAE766
- #B0D440
-
-
-
-
- 13
- 14
- 16
-
- Helvetica Neue For Number,
- -apple-system,
- BlinkMacSystemFont,
- Segoe UI,
- Roboto,
- PingFang SC,
- Hiragino Sans GB,
- Microsoft YaHei,
- Helvetica Neue,
- Helvetica, Arial,
- sans-serif
-
- Normal
- Normal
- Normal
- M384 690l452-452 60 60-512 512-238-238 60-60z
- M998 352c0 -8 -4 -17 -10 -23l-50 -50c-6 -6 -14 -10 -23 -10c-8 0 -17 4 -23 10l-393 393l-393 -393c-6 -6 -15 -10 -23 -10s-17 4 -23 10l-50 50c-6 6 -10 15 -10 23s4 17 10 23l466 466c6 6 15 10 23 10s17 -4 23 -10l466 -466c6 -6 10 -15 10 -23z
-
- M8.1772461,11.029181 L10.433105,
- 11.029181 L11.700684,12.801641 L12.973633,
- 11.029181 L15.191895,11.029181 L12.844727,
- 13.999395 L15.21875,17.060919 L12.962891,
- 17.060919 L11.673828,15.256231 L10.352539,
- 17.060919 L8.1396484,17.060919 L10.519043,
- 14.042364 z
-
- M658 316l-196 196 196 196-60 60-256-256 256-256z
- M426 256l256 256-256 256-60-60 196-196-196-196z
-
- M11.426758,8.4305077 L11.749023,8.4305077
- L11.749023,16.331387 L10.674805,16.331387
- L10.674805,10.299648 L9.0742188,11.298672
- L9.0742188,10.294277 C9.4788408,10.090176
- 9.9094238,9.8090878 10.365967,9.4510155
- C10.82251,9.0929432 11.176106,8.7527733
- 11.426758,8.4305077 z M14.65086,8.4305077
- L18.566387,8.4305077 L18.566387,9.3435936
- L15.671368,9.3435936 L15.671368,11.255703
- C15.936341,11.058764 16.27293,10.960293
- 16.681133,10.960293 C17.411602,10.960293
- 17.969301,11.178717 18.354229,11.615566
- C18.739157,12.052416 18.931622,12.673672
- 18.931622,13.479336 C18.931622,15.452317
- 18.052553,16.438808 16.294415,16.438808
- C15.560365,16.438808 14.951641,16.234707
- 14.468243,15.826504 L14.881817,14.929531
- C15.368796,15.326992 15.837872,15.525723
- 16.289043,15.525723 C17.298809,15.525723
- 17.803692,14.895514 17.803692,13.635098
- C17.803692,12.460618 17.305971,11.873379
- 16.310528,11.873379 C15.83071,11.873379
- 15.399232,12.079271 15.016094,12.491055
- L14.65086,12.238613 z
-
- M678.4 512l-365.619-379.904c-13.722-13.824-13.722-36.198 0-50.125 13.722-13.824 35.891-13.824 49.613 0l400.896 404.89c13.722 13.875 13.722 36.301 0 50.125l-400.896 404.89c-13.722 13.875-35.891 13.824-49.613 0-13.722-13.773-13.722-36.198 0-50.125l365.619-379.75z
- M854 512l-342 342-342-342 62-60 238 238v-520h84v520l240-238z
- M0.99999994,0.99999994 L0.99999994,9 9,9 9,0.99999994 z M0,0 L10,0 10,10 0,10 z
- M1,3 L1,9 7,9 7,3 z M3,0.99999994 L3,2 8,2 8,7 9,7 9,0.99999994 z M2,0 L10,0 10,8 8,8 8,10 0,10 0,2 2,2 z
- M 1301 69.6875 L 1305.3049 74 L 1300.9375 78.5313 L 1301.6324 79.2263 L 1306 74.735 L 1310.4263 79.2613 L 1311.1563 78.5313 L 1306.7 74 L 1310.9375 69.6875 L 1310.2075 68.9575 L 1306 73.265 L 1301.6949 68.9925 L 1301 69.6875 Z
- M426 726l384-384-60-62-324 324-152-152-60 60zM512 86c236 0 426 190 426 426s-190 426-426 426-426-190-426-426 190-426 426-426z
- M512 960c-281.6 0-512-230.4-512-512s230.4-512 512-512 512 230.4 512 512-230.4 512-512 512zM576 128h-128v448h128v-448zM576 640h-128v128h128v-128z
- M10 20a10 10 0 1 1 0-20 10 10 0 0 1 0 20zm2-13c0 .28-.21.8-.42 1L10 9.58c-.57.58-1 1.6-1 2.42v1h2v-1c0-.29.21-.8.42-1L13 9.42c.57-.58 1-1.6 1-2.42a4 4 0 1 0-8 0h2a2 2 0 1 1 4 0zm-3 8v2h2v-2H9z
- M264 456Q210 456 164 429 118 402 91 356 64 310 64 256 64 202 91 156 118 110 164 83 210 56 264 56 318 56 364 83 410 110 437 156 464 202 464 256 464 310 437 356 410 402 364 429 318 456 264 456ZM264 288L328 352 360 320 296 256 360 192 328 160 264 224 200 160 168 192 232 256 168 320 200 352 264 288Z
- M14.36,14.23a3.76,3.76,0,0,1-4.72,0,1,1,0,0,0-1.28,1.54,5.68,5.68,0,0,0,7.28,0,1,1,0,1,0-1.28-1.54ZM9,11a1,1,0,1,0-1-1A1,1,0,0,0,9,11Zm6-2a1,1,0,1,0,1,1A1,1,0,0,0,15,9ZM12,2A10,10,0,1,0,22,12,10,10,0,0,0,12,2Zm0,18a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z
- M18,11H6V6H18M16.5,17A1.5,1.5 0 0,1 15,15.5A1.5,1.5 0 0,1 16.5,14A1.5,1.5 0 0,1 18,15.5A1.5,1.5 0 0,1 16.5,17M7.5,17A1.5,1.5 0 0,1 6,15.5A1.5,1.5 0 0,1 7.5,14A1.5,1.5 0 0,1 9,15.5A1.5,1.5 0 0,1 7.5,17M4,16C4,16.88 4.39,17.67 5,18.22V20A1,1 0 0,0 6,21H7A1,1 0 0,0 8,20V19H16V20A1,1 0 0,0 17,21H18A1,1 0 0,0 19,20V18.22C19.61,17.67 20,16.88 20,16V6C20,2.5 16.42,2 12,2C7.58,2 4,2.5 4,6V16Z
- M12.3,12.22A4.92,4.92,0,0,0,14,8.5a5,5,0,0,0-10,0,4.92,4.92,0,0,0,1.7,3.72A8,8,0,0,0,1,19.5a1,1,0,0,0,2,0,6,6,0,0,1,12,0,1,1,0,0,0,2,0A8,8,0,0,0,12.3,12.22ZM9,11.5a3,3,0,1,1,3-3A3,3,0,0,1,9,11.5Zm9.74.32A5,5,0,0,0,15,3.5a1,1,0,0,0,0,2,3,3,0,0,1,3,3,3,3,0,0,1-1.5,2.59,1,1,0,0,0-.5.84,1,1,0,0,0,.45.86l.39.26.13.07a7,7,0,0,1,4,6.38,1,1,0,0,0,2,0A9,9,0,0,0,18.74,11.82Z
- M128 148v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12zm140 12h40c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12zm-128 96h40c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12zm128 0h40c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12zm-76 84v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm76 12h40c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12zm180 124v36H0v-36c0-6.6 5.4-12 12-12h19.5V24c0-13.3 10.7-24 24-24h337c13.3 0 24 10.7 24 24v440H436c6.6 0 12 5.4 12 12zM79.5 463H192v-67c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v67h112.5V49L80 48l-.5 415z
- M470 124.837l-98.443-81.78-27.814 32.931 98.442 81.769L470 124.837zM167.192 74.919L139.366 42 42 124.837l27.814 32.919 97.378-82.837zm99.509 97.709H234.6v127.446l101.649 60.539L352.3 334.06l-85.6-49.917V172.628zM256 87.665c-107 0-192.601 86.021-192.601 191.166C63.399 383.98 149 470 256 470c105.936 0 192.601-86.02 192.601-191.169 0-105.144-86.665-191.166-192.601-191.166zm0 339.855c-82.393 0-149.8-66.906-149.8-148.688 0-81.777 67.407-148.684 149.8-148.684 82.394 0 149.8 66.906 149.8 148.684 0 82.839-67.406 148.688-149.8 148.688z
- M687.5 125C500 125 375 13.7 187.5 62.5V31.3C187.5 31.3 187.5 0 156.3 0C125 0 125 31.3 125 31.3V1000H187.5V625C375 562.5 500 687.5 687.5 687.5C875 687.5 937.5 625 937.5 625V62.5C937.5 62.5 875 125 687.5 125Z
- M 200,200 0,200 A 200,200 0 0 1 58.6,58.6z
- M810 554h-256v256h-84v-256h-256v-84h256v-256h84v256h256v84z
- M365.714 256v512q0 14.857-10.857 25.714t-25.714 10.857-25.714-10.857l-256-256q-10.857-10.857-10.857-25.714t10.857-25.714l256-256q10.857-10.857 25.714-10.857t25.714 10.857 10.857 25.714z
- M329.143 512q0 14.857-10.857 25.714l-256 256q-10.857 10.857-25.714 10.857t-25.714-10.857-10.857-25.714v-512q0-14.857 10.857-25.714t25.714-10.857 25.714 10.857l256 256q10.857 10.857 10.857 25.714z
- M649.714 573.714l174.857-169.714-241.143-35.429-108-218.286-108 218.286-241.143 35.429 174.857 169.714-41.714 240.571 216-113.714 215.429 113.714zM950.857 369.714q0 12.571-14.857 27.429l-207.429 202.286 49.143 285.714q0.571 4 0.571 11.429 0 28.571-23.429 28.571-10.857 0-22.857-6.857l-256.571-134.857-256.571 134.857q-12.571 6.857-22.857 6.857-12 0-18-8.286t-6-20.286q0-3.429 1.143-11.429l49.143-285.714-208-202.286q-14.286-15.429-14.286-27.429 0-21.143 32-26.286l286.857-41.714 128.571-260q10.857-23.429 28-23.429t28 23.429l128.571 260 286.857 41.714q32 5.143 32 26.286z
- M384 690l452-452 60 60-512 512-238-238 60-60z
- M810.667 170.667q18.333 0 30.5 12.167t12.167 30.5q0 18-12.333 30.333l-268.667 268.333 268.667 268.333q12.333 12.333 12.333 30.333 0 18.333-12.167 30.5t-30.5 12.167q-18 0-30.333-12.333l-268.333-268.667-268.333 268.667q-12.333 12.333-30.333 12.333-18.333 0-30.5-12.167t-12.167-30.5q0-18 12.333-30.333l268.667-268.333-268.667-268.333q-12.333-12.333-12.333-30.333 0-18.333 12.167-30.5t30.5-12.167q18 0 30.333 12.333l268.333 268.667 268.333-268.667q12.333-12.333 30.333-12.333z
- M512 42.667q17.667 0 30.167 12.5t12.5 30.167v494.333l140.333-140.667q12.333-12.333 30.333-12.333 18.333 0 30.5 12.167t12.167 30.5q0 18-12.333 30.333l-213.333 213.333q-12.333 12.333-30.333 12.333t-30.333-12.333l-213.333-213.333q-12.333-13-12.333-30.333 0-17.667 12.5-30.167t30.167-12.5q18 0 30.333 12.333l140.333 140.667v-494.333q0-17.667 12.5-30.167t30.167-12.5zM938.667 640q17.667 0 30.167 12.5t12.5 30.167v170.667q0 53.333-37 90.333-37.667 37.667-90 37.667h-683.667q-52.333 0-90.667-37.333-37.333-38.333-37.333-90.667v-170.667q0-17.667 12.5-30.167t30.167-12.5 30.167 12.5 12.5 30.167v170.667q0 17.667 12.5 30.167t30.167 12.5h683.667q17.333 0 29.5-12.5t12.167-30.167v-170.667q0-17.667 12.5-30.167t30.167-12.5z
- M2,15.5L22,15.5 22,17.5 2,17.5 2,15.5z M2,10.5L22,10.5 22,12.5 2,12.5 2,10.5z M2,5.5L22,5.5 22,7.5 2,7.5 2,5.5z
- M 200,200 0,200 A 200,200 0 0 1 58.6,58.6z
- M282.419 728.269c-115.814-124.518-113.766-319.693 6.554-440.883 49.254-49.613 110.797-79.206 174.797-88.883l-3.533-106.342c-89.856 10.906-176.742 50.995-245.606 120.371-161.229 162.304-163.174 424.397-6.298 590.387l-89.139 89.702 282.112 15.411-0.768-298.701-118.118 118.938zM622.746 115.968l0.768 298.701 118.118-118.886c115.814 124.621 113.766 319.795-6.554 440.883-49.203 49.613-110.797 79.206-174.797 88.883l3.533 106.291c89.856-10.906 176.742-50.995 245.658-120.32 161.178-162.406 163.123-424.499 6.246-590.387l89.139-89.805-282.112-15.36z
- M344.96 362.647l-146.526 150.83L347.89 664.314c79.122-82.808 79.122-218.856-2.93-301.667z
- M494.413 214.765l-73.263 73.941c123.083 124.215 123.083 325.328 0 449.546l73.263 73.938c164.11-165.625 164.11-431.797 0-597.425z
- M640.944 63.934l-73.266 73.941c205.138 207.023 205.138 541.221 0 748.256l73.266 73.935c246.163-245.478 246.163-647.699 0-896.132z
- M640 146.286h-475.429q-37.714 0-64.571 26.857t-26.857 64.571v475.429q0 37.714 26.857 64.571t64.571 26.857h475.429q37.714 0 64.571-26.857t26.857-64.571v-475.429q0-37.714-26.857-64.571t-64.571-26.857zM804.571 237.714v475.429q0 68-48.286 116.286t-116.286 48.286h-475.429q-68 0-116.286-48.286t-48.286-116.286v-475.429q0-68 48.286-116.286t116.286-48.286h475.429q68 0 116.286 48.286t48.286 116.286z
- M438.857 201.143q-84.571 0-156 41.714t-113.143 113.143-41.714 156 41.714 156 113.143 113.143 156 41.714 156-41.714 113.143-113.143 41.714-156-41.714-156-113.143-113.143-156-41.714zM877.714 512q0 119.429-58.857 220.286t-159.714 159.714-220.286 58.857-220.286-58.857-159.714-159.714-58.857-220.286 58.857-220.286 159.714-159.714 220.286-58.857 220.286 58.857 159.714 159.714 58.857 220.286z
- M768 716.8h-512l256-460.8 256 460.8z
- M2.8421711E-14,30 L30,15 2.8421711E-14,3.5527137E-15 5.3751788,15 z
- M384 214h426v426h-84v-282l-496 496-60-60 496-496h-282v-84z
- M458.361,207.01328 L574.12778,224.42874 574,184 458.361,204.52536
- M8.394,7.3850001 L18,7.3850001 18,8.9495381 14.071471,8.9495381 14.071471,21 12.304952,21 12.304952,8.9495381 8.394,8.9495381 z M5.2364039,2.4000326 C4.4364113,2.4000326 3.7515685,2.6937805 3.1818757,3.2812766 2.612183,3.8687721 2.3273365,4.5750159 2.3273365,5.4000081 L2.3273365,20.999992 C2.3273365,21.824983 2.612183,22.531227 3.1818757,23.118723 3.7515685,23.706219 4.4364113,23.999966 5.2364039,23.999966 L20.363661,23.999966 C21.163652,23.999966 21.848495,23.706219 22.418188,23.118723 22.987883,22.531227 23.272728,21.824983 23.272728,20.999992 L23.272728,5.4000081 C23.272728,4.5750159 22.987883,3.8687721 22.418188,3.2812766 21.848495,2.6937805 21.163652,2.4000326 20.363661,2.4000326 z M5.2363719,0 L20.36363,0 C21.806051,0 23.039387,0.52812719 24.063631,1.5843812 25.087877,2.6406356 25.6,3.912511 25.6,5.4000081 L25.6,20.999992 C25.6,22.487488 25.087877,23.759365 24.063631,24.815618 23.039387,25.871874 21.806051,26.399999 20.36363,26.399999 L5.2363719,26.399999 C3.7939503,26.399999 2.5606164,25.871874 1.5363699,24.815618 0.51212323,23.759365 -5.3697355E-08,22.487488 3.5527137E-15,20.999992 L3.5527137E-15,5.4000081 C-5.3697355E-08,3.912511 0.51212323,2.6406356 1.5363699,1.5843812 2.5606164,0.52812719 3.7939503,0 5.2363719,0 z
- M986.466 37.502c-49.982-49.982-131.004-49.982-180.986 0l-483.984 484.144c43.262 11.264 83.262 32.99 115.74 65.502 32.99 32.99 54.014 73.246 65.246 115.484l483.984-484.144c50.014-49.982 50.014-131.002 0-180.986zM346.742 858.63c49.982-49.982 49.982-131.004 0-180.986s-131.004-49.982-180.986 0l-165.756 346.356 346.742-165.37z
- M16.001007,0L20.944,10.533997 32,12.223022 23.998993,20.421997 25.889008,32 16.001007,26.533997 6.1109924,32 8,20.421997 0,12.223022 11.057007,10.533997z
- M356.667 155q17.333 0 30 12.5t12.667 30.167-12.667 30.333l-198.667 198.667h409.333q78 0 149.167 30.333t122.5 81.833 81.833 122.5 30.5 149.333v42.667q0 17.667-12.5 30.167t-30.167 12.5q-17.333 0-30-12.667t-12.667-30v-42.667q0-60.667-23.667-116t-63.667-95.333-95.333-63.667-116-23.667h-409.333l198.667 199q12.667 12.667 12.667 30 0 17.667-12.5 30.333t-30.167 12.667-30.333-12.667l-271.333-271.667q-12.333-12.333-12.333-30.333 0-17.667 12.333-30l271.333-271.667q12.667-12.667 30.333-12.667z
- M804.571 566.857v274.286q0 14.857-10.857 25.714t-25.714 10.857h-219.429v-219.429h-146.286v219.429h-219.429q-14.857 0-25.714-10.857t-10.857-25.714v-274.286q0-0.571 0.286-1.714t0.286-1.714l328.571-270.857 328.571 270.857q0.571 1.143 0.571 3.429zM932 527.429l-35.429 42.286q-4.571 5.143-12 6.286h-1.714q-7.429 0-12-4l-395.429-329.714-395.429 329.714q-6.857 4.571-13.714 4-7.429-1.143-12-6.286l-35.429-42.286q-4.571-5.714-4-13.429t6.286-12.286l410.857-342.286q18.286-14.857 43.429-14.857t43.429 14.857l139.429 116.571v-111.429q0-8 5.143-13.143t13.143-5.143h109.714q8 0 13.143 5.143t5.143 13.143v233.143l125.143 104q5.714 4.571 6.286 12.286t-4 13.429z
- M336.998 621.619c-13.875 13.722-36.301 13.722-50.074 0s-13.926-35.891 0-49.613l200.090-196.096c13.824-13.722 36.198-13.722 50.125 0l200.090 196.096c13.824 13.67 13.824 35.891 0 49.613-13.875 13.722-36.301 13.722-50.125 0l-175.104-160.819-175.002 160.819z
- M512 776l136-136 60 60-196 196-196-196 60-60zM512 248l-136 136-60-60 196-196 196 196-60 60z
- M512 112c-229.792 0-416 186.24-416 416s186.208 416 416 416c229.728 0 416-186.24 416-416s-186.24-416-416-416zM508.64 864.864c-185.568 0-336-150.432-336-336s150.432-336 336-336c185.536 0 336 150.432 336 336 0 185.568-150.464 336-336 336zM605.76 548.192h-95.36v-161.024c0-17.472-14.176-31.68-31.648-31.68-17.504 0-31.68 14.176-31.68 31.68v192.672c0 17.504 14.176 31.648 31.68 31.648h127.008c17.504 0 31.68-14.144 31.68-31.648 0-17.472-14.176-31.648-31.68-31.648z
-
-
-
-
-
-
- 0.7
- 4
- 32
- 16
- 8
- 6
- 6
-
-
-
- 0,0,0,2
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/WPFDevelopers.Net45x/WPFDevelopers.Net45x.csproj b/src/WPFDevelopers.Net45x/WPFDevelopers.Net45x.csproj
index a88a6a9b..f62c243d 100644
--- a/src/WPFDevelopers.Net45x/WPFDevelopers.Net45x.csproj
+++ b/src/WPFDevelopers.Net45x/WPFDevelopers.Net45x.csproj
@@ -4,7 +4,6 @@
true
True
- E:\Code\git\WPFDevelopers\WPFDevelopersMultiple\WPFDevelopers.snk
diff --git a/src/WPFDevelopers.Samples.Shared/App.xaml b/src/WPFDevelopers.Samples.Shared/App.xaml
index 39a3bf78..ae72f250 100644
--- a/src/WPFDevelopers.Samples.Shared/App.xaml
+++ b/src/WPFDevelopers.Samples.Shared/App.xaml
@@ -31,6 +31,7 @@
+
+
+
\ No newline at end of file
diff --git a/src/WPFDevelopers.Samples.Shared/ExampleViews/AnimationAudioExample.xaml b/src/WPFDevelopers.Samples.Shared/ExampleViews/AnimationAudioExample.xaml
index ce59e168..43e16a31 100644
--- a/src/WPFDevelopers.Samples.Shared/ExampleViews/AnimationAudioExample.xaml
+++ b/src/WPFDevelopers.Samples.Shared/ExampleViews/AnimationAudioExample.xaml
@@ -1,52 +1,65 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
diff --git a/src/WPFDevelopers.Samples.Shared/ExampleViews/BadgeExample.xaml b/src/WPFDevelopers.Samples.Shared/ExampleViews/BadgeExample.xaml
index 926b8970..84b26186 100644
--- a/src/WPFDevelopers.Samples.Shared/ExampleViews/BadgeExample.xaml
+++ b/src/WPFDevelopers.Samples.Shared/ExampleViews/BadgeExample.xaml
@@ -20,10 +20,12 @@
x:Name="MyBadgeToggleButton"
Margin="10"
HorizontalAlignment="Center"
- Content="显示Badge" />
+ Content="显示Badge"
+ IsChecked="True" />
diff --git a/src/WPFDevelopers.Samples.Shared/ExampleViews/Loading/WaitLoadingExample.xaml b/src/WPFDevelopers.Samples.Shared/ExampleViews/Loading/WaitLoadingExample.xaml
index 38daba47..5688592c 100644
--- a/src/WPFDevelopers.Samples.Shared/ExampleViews/Loading/WaitLoadingExample.xaml
+++ b/src/WPFDevelopers.Samples.Shared/ExampleViews/Loading/WaitLoadingExample.xaml
@@ -1,21 +1,25 @@
-
+
-
+
+
+
+
-
-
+
+
diff --git a/src/WPFDevelopers.Samples.Shared/ExampleViews/MainWindow.xaml.cs b/src/WPFDevelopers.Samples.Shared/ExampleViews/MainWindow.xaml.cs
index 8ccda5b2..5a0e6948 100644
--- a/src/WPFDevelopers.Samples.Shared/ExampleViews/MainWindow.xaml.cs
+++ b/src/WPFDevelopers.Samples.Shared/ExampleViews/MainWindow.xaml.cs
@@ -71,5 +71,10 @@ void Create(double to)
};
grayscaleEffect.BeginAnimation(GrayscaleEffect.FactorProperty, doubleAnimation);
}
+ public void IsTwink()
+ {
+ WpfNotifyIcon.IsTwink = !WpfNotifyIcon.IsTwink;
+ menuItemTwink.IsChecked = WpfNotifyIcon.IsTwink;
+ }
}
}
diff --git a/src/WPFDevelopers.Samples.Shared/ExampleViews/MaskExample.xaml b/src/WPFDevelopers.Samples.Shared/ExampleViews/MaskExample.xaml
index fc0e4ee7..7d540517 100644
--- a/src/WPFDevelopers.Samples.Shared/ExampleViews/MaskExample.xaml
+++ b/src/WPFDevelopers.Samples.Shared/ExampleViews/MaskExample.xaml
@@ -1,43 +1,48 @@
-
+
-
-
+
+
-
+
-
+
-
-
-
+
+
+
-
+
-
-
+
+
diff --git a/src/WPFDevelopers.Samples.Shared/ExampleViews/MultiSelectComboBoxExample.xaml b/src/WPFDevelopers.Samples.Shared/ExampleViews/MultiSelectComboBoxExample.xaml
index 3742f396..3496b003 100644
--- a/src/WPFDevelopers.Samples.Shared/ExampleViews/MultiSelectComboBoxExample.xaml
+++ b/src/WPFDevelopers.Samples.Shared/ExampleViews/MultiSelectComboBoxExample.xaml
@@ -51,6 +51,7 @@
Height="38"
HorizontalAlignment="Center"
VerticalContentAlignment="Center"
+ wd:ElementHelper.CornerRadius="3"
wd:ElementHelper.Watermark="MultiSelectComboBox"
DisplayMemberPath="Number"
IsSelectAllActive="True"
diff --git a/src/WPFDevelopers.Samples.Shared/ExampleViews/MultiSelectSearchComboBoxExample.xaml b/src/WPFDevelopers.Samples.Shared/ExampleViews/MultiSelectSearchComboBoxExample.xaml
index 75434114..9be76a4c 100644
--- a/src/WPFDevelopers.Samples.Shared/ExampleViews/MultiSelectSearchComboBoxExample.xaml
+++ b/src/WPFDevelopers.Samples.Shared/ExampleViews/MultiSelectSearchComboBoxExample.xaml
@@ -71,11 +71,17 @@
wd:ElementHelper.Watermark="下拉多选搜索"
Delimiter="^"
IsSelectAllActive="True"
- SearchWatermark="请输入搜索内容">
-
-
-
-
+ SearchWatermark="请输入搜索内容" />
+
diff --git a/src/WPFDevelopers.Samples.Shared/ExampleViews/MultiSelectSearchComboBoxExample.xaml.cs b/src/WPFDevelopers.Samples.Shared/ExampleViews/MultiSelectSearchComboBoxExample.xaml.cs
index 3934d1e7..e31d6848 100644
--- a/src/WPFDevelopers.Samples.Shared/ExampleViews/MultiSelectSearchComboBoxExample.xaml.cs
+++ b/src/WPFDevelopers.Samples.Shared/ExampleViews/MultiSelectSearchComboBoxExample.xaml.cs
@@ -24,6 +24,14 @@ private void MultiSelectSearchComboBoxExample_Loaded(object sender, RoutedEventA
list.Add(i.ToString());
MyMultiSelectionSearchComboBox2.ItemsSource = list;
MyMultiSelectionSearchComboBox2.SelectedItems = list.Skip(3).ToList();
+
+ var list2 = new List();
+ list2.Add(new UserInfo() { ID = "0", Name = "343DST.com" });
+ list2.Add(new UserInfo() { ID = "1", Name = "ABCV.wang" });
+ list2.Add(new UserInfo() { ID = "2", Name = "PPOI.xu" });
+ list2.Add(new UserInfo() { ID = "3", Name = "josh.peng" });
+ MyMultiSelectionSearchComboBox3.ItemsSource = list2;
+ MyMultiSelectionSearchComboBox3.SelectedItems = list2.Where(x => x.ID == "1" || x.ID == "3").ToList();
}
private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
@@ -31,4 +39,9 @@ private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
WPFDevelopers.Controls.MessageBox.Show($"{MyMultiSelectionSearchComboBox2.Text} \r\n总共选中:{MyMultiSelectionSearchComboBox2.SelectedItems.Count} 条","选中内容",MessageBoxButton.OK,MessageBoxImage.Information);
}
}
+ public class UserInfo
+ {
+ public string ID { get; set; }
+ public string Name { get; set; }
+ }
}
diff --git a/src/WPFDevelopers.Samples.Shared/ExampleViews/NotifyIconExample.xaml b/src/WPFDevelopers.Samples.Shared/ExampleViews/NotifyIconExample.xaml
new file mode 100644
index 00000000..e71fe019
--- /dev/null
+++ b/src/WPFDevelopers.Samples.Shared/ExampleViews/NotifyIconExample.xaml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/WPFDevelopers.Samples.Shared/ExampleViews/NotifyIconExample.xaml.cs b/src/WPFDevelopers.Samples.Shared/ExampleViews/NotifyIconExample.xaml.cs
new file mode 100644
index 00000000..25fc8a9e
--- /dev/null
+++ b/src/WPFDevelopers.Samples.Shared/ExampleViews/NotifyIconExample.xaml.cs
@@ -0,0 +1,40 @@
+using System.Windows;
+using System.Windows.Controls;
+using WPFDevelopers.Controls;
+
+namespace WPFDevelopers.Samples.ExampleViews
+{
+ ///
+ /// NotifyIconExample.xaml 的交互逻辑
+ ///
+ public partial class NotifyIconExample : UserControl
+ {
+ public NotifyIconExample()
+ {
+ InitializeComponent();
+ }
+
+ private void BtnNotifyIconMessage_Click(object sender, RoutedEventArgs e)
+ {
+ var msg = "Welcome to WPFDevelopers ";
+ if (!string.IsNullOrWhiteSpace(MyTextBox.Text))
+ msg = MyTextBox.Text;
+ NotifyIcon.ShowBalloonTip("Message", msg, NotifyIconInfoType.None);
+ }
+
+ private void IsTwink_Checked(object sender, RoutedEventArgs e)
+ {
+ NotifyIconTwink();
+ }
+ private void UnIsTwink_Checked(object sender, RoutedEventArgs e)
+ {
+ NotifyIconTwink();
+ }
+ void NotifyIconTwink()
+ {
+ var mainWindow = Application.Current.MainWindow as MainWindow;
+ if (mainWindow == null) return;
+ mainWindow.IsTwink();
+ }
+ }
+}
diff --git a/src/WPFDevelopers.Samples.Shared/ExampleViews/NumericBoxExample.xaml b/src/WPFDevelopers.Samples.Shared/ExampleViews/NumericBoxExample.xaml
index bc9d8342..c06e76b5 100644
--- a/src/WPFDevelopers.Samples.Shared/ExampleViews/NumericBoxExample.xaml
+++ b/src/WPFDevelopers.Samples.Shared/ExampleViews/NumericBoxExample.xaml
@@ -12,8 +12,10 @@
mc:Ignorable="d">
diff --git a/src/WPFDevelopers.Samples.Shared/ExampleViews/PathIconExample.xaml b/src/WPFDevelopers.Samples.Shared/ExampleViews/PathIconExample.xaml
index 8d08c5bf..88b42930 100644
--- a/src/WPFDevelopers.Samples.Shared/ExampleViews/PathIconExample.xaml
+++ b/src/WPFDevelopers.Samples.Shared/ExampleViews/PathIconExample.xaml
@@ -14,40 +14,25 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/WPFDevelopers.Samples.Shared/ExampleViews/ScreenCutExample.xaml.cs b/src/WPFDevelopers.Samples.Shared/ExampleViews/ScreenCutExample.xaml.cs
index 7a40f5aa..97c4a133 100644
--- a/src/WPFDevelopers.Samples.Shared/ExampleViews/ScreenCutExample.xaml.cs
+++ b/src/WPFDevelopers.Samples.Shared/ExampleViews/ScreenCutExample.xaml.cs
@@ -86,9 +86,16 @@ private void ScreenCaptureExt_SnapCompleted(System.Windows.Media.Imaging.BitmapS
private void ScreenCaptureExt_SnapCanceled()
{
- if (App.CurrentMainWindow.WindowState == WindowState.Minimized)
- App.CurrentMainWindow.WindowState = WindowState.Normal;
- Message.Push($"{DateTime.Now} 取消截图",MessageBoxImage.Information);
+ try
+ {
+ if (App.CurrentMainWindow.WindowState == WindowState.Minimized)
+ App.CurrentMainWindow.WindowState = WindowState.Normal;
+ Message.Push($"{DateTime.Now} 取消截图", MessageBoxImage.Information);
+ }
+ catch (Exception ex)
+ {
+ WPFDevelopers.Controls.MessageBox.Show(ex.Message);
+ }
}
}
}
\ No newline at end of file
diff --git a/src/WPFDevelopers.Samples.Shared/ExampleViews/SpacingExample.xaml b/src/WPFDevelopers.Samples.Shared/ExampleViews/SpacingExample.xaml
new file mode 100644
index 00000000..bc3cf03b
--- /dev/null
+++ b/src/WPFDevelopers.Samples.Shared/ExampleViews/SpacingExample.xaml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/WPFDevelopers.Samples.Shared/ExampleViews/SpacingExample.xaml.cs b/src/WPFDevelopers.Samples.Shared/ExampleViews/SpacingExample.xaml.cs
new file mode 100644
index 00000000..5a4bab09
--- /dev/null
+++ b/src/WPFDevelopers.Samples.Shared/ExampleViews/SpacingExample.xaml.cs
@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace WPFDevelopers.Samples.ExampleViews
+{
+ ///
+ /// SpacingExample.xaml 的交互逻辑
+ ///
+ public partial class SpacingExample : UserControl
+ {
+ public SpacingExample()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/src/WPFDevelopers.Samples.Shared/ExampleViews/StarrySkyExample.xaml b/src/WPFDevelopers.Samples.Shared/ExampleViews/StarrySkyExample.xaml
index b2074cc8..7bfbf3a4 100644
--- a/src/WPFDevelopers.Samples.Shared/ExampleViews/StarrySkyExample.xaml
+++ b/src/WPFDevelopers.Samples.Shared/ExampleViews/StarrySkyExample.xaml
@@ -1,77 +1,77 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
-
-
+
+
diff --git a/src/WPFDevelopers.Samples.Shared/ExampleViews/TimePickerExample.xaml b/src/WPFDevelopers.Samples.Shared/ExampleViews/TimePickerExample.xaml
index e769c22b..9a38db3b 100644
--- a/src/WPFDevelopers.Samples.Shared/ExampleViews/TimePickerExample.xaml
+++ b/src/WPFDevelopers.Samples.Shared/ExampleViews/TimePickerExample.xaml
@@ -23,7 +23,13 @@
+
diff --git a/src/WPFDevelopers.Samples.Shared/ExampleViews/TimePickerExample.xaml.cs b/src/WPFDevelopers.Samples.Shared/ExampleViews/TimePickerExample.xaml.cs
index 35be815c..b84a3ca5 100644
--- a/src/WPFDevelopers.Samples.Shared/ExampleViews/TimePickerExample.xaml.cs
+++ b/src/WPFDevelopers.Samples.Shared/ExampleViews/TimePickerExample.xaml.cs
@@ -1,4 +1,6 @@
-using System.Windows.Controls;
+using System;
+using System.Windows;
+using System.Windows.Controls;
namespace WPFDevelopers.Samples.ExampleViews
{
@@ -7,9 +9,20 @@ namespace WPFDevelopers.Samples.ExampleViews
///
public partial class TimePickerExample : UserControl
{
+
+ public DateTime? MyDateTime
+ {
+ get { return (DateTime)GetValue(MyDateTimeProperty); }
+ set { SetValue(MyDateTimeProperty, value); }
+ }
+
+ public static readonly DependencyProperty MyDateTimeProperty =
+ DependencyProperty.Register("MyDateTime", typeof(DateTime?), typeof(TimePickerExample), new PropertyMetadata(null));
+
public TimePickerExample()
{
InitializeComponent();
+ MyDateTime = DateTime.Now.AddHours(1);
}
}
}
diff --git a/src/WPFDevelopers.Samples.Shared/Helpers/MenuEnum.cs b/src/WPFDevelopers.Samples.Shared/Helpers/MenuEnum.cs
index e9b21987..a02b745d 100644
--- a/src/WPFDevelopers.Samples.Shared/Helpers/MenuEnum.cs
+++ b/src/WPFDevelopers.Samples.Shared/Helpers/MenuEnum.cs
@@ -7,6 +7,7 @@ public enum MenuEnum
{
Navigation3D,
BasicControls,
+ NotifyIcon,
PanningItems,
BreatheLight,
RingLoading,
@@ -82,6 +83,10 @@ public enum MenuEnum
WaterfallPanel,
ChartLine,
Drap,
+ ChartPie,
+ Spacing,
+ Drawer,
+ DateRangePicker,
VirtualizingWrapPanel,
AcrylicBlur,
TaskbarInfo
diff --git a/src/WPFDevelopers.Samples.Shared/ViewModels/MainVM.cs b/src/WPFDevelopers.Samples.Shared/ViewModels/MainVM.cs
index d873cb5b..01920894 100644
--- a/src/WPFDevelopers.Samples.Shared/ViewModels/MainVM.cs
+++ b/src/WPFDevelopers.Samples.Shared/ViewModels/MainVM.cs
@@ -121,6 +121,9 @@ void MenuItemSelection(string _menuName)
case MenuEnum.BasicControls:
ControlPanel = new BasicControlsExample();
break;
+ case MenuEnum.NotifyIcon:
+ ControlPanel = new NotifyIconExample();
+ break;
case MenuEnum.RingLoading:
ControlPanel = new RingLoadingExample();
break;
@@ -349,6 +352,18 @@ void MenuItemSelection(string _menuName)
case MenuEnum.Drap:
ControlPanel = new DrapViewExample();
break;
+ case MenuEnum.ChartPie:
+ ControlPanel = new ChartPieExample();
+ break;
+ case MenuEnum.Spacing:
+ ControlPanel = new SpacingExample();
+ break;
+ case MenuEnum.Drawer:
+ ControlPanel = new DrawerExample();
+ break;
+ case MenuEnum.DateRangePicker:
+ ControlPanel = new DateRangePickerExample();
+ break;
case MenuEnum.VirtualizingWrapPanel:
ControlPanel = new VirtualizingWrapPanel();
new VirtualizingWrapPanelExample().MaskShowDialog();
diff --git a/src/WPFDevelopers.Samples.Shared/WPFDevelopers.Samples.Shared.projitems b/src/WPFDevelopers.Samples.Shared/WPFDevelopers.Samples.Shared.projitems
index 798e7ea1..07c1fd1d 100644
--- a/src/WPFDevelopers.Samples.Shared/WPFDevelopers.Samples.Shared.projitems
+++ b/src/WPFDevelopers.Samples.Shared/WPFDevelopers.Samples.Shared.projitems
@@ -25,6 +25,7 @@
+
@@ -107,6 +108,9 @@
ChartLineExample.xaml
+
+ ChartPieExample.xaml
+
Code
ChatEmojiExample.xaml
@@ -150,6 +154,9 @@
Code
DashboardExample.xaml
+
+ DateRangePickerExample.xaml
+
Code
DesktopBackground.xaml
@@ -169,6 +176,9 @@
DrapViewExample.xaml
+
+ DrawerExample.xaml
+
Code
DrawerMenuExample.xaml
@@ -293,6 +303,9 @@
NoneNoChromeWindow.xaml
+
+ NotifyIconExample.xaml
+
Code
NumberCardControl.xaml
@@ -377,6 +390,9 @@
Code
SongWordsExample.xaml
+
+ SpacingExample.xaml
+
Code
SpeedRocketsExample.xaml
@@ -488,6 +504,10 @@
MSBuild:Compile
Designer
+
+ MSBuild:Compile
+ Designer
+
MSBuild:Compile
Designer
@@ -584,6 +604,10 @@
MSBuild:Compile
Designer
+
+ MSBuild:Compile
+ Designer
+
MSBuild:Compile
Designer
@@ -628,6 +652,10 @@
MSBuild:Compile
Designer
+
+ MSBuild:Compile
+ Designer
+
MSBuild:Compile
Designer
@@ -644,6 +672,10 @@
MSBuild:Compile
Designer
+
+ MSBuild:Compile
+ Designer
+
MSBuild:Compile
Designer
@@ -789,6 +821,10 @@
MSBuild:Compile
Designer
+
+ MSBuild:Compile
+ Designer
+
MSBuild:Compile
Designer
@@ -873,6 +909,10 @@
MSBuild:Compile
Designer
+
+ MSBuild:Compile
+ Designer
+
MSBuild:Compile
Designer
@@ -954,82 +994,6 @@
Designer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Designer
diff --git a/src/WPFDevelopers.SamplesCode/WPFDevelopers.SamplesCode.csproj b/src/WPFDevelopers.SamplesCode/WPFDevelopers.SamplesCode.csproj
index 94a94a89..6abeaa6e 100644
--- a/src/WPFDevelopers.SamplesCode/WPFDevelopers.SamplesCode.csproj
+++ b/src/WPFDevelopers.SamplesCode/WPFDevelopers.SamplesCode.csproj
@@ -1,6 +1,6 @@
- net40;net45;net46;net47;net48;net5.0-windows;net6.0-windows;netcoreapp3.0
+ net40;net45;net46;net47;net48;net5.0-windows;net6.0-windows;netcoreapp3.0
true
WPFDevelopers.SamplesCode
WPFDevelopers.SamplesCode
@@ -144,6 +144,12 @@
+
+
+
+
+
+
@@ -488,5 +494,23 @@
ExampleViews\ChartLineExample.xaml
+
+ ExampleViews\ChartPieExample.xaml
+
+
+ ExampleViews\DrawerExample.xaml
+
+
+ Controls\Loadings\StreamerLoading.xaml
+
+
+ ExampleViews\DateRangePickerExample.xaml
+
+
+ ExampleViews\SpacingExample.xaml
+
+
+ ExampleViews\NotifyIconExample.xaml
+
diff --git a/src/WPFDevelopers.Shared/Controls/BaseControls/SliderRepeatButton.cs b/src/WPFDevelopers.Shared/Controls/BaseControls/SliderRepeatButton.cs
index fd744614..453783d2 100644
--- a/src/WPFDevelopers.Shared/Controls/BaseControls/SliderRepeatButton.cs
+++ b/src/WPFDevelopers.Shared/Controls/BaseControls/SliderRepeatButton.cs
@@ -4,17 +4,17 @@
namespace WPFDevelopers.Controls
{
- public class SliderRepeatButton: RepeatButton
+ public class SliderRepeatButton : RepeatButton
{
+ public static readonly DependencyProperty RadiusOrientationProperty =
+ DependencyProperty.Register("RadiusOrientation", typeof(RadiusOrientation), typeof(SliderRepeatButton),
+ new PropertyMetadata(null));
+
public RadiusOrientation RadiusOrientation
{
- get { return (RadiusOrientation)GetValue(RadiusOrientationProperty); }
- set { SetValue(RadiusOrientationProperty, value); }
+ get => (RadiusOrientation) GetValue(RadiusOrientationProperty);
+ set => SetValue(RadiusOrientationProperty, value);
}
-
- public static readonly DependencyProperty RadiusOrientationProperty =
- DependencyProperty.Register("RadiusOrientation", typeof(RadiusOrientation), typeof(SliderRepeatButton), new PropertyMetadata(null));
-
}
[Localizability(LocalizationCategory.None, Readability = Readability.Unreadable)]
@@ -29,4 +29,4 @@ public enum RadiusOrientation
BottomRight,
BottomLeft
}
-}
+}
\ No newline at end of file
diff --git a/src/WPFDevelopers.Shared/Controls/BaseControls/WDBorder.cs b/src/WPFDevelopers.Shared/Controls/BaseControls/WDBorder.cs
index f1aeb116..6212f3e5 100644
--- a/src/WPFDevelopers.Shared/Controls/BaseControls/WDBorder.cs
+++ b/src/WPFDevelopers.Shared/Controls/BaseControls/WDBorder.cs
@@ -7,16 +7,16 @@ namespace WPFDevelopers.Controls
{
public class WDBorder : Border
{
+ public static readonly DependencyPropertyKey ContentClipPropertyKey =
+ DependencyProperty.RegisterReadOnly("ContentClip", typeof(Geometry), typeof(WDBorder),
+ new PropertyMetadata(null));
+
+ public static readonly DependencyProperty ContentClipProperty = ContentClipPropertyKey.DependencyProperty;
+
public Geometry ContentClip
{
- get
- {
- return (Geometry)GetValue(ContentClipProperty);
- }
- set
- {
- SetValue(ContentClipProperty, value);
- }
+ get => (Geometry) GetValue(ContentClipProperty);
+ set => SetValue(ContentClipProperty, value);
}
private Geometry CalculateContentClip()
@@ -31,13 +31,14 @@ private Geometry CalculateContentClip()
var rect = new Rect(0.0, 0.0, width, height);
var radii = new GeometryHelper.Radii(cornerRadius, borderThickness, false);
var streamGeometry = new StreamGeometry();
- using (StreamGeometryContext streamGeometryContext = streamGeometry.Open())
+ using (var streamGeometryContext = streamGeometry.Open())
{
GeometryHelper.GenerateGeometry(streamGeometryContext, rect, radii);
streamGeometry.Freeze();
return streamGeometry;
}
}
+
return null;
}
@@ -46,11 +47,5 @@ protected override void OnRender(DrawingContext dc)
SetValue(ContentClipPropertyKey, CalculateContentClip());
base.OnRender(dc);
}
-
- public static readonly DependencyPropertyKey ContentClipPropertyKey =
- DependencyProperty.RegisterReadOnly("ContentClip", typeof(Geometry), typeof(WDBorder), new PropertyMetadata(null));
-
- public static readonly DependencyProperty ContentClipProperty = ContentClipPropertyKey.DependencyProperty;
-
}
-}
+}
\ No newline at end of file
diff --git a/src/WPFDevelopers.Shared/Controls/Charts/ChartBar.cs b/src/WPFDevelopers.Shared/Controls/Charts/ChartBar.cs
index dc764aec..ba597c7b 100644
--- a/src/WPFDevelopers.Shared/Controls/Charts/ChartBar.cs
+++ b/src/WPFDevelopers.Shared/Controls/Charts/ChartBar.cs
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Windows;
using System.Windows.Media;
+using WPFDevelopers.Core;
namespace WPFDevelopers.Controls
{
@@ -17,15 +18,18 @@ protected override void OnRender(DrawingContext drawingContext)
{
var formattedText = DrawingContextHelper.GetFormattedText(item.Key,
ChartFill, FlowDirection.LeftToRight);
- drawingContext.DrawText(formattedText, new Point(x + interval / 2 - formattedText.Width / 2, StartY + 4));
+ drawingContext.DrawText(formattedText,
+ new Point(x + interval / 2 - formattedText.Width / 2, StartY + 4));
var _value = item.Value;
var rectHeight = (_value - 0) / (IntervalY - 0) * (ScaleFactor * Rows);
var rect = new Rect(x + (interval - rectWidth) / 2, StartY - rectHeight, rectWidth, rectHeight);
drawingContext.DrawRectangle(NormalBrush, null, rect);
x += interval;
- var nRect = new Rect(rect.Left - EllipsePadding, rect.Top - EllipsePadding, rect.Width + EllipsePadding, rect.Height + EllipsePadding);
- dicts.Add(nRect, $"{item.Key} : {item.Value}");
+ var nRect = new Rect(rect.Left - EllipsePadding, rect.Top - EllipsePadding, rect.Width + EllipsePadding,
+ rect.Height + EllipsePadding);
+ dicts.Add(nRect, $"{item.Key} : {item.Value.FormatNumber()}");
}
+
PointCache = dicts;
}
}
diff --git a/src/WPFDevelopers.Shared/Controls/Charts/ChartBase.cs b/src/WPFDevelopers.Shared/Controls/Charts/ChartBase.cs
index cc3bfb86..01711ec1 100644
--- a/src/WPFDevelopers.Shared/Controls/Charts/ChartBase.cs
+++ b/src/WPFDevelopers.Shared/Controls/Charts/ChartBase.cs
@@ -1,4 +1,3 @@
-using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
@@ -13,17 +12,17 @@ namespace WPFDevelopers.Controls
{
public class ChartBase : Control
{
- private Popup _popup;
- private Border _border;
- private TextBlock _textBlock;
- public IDictionary PointCache;
- private bool isPopupOpen = false;
- private KeyValuePair _lastItem;
-
public static readonly DependencyProperty DatasProperty =
DependencyProperty.Register("Datas", typeof(IEnumerable>),
typeof(ChartBase), new UIPropertyMetadata(DatasChanged));
+ private Border _border;
+ private KeyValuePair _lastItem;
+ private Popup _popup;
+ private TextBlock _textBlock;
+ private bool isPopupOpen;
+ public IDictionary PointCache;
+
static ChartBase()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(ChartBase),
@@ -31,7 +30,7 @@ static ChartBase()
}
protected double EllipseSize { get; } = 7;
- protected double EllipsePadding{ get; } = 20;
+ protected double EllipsePadding { get; } = 20;
protected double Rows { get; } = 5;
protected double Interval { get; } = 120;
@@ -55,6 +54,7 @@ private static void DatasChanged(DependencyObject d, DependencyPropertyChangedEv
if (e.NewValue != null)
ctrl.InvalidateVisual();
}
+
protected override void OnMouseMove(MouseEventArgs e)
{
base.OnMouseMove(e);
@@ -67,35 +67,30 @@ protected override void OnMouseMove(MouseEventArgs e)
AllowsTransparency = true,
Placement = PlacementMode.MousePoint,
PlacementTarget = this,
- StaysOpen = false,
+ StaysOpen = false
};
_popup.MouseMove += (y, j) =>
{
var point = j.GetPosition(this);
if (isPopupOpen && _lastItem.Value != null)
- {
if (!_lastItem.Key.Contains(point))
{
_popup.IsOpen = false;
isPopupOpen = false;
_lastItem = new KeyValuePair();
}
- }
- };
- _popup.Closed += delegate
- {
- isPopupOpen = false;
};
- _textBlock = new TextBlock()
+ _popup.Closed += delegate { isPopupOpen = false; };
+ _textBlock = new TextBlock
{
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
- Foreground = (Brush)Application.Current.TryFindResource("WD.WindowForegroundColorBrush")
+ Foreground = (Brush) Application.Current.TryFindResource("WD.WindowForegroundColorBrush")
};
_border = new Border
{
Child = _textBlock,
- Background = (Brush)Application.Current.TryFindResource("WD.ChartFillSolidColorBrush"),
+ Background = (Brush) Application.Current.TryFindResource("WD.ChartFillSolidColorBrush"),
Effect = Application.Current.TryFindResource("WD.PopupShadowDepth") as DropShadowEffect,
Margin = new Thickness(10),
CornerRadius = new CornerRadius(3),
@@ -103,6 +98,7 @@ protected override void OnMouseMove(MouseEventArgs e)
};
_popup.Child = _border;
}
+
if (PointCache == null) return;
var currentPoint = e.GetPosition(this);
if (PointCache.Any(x => x.Key.Contains(currentPoint)))
@@ -135,9 +131,9 @@ public void DrawEllipse(IEnumerable rects, DrawingContext drawingContext)
};
drawingPen.Freeze();
- var backgroupBrush = new SolidColorBrush()
+ var backgroupBrush = new SolidColorBrush
{
- Color = (Color)Application.Current.TryFindResource("WD.BackgroundColor")
+ Color = (Color) Application.Current.TryFindResource("WD.BackgroundColor")
};
backgroupBrush.Freeze();
foreach (var item in rects)
diff --git a/src/WPFDevelopers.Shared/Controls/Charts/ChartLine.cs b/src/WPFDevelopers.Shared/Controls/Charts/ChartLine.cs
index 21302a93..c2deb755 100644
--- a/src/WPFDevelopers.Shared/Controls/Charts/ChartLine.cs
+++ b/src/WPFDevelopers.Shared/Controls/Charts/ChartLine.cs
@@ -1,8 +1,8 @@
-using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Media;
+using WPFDevelopers.Core;
namespace WPFDevelopers.Controls
{
@@ -27,18 +27,18 @@ protected override void OnRender(DrawingContext drawingContext)
var firstDataPoint = Datas.FirstOrDefault();
if (firstDataPoint.Equals(default(KeyValuePair)))
return;
- double proportion = firstDataPoint.Value / IntervalY;
- double yPositionFromBottom = StartY - proportion * (ScaleFactor * Rows);
+ var proportion = firstDataPoint.Value / IntervalY;
+ var yPositionFromBottom = StartY - proportion * (ScaleFactor * Rows);
var startPoint = new Point(x + Interval / 2, yPositionFromBottom);
points.Add(startPoint);
foreach (var item in Datas)
{
var formattedText = DrawingContextHelper.GetFormattedText(item.Key,
- ChartFill, FlowDirection.LeftToRight);
+ ChartFill, FlowDirection.LeftToRight);
var point = new Point(x + interval / 2 - formattedText.Width / 2, StartY + 4);
drawingContext.DrawText(formattedText, point);
- var y = StartY - (item.Value / IntervalY) * (ScaleFactor * Rows);
+ var y = StartY - item.Value / IntervalY * (ScaleFactor * Rows);
var endPoint = new Point(x + Interval / 2, y);
points.Add(endPoint);
drawingContext.DrawLine(drawingPen, startPoint, endPoint);
@@ -47,30 +47,34 @@ protected override void OnRender(DrawingContext drawingContext)
rects.Add(rect);
startPoint = endPoint;
x += interval;
- var nRect = new Rect(rect.Left - EllipsePadding, rect.Top - EllipsePadding, rect.Width + EllipsePadding, rect.Height + EllipsePadding);
- dicts.Add(nRect, $"{item.Key} : {item.Value}");
+ var nRect = new Rect(rect.Left - EllipsePadding, rect.Top - EllipsePadding, rect.Width + EllipsePadding,
+ rect.Height + EllipsePadding);
+ dicts.Add(nRect, $"{item.Key} : {item.Value.FormatNumber()}");
}
+
PointCache = dicts;
- if(points.Count > 1)
+ if (points.Count > 1)
{
- var color = (Color)Application.Current.TryFindResource("WD.PrimaryNormalColor");
+ var color = (Color) Application.Current.TryFindResource("WD.PrimaryNormalColor");
var rectBrush = new SolidColorBrush(color);
rectBrush.Opacity = 0.3;
rectBrush.Freeze();
var streamGeometry = new StreamGeometry();
- using (StreamGeometryContext geometryContext = streamGeometry.Open())
+ using (var geometryContext = streamGeometry.Open())
{
var sPoint = new Point(points[0].X, StartY);
geometryContext.BeginFigure(sPoint, true, true);
- foreach (Point point in points)
+ foreach (var point in points)
geometryContext.LineTo(point, true, true);
var ePoint = new Point(points[points.Count - 1].X, StartY);
geometryContext.LineTo(ePoint, true, true);
geometryContext.Close();
}
+
drawingContext.DrawGeometry(rectBrush, null, streamGeometry);
}
+
DrawEllipse(rects, drawingContext);
}
}
diff --git a/src/WPFDevelopers.Shared/Controls/Charts/ChartPie.cs b/src/WPFDevelopers.Shared/Controls/Charts/ChartPie.cs
new file mode 100644
index 00000000..dc3c6f91
--- /dev/null
+++ b/src/WPFDevelopers.Shared/Controls/Charts/ChartPie.cs
@@ -0,0 +1,240 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Effects;
+using System.Windows.Shapes;
+using WPFDevelopers.Core;
+
+namespace WPFDevelopers.Controls
+{
+ public class ChartPie : Control
+ {
+ public static readonly DependencyProperty DatasProperty =
+ DependencyProperty.Register("Datas", typeof(IEnumerable>),
+ typeof(ChartPie), new UIPropertyMetadata(DatasChanged));
+
+ private Border _border;
+ private Ellipse _ellipse;
+ private KeyValuePair _lastItem;
+ private Popup _popup;
+ private StackPanel _stackPanel;
+ private TextBlock _textBlock;
+ private double centerX, centerY, radius;
+ private bool isPopupOpen;
+ private readonly Dictionary pathGeometries = new Dictionary();
+
+ private readonly Color[] vibrantColors;
+
+ public ChartPie()
+ {
+ vibrantColors = new[]
+ {
+ Color.FromArgb(255, 84, 112, 198),
+ Color.FromArgb(255, 145, 204, 117),
+ Color.FromArgb(255, 250, 200, 88),
+ Color.FromArgb(255, 238, 102, 102),
+ Color.FromArgb(255, 115, 192, 222),
+ Color.FromArgb(255, 59, 162, 114),
+ Color.FromArgb(255, 252, 132, 82),
+ Color.FromArgb(255, 154, 96, 180),
+ Color.FromArgb(255, 234, 124, 204)
+ };
+ }
+
+ public IEnumerable> Datas
+ {
+ get => (IEnumerable>) GetValue(DatasProperty);
+ set => SetValue(DatasProperty, value);
+ }
+
+ private static void DatasChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ var ctrl = d as ChartPie;
+ if (e.NewValue != null)
+ ctrl.InvalidateVisual();
+ }
+
+ protected override void OnMouseMove(MouseEventArgs e)
+ {
+ base.OnMouseMove(e);
+ if (Datas == null || Datas.Count() == 0 || isPopupOpen) return;
+ if (_popup == null)
+ {
+ _popup = new Popup
+ {
+ AllowsTransparency = true,
+ Placement = PlacementMode.MousePoint,
+ PlacementTarget = this,
+ StaysOpen = false
+ };
+ _popup.MouseMove += (y, j) =>
+ {
+ var point = j.GetPosition(this);
+ if (isPopupOpen && _lastItem.Value != null)
+ if (!IsMouseOverGeometry(_lastItem.Key))
+ {
+ _popup.IsOpen = false;
+ isPopupOpen = false;
+ _lastItem = new KeyValuePair();
+ }
+ };
+ _popup.Closed += delegate { isPopupOpen = false; };
+
+ _textBlock = new TextBlock
+ {
+ HorizontalAlignment = HorizontalAlignment.Center,
+ VerticalAlignment = VerticalAlignment.Center,
+ Foreground = (Brush) Application.Current.TryFindResource("WD.WindowForegroundColorBrush"),
+ Padding = new Thickness(4, 0, 2, 0)
+ };
+ _ellipse = new Ellipse
+ {
+ Width = 10,
+ Height = 10,
+ Stroke = Brushes.White
+ };
+ _stackPanel = new StackPanel {Orientation = Orientation.Horizontal};
+ _stackPanel.Children.Add(_ellipse);
+ _stackPanel.Children.Add(_textBlock);
+
+ _border = new Border
+ {
+ Child = _stackPanel,
+ Background = (Brush) Application.Current.TryFindResource("WD.ChartFillSolidColorBrush"),
+ Effect = Application.Current.TryFindResource("WD.PopupShadowDepth") as DropShadowEffect,
+ Margin = new Thickness(10),
+ CornerRadius = new CornerRadius(3),
+ Padding = new Thickness(6)
+ };
+ _popup.Child = _border;
+ }
+
+ var index = 0;
+ foreach (var pathGeometry in pathGeometries)
+ {
+ if (IsMouseOverGeometry(pathGeometry.Key))
+ {
+ isPopupOpen = true;
+ _ellipse.Fill = new SolidColorBrush
+ {
+ Color = vibrantColors[index >= vibrantColors.Length ? index % vibrantColors.Length : index]
+ };
+ _textBlock.Text = pathGeometry.Value;
+ //var bounds = pathGeometry.Key.Bounds;
+ //var center = new Point(bounds.Left + bounds.Width / 2, bounds.Top + bounds.Height / 2);
+ //_popup.HorizontalOffset = center.X - (_border.ActualWidth / 2);
+ //_popup.VerticalOffset = center.Y - (_border.ActualHeight / 2);
+ _popup.IsOpen = true;
+ _lastItem = pathGeometry;
+ break;
+ }
+
+ index++;
+ }
+ }
+
+ private bool IsMouseOverGeometry(PathGeometry pathGeometry)
+ {
+ var mousePosition = Mouse.GetPosition(this);
+ return pathGeometry.FillContains(mousePosition);
+ }
+
+ protected override void OnRender(DrawingContext drawingContext)
+ {
+ base.OnRender(drawingContext);
+ if (Datas == null || Datas.Count() == 0)
+ return;
+ SnapsToDevicePixels = true;
+ UseLayoutRounding = true;
+ pathGeometries.Clear();
+ var drawingPen = CreatePen(2);
+ var boldDrawingPen = CreatePen(4);
+ var pieWidth = ActualWidth > ActualHeight ? ActualHeight : ActualWidth;
+ var pieHeight = ActualWidth > ActualHeight ? ActualHeight : ActualWidth;
+ centerX = pieWidth / 2;
+ centerY = pieHeight / 2;
+ radius = ActualWidth > ActualHeight ? ActualHeight / 2 : ActualWidth / 2;
+ var angle = 0d;
+ var prevAngle = 0d;
+ var sum = Datas.Select(ser => ser.Value).Sum();
+ var index = 0;
+ var isFirst = false;
+ foreach (var item in Datas)
+ {
+ var arcStartX = radius * Math.Cos(angle * Math.PI / 180) + centerX;
+ var arcStartY = radius * Math.Sin(angle * Math.PI / 180) + centerY;
+ angle = item.Value / sum * 360 + prevAngle;
+ var arcEndX = 0d;
+ var arcEndY = 0d;
+ if (Datas.Count() == 1 && angle == 360)
+ {
+ isFirst = true;
+ arcEndX = centerX + Math.Cos(359.99999 * Math.PI / 180) * radius;
+ arcEndY = radius * Math.Sin(359.99999 * Math.PI / 180) + centerY;
+ }
+ else
+ {
+ arcEndX = centerX + Math.Cos(angle * Math.PI / 180) * radius;
+ arcEndY = radius * Math.Sin(angle * Math.PI / 180) + centerY;
+ }
+ var startPoint = new Point(arcStartX, arcStartY);
+ var line1Segment = new LineSegment(startPoint, false);
+ var isLargeArc = item.Value / sum > 0.5;
+ var arcSegment = new ArcSegment();
+ var size = new Size(radius, radius);
+ var endPoint = new Point(arcEndX, arcEndY);
+ arcSegment.Size = size;
+ arcSegment.Point = endPoint;
+ arcSegment.SweepDirection = SweepDirection.Clockwise;
+ arcSegment.IsLargeArc = isLargeArc;
+ var center = new Point(centerX, centerY);
+ var line2Segment = new LineSegment(center, false);
+ var pathGeometry = new PathGeometry(new[]
+ {
+ new PathFigure(new Point(centerX, centerY), new List
+ {
+ line1Segment,
+ arcSegment,
+ line2Segment
+ }, true)
+ });
+ pathGeometries.Add(pathGeometry,
+ $"{item.Key} : {item.Value.FormatNumber()}");
+ var backgroupBrush = new SolidColorBrush
+ {
+ Color = vibrantColors[
+ index >= vibrantColors.Length
+ ? index % vibrantColors.Length
+ : index]
+ };
+ backgroupBrush.Freeze();
+ drawingContext.DrawGeometry(backgroupBrush, null, pathGeometry);
+ index++;
+ if (!isFirst)
+ {
+ if (index == 1)
+ drawingContext.DrawLine(boldDrawingPen, center, startPoint);
+ else
+ drawingContext.DrawLine(drawingPen, center, startPoint);
+ }
+ prevAngle = angle;
+ }
+ }
+
+ private Pen CreatePen(double thickness)
+ {
+ var pen = new Pen
+ {
+ Thickness = thickness,
+ Brush = Brushes.White
+ };
+ pen.Freeze();
+ return pen;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/WPFDevelopers.Shared/Controls/Charts/ChartRadar.cs b/src/WPFDevelopers.Shared/Controls/Charts/ChartRadar.cs
index 1ec8d4fd..55a75504 100644
--- a/src/WPFDevelopers.Shared/Controls/Charts/ChartRadar.cs
+++ b/src/WPFDevelopers.Shared/Controls/Charts/ChartRadar.cs
@@ -9,14 +9,16 @@ namespace WPFDevelopers.Controls
{
public class ChartRadar : ChartBase
{
- private PointCollection _points;
private double _h, _w;
private Pen _penXAxis;
+ private PointCollection _points;
+
static ChartRadar()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(ChartRadar),
new FrameworkPropertyMetadata(typeof(ChartRadar)));
}
+
protected override void OnRender(DrawingContext drawingContext)
{
base.OnRender(drawingContext);
@@ -30,7 +32,7 @@ protected override void OnRender(DrawingContext drawingContext)
var dicts = new Dictionary();
var rects = new List();
var max = Convert.ToInt32(Datas.Max(kvp => kvp.Value)) + 50;
- double v = StartX;
+ var v = StartX;
for (var i = 0; i < Rows; i++)
{
DrawPoints(v, drawingContext, i == Rows - 1);
@@ -55,28 +57,33 @@ protected override void OnRender(DrawingContext drawingContext)
{
var startPoint = _points[index];
var point = new Point((startPoint.X - _w) / max * item.Value + _w,
- (startPoint.Y - _h) / max * item.Value + _h);
+ (startPoint.Y - _h) / max * item.Value + _h);
points.Add(point);
var ellipsePoint = new Point(point.X - EllipseSize / 2, point.Y - EllipseSize / 2);
var rect = new Rect(ellipsePoint, new Size(EllipseSize, EllipseSize));
rects.Add(rect);
- var nRect = new Rect(rect.Left - EllipsePadding, rect.Top - EllipsePadding, rect.Width + EllipsePadding, rect.Height + EllipsePadding);
+ var nRect = new Rect(rect.Left - EllipsePadding, rect.Top - EllipsePadding,
+ rect.Width + EllipsePadding, rect.Height + EllipsePadding);
dicts.Add(nRect, $"{item.Key} : {item.Value}");
}
+
index++;
}
+
geometryContext.BeginFigure(points[points.Count - 1], true, true);
geometryContext.PolyLineTo(points, true, true);
}
+
PointCache = dicts;
streamGeometry.Freeze();
- var color = (Color)Application.Current.TryFindResource("WD.PrimaryNormalColor");
+ var color = (Color) Application.Current.TryFindResource("WD.PrimaryNormalColor");
var rectBrush = new SolidColorBrush(color);
rectBrush.Opacity = 0.5;
rectBrush.Freeze();
drawingContext.DrawGeometry(rectBrush, myPen, streamGeometry);
DrawEllipse(rects, drawingContext);
}
+
private void DrawPoints(double circleRadius, DrawingContext drawingContext, bool isDrawText = false)
{
var pieWidth = ActualWidth > ActualHeight ? ActualHeight : ActualWidth;
@@ -93,6 +100,7 @@ private void DrawPoints(double circleRadius, DrawingContext drawingContext, bool
geometryContext.BeginFigure(_points[_points.Count - 1], true, true);
geometryContext.PolyLineTo(_points, true, true);
}
+
streamGeometry.Freeze();
drawingContext.DrawGeometry(null, _penXAxis, streamGeometry);
}
@@ -111,8 +119,9 @@ private PointCollection GetPolygonPoint(Point center, double r,
if (drawingContext != null)
{
drawingContext.DrawLine(_penXAxis, p1, p2);
- var formattedText = DrawingContextHelper.GetFormattedText(item.Key, ControlsHelper.PrimaryNormalBrush,
- flowDirection: FlowDirection.LeftToRight, textSize: 20.001D);
+ var formattedText = DrawingContextHelper.GetFormattedText(item.Key,
+ ControlsHelper.PrimaryNormalBrush,
+ FlowDirection.LeftToRight, 20.001D);
if (p2.Y > center.Y && p2.X < center.X)
drawingContext.DrawText(formattedText,
new Point(p2.X - formattedText.Width - 5, p2.Y - formattedText.Height / 2));
@@ -127,9 +136,11 @@ private PointCollection GetPolygonPoint(Point center, double r,
else
drawingContext.DrawText(formattedText, new Point(p2.X, p2.Y));
}
+
values.Add(p2);
g += perangle;
}
+
var pcollect = new PointCollection(values);
return pcollect;
}
diff --git a/src/WPFDevelopers.Shared/Controls/Charts/ChartRect.cs b/src/WPFDevelopers.Shared/Controls/Charts/ChartRect.cs
index bc61817d..08ec16b4 100644
--- a/src/WPFDevelopers.Shared/Controls/Charts/ChartRect.cs
+++ b/src/WPFDevelopers.Shared/Controls/Charts/ChartRect.cs
@@ -1,19 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
using System.Windows;
using System.Windows.Media;
namespace WPFDevelopers.Controls
{
- public class ChartRect:ChartBase
+ public class ChartRect : ChartBase
{
-
-
protected Brush ChartFill { get; private set; }
protected double IntervalY { get; private set; }
protected short ScaleFactor { get; private set; } = 80;
+
protected override void OnRender(DrawingContext drawingContext)
{
base.OnRender(drawingContext);
@@ -77,7 +75,8 @@ protected override void OnRender(DrawingContext drawingContext)
new Point(StartX - formattedText.Width - 10, yAxis - formattedText.Height / 2));
yAxis -= ScaleFactor;
}
+
drawingContext.DrawSnappedLinesBetweenPoints(xAxisPen, xAxisPen.Thickness, points.ToArray());
}
}
-}
+}
\ No newline at end of file
diff --git a/src/WPFDevelopers.Shared/Controls/DateRangePicker/DateRangePicker.cs b/src/WPFDevelopers.Shared/Controls/DateRangePicker/DateRangePicker.cs
new file mode 100644
index 00000000..199a2719
--- /dev/null
+++ b/src/WPFDevelopers.Shared/Controls/DateRangePicker/DateRangePicker.cs
@@ -0,0 +1,488 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Input;
+using System.Windows.Media;
+using WPFDevelopers.Helpers;
+
+namespace WPFDevelopers.Controls
+{
+ [TemplatePart(Name = PopupTemplateName, Type = typeof(Popup))]
+ [TemplatePart(Name = StartCalendarTemplateName, Type = typeof(Calendar))]
+ [TemplatePart(Name = EndCalendarTemplateName, Type = typeof(Calendar))]
+ [TemplatePart(Name = TextBoxStartTemplateName, Type = typeof(DatePickerTextBox))]
+ [TemplatePart(Name = TextBoxEndTemplateName, Type = typeof(DatePickerTextBox))]
+ public class DateRangePicker : Control
+ {
+ private const string PopupTemplateName = "PART_Popup";
+ private const string StartCalendarTemplateName = "PART_StartCalendar";
+ private const string EndCalendarTemplateName = "PART_EndCalendar";
+ private const string TextBoxStartTemplateName = "PART_TextBoxStart";
+ private const string TextBoxEndTemplateName = "PART_TextBoxEnd";
+
+ public static readonly DependencyProperty StartWatermarkProperty =
+ DependencyProperty.Register("StartWatermark",
+ typeof(string),
+ typeof(DateRangePicker),
+ new PropertyMetadata(string.Empty));
+
+ public static readonly DependencyProperty EndWatermarkProperty =
+ DependencyProperty.Register("EndWatermark",
+ typeof(string),
+ typeof(DateRangePicker),
+ new PropertyMetadata(string.Empty));
+
+ public static readonly DependencyProperty StartDateProperty =
+ DependencyProperty.Register("StartDate", typeof(DateTime?), typeof(DateRangePicker),
+ new FrameworkPropertyMetadata(null,
+ FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.Journal,
+ OnStartDateChanged));
+
+ public static readonly DependencyProperty EndDateProperty =
+ DependencyProperty.Register("EndDate", typeof(DateTime?), typeof(DateRangePicker),
+ new FrameworkPropertyMetadata(null,
+ FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.Journal,
+ OnEndDateChanged));
+
+ public static readonly DependencyProperty DateFormatFormatProperty =
+ DependencyProperty.Register("DateFormat", typeof(string), typeof(DateRangePicker),
+ new PropertyMetadata("yyy-MM-dd"));
+
+ public static readonly DependencyProperty MaxDropDownHeightProperty =
+ DependencyProperty.Register("MaxDropDownHeight", typeof(double), typeof(DateRangePicker),
+ new UIPropertyMetadata(SystemParameters.PrimaryScreenHeight / 2.5, OnMaxDropDownHeightChanged));
+
+ private int _clickCount;
+
+ private bool _isHandlingSelectionChange;
+ private Popup _popup;
+ private Calendar _startCalendar, _endCalendar;
+ private IEnumerable _startCalendarDayButtons, _endCalendarDayButtons;
+ private DateTime? _startDate, _endDate;
+ private DatePickerTextBox _textBoxStart, _textBoxEnd;
+
+ static DateRangePicker()
+ {
+ DefaultStyleKeyProperty.OverrideMetadata(typeof(DateRangePicker),
+ new FrameworkPropertyMetadata(typeof(DateRangePicker)));
+ }
+
+ public string StartWatermark
+ {
+ get => (string)GetValue(StartWatermarkProperty);
+ set => SetValue(StartWatermarkProperty, value);
+ }
+
+ public string EndWatermark
+ {
+ get => (string)GetValue(EndWatermarkProperty);
+ set => SetValue(EndWatermarkProperty, value);
+ }
+
+
+ public DateTime? StartDate
+ {
+ get => (DateTime?)GetValue(StartDateProperty);
+ set => SetValue(StartDateProperty, value);
+ }
+
+ public DateTime? EndDate
+ {
+ get => (DateTime?)GetValue(EndDateProperty);
+ set => SetValue(EndDateProperty, value);
+ }
+
+ public string DateFormat
+ {
+ get => (string)GetValue(DateFormatFormatProperty);
+ set => SetValue(DateFormatFormatProperty, value);
+ }
+
+ private static void OnStartDateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ }
+
+ private static void OnEndDateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ }
+
+
+ private static void OnMaxDropDownHeightChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ var ctrl = d as DateRangePicker;
+ if (ctrl != null)
+ ctrl.OnMaxDropDownHeightChanged((double)e.OldValue, (double)e.NewValue);
+ }
+
+ protected virtual void OnMaxDropDownHeightChanged(double oldValue, double newValue)
+ {
+ }
+
+ public override void OnApplyTemplate()
+ {
+ base.OnApplyTemplate();
+ _popup = (Popup)GetTemplateChild(PopupTemplateName);
+ if (_popup != null)
+ {
+ _popup.Focusable = true;
+ _popup.PlacementTarget = this;
+ _popup.Opened -= Popup_Opened;
+ _popup.Opened += Popup_Opened;
+ }
+
+ AddHandler(PreviewMouseUpEvent, new MouseButtonEventHandler(OnPreviewMouseUp), true);
+
+ _startCalendar = (Calendar)GetTemplateChild(StartCalendarTemplateName);
+ if (_startCalendar != null)
+ {
+ _startCalendar.PreviewMouseUp += OnCalendar_PreviewMouseUp;
+ _startCalendar.DisplayDateChanged += OnStartCalendar_DisplayDateChanged;
+ _startCalendar.SelectedDatesChanged += OnStartCalendar_SelectedDatesChanged;
+ }
+
+ _endCalendar = (Calendar)GetTemplateChild(EndCalendarTemplateName);
+ if (_endCalendar != null)
+ {
+ _endCalendar.PreviewMouseUp += OnCalendar_PreviewMouseUp;
+ _endCalendar.DisplayDateChanged += OnEndCalendar_DisplayDateChanged;
+ _endCalendar.SelectedDatesChanged += OnEndCalendar_SelectedDatesChanged;
+ }
+
+ var now = DateTime.Now;
+ var firstDayOfNextMonth = new DateTime(now.Year, now.Month, 1).AddMonths(1);
+ _startCalendar.DisplayDateEnd = firstDayOfNextMonth.AddDays(-1);
+ _endCalendar.DisplayDate = firstDayOfNextMonth;
+ _endCalendar.DisplayDateStart = firstDayOfNextMonth;
+ var window = Window.GetWindow(this);
+ if (window != null)
+ window.MouseDown += OnWindow_MouseDown;
+
+ _startCalendarDayButtons = GetCalendarDayButtons(_startCalendar);
+ _endCalendarDayButtons = GetCalendarDayButtons(_endCalendar);
+ _textBoxStart = (DatePickerTextBox)GetTemplateChild(TextBoxStartTemplateName);
+ if (_textBoxStart != null)
+ _textBoxStart.TextChanged += TextBoxStart_TextChanged;
+ _textBoxEnd = (DatePickerTextBox)GetTemplateChild(TextBoxEndTemplateName);
+ if (_textBoxEnd != null)
+ _textBoxEnd.TextChanged += TextBoxEnd_TextChanged;
+ Loaded += DateRangePicker_Loaded;
+ }
+
+ private void TextBoxEnd_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ if (_textBoxEnd != null)
+ {
+ if (DateTime.TryParse(_textBoxEnd.Text, out var dateTime))
+ {
+ if (EndDate.HasValue && dateTime.ToString(DateFormat) == EndDate.Value.ToString(DateFormat))
+ return;
+ if (StartDate.HasValue && dateTime < StartDate.Value.Date)
+ {
+ EndDate = _endDate;
+ _textBoxEnd.Text = _endDate.Value.ToString(DateFormat);
+ return;
+ }
+
+ SetIsHighlightFalse(_endCalendarDayButtons);
+ EndDate = dateTime;
+ PopupOpened();
+ }
+ else
+ {
+ EndDate = _endDate;
+ _textBoxEnd.Text = _endDate.Value.ToString(DateFormat);
+ }
+ }
+ }
+
+ private void TextBoxStart_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ if (_textBoxStart != null)
+ {
+ if (DateTime.TryParse(_textBoxStart.Text, out var dateTime))
+ {
+ if (StartDate.HasValue && dateTime.ToString(DateFormat) == StartDate.Value.ToString(DateFormat))
+ return;
+ if (EndDate.HasValue && dateTime < EndDate.Value.Date)
+ {
+ StartDate = _startDate;
+ _textBoxStart.Text = _startDate.Value.ToString(DateFormat);
+ return;
+ }
+
+ SetIsHighlightFalse(_startCalendarDayButtons);
+ StartDate = dateTime;
+ PopupOpened();
+ }
+ else
+ {
+ StartDate = _startDate;
+ _textBoxStart.Text = _startDate.Value.ToString(DateFormat);
+ }
+ }
+ }
+
+ private void ClearSelectedDates()
+ {
+ _startCalendar.SelectedDatesChanged -= OnStartCalendar_SelectedDatesChanged;
+ _endCalendar.SelectedDatesChanged -= OnEndCalendar_SelectedDatesChanged;
+ _startCalendar.SelectedDates.Clear();
+ SetIsHighlightFalse(_startCalendarDayButtons);
+ _endCalendar.SelectedDates.Clear();
+ SetIsHighlightFalse(_endCalendarDayButtons);
+ _startCalendar.SelectedDatesChanged += OnStartCalendar_SelectedDatesChanged;
+ _endCalendar.SelectedDatesChanged += OnEndCalendar_SelectedDatesChanged;
+ }
+
+ private void DateRangePicker_Loaded(object sender, RoutedEventArgs e)
+ {
+ if (_textBoxStart != null && StartDate.HasValue)
+ _textBoxStart.Text = StartDate.Value.ToString(DateFormat);
+ if (_textBoxEnd != null && EndDate.HasValue)
+ _textBoxEnd.Text = EndDate.Value.ToString(DateFormat);
+ }
+
+ private void Popup_Opened(object sender, EventArgs e)
+ {
+ PopupOpened();
+ }
+
+ private void PopupOpened()
+ {
+ _startCalendar.SelectedDatesChanged -= OnStartCalendar_SelectedDatesChanged;
+ _endCalendar.SelectedDatesChanged -= OnEndCalendar_SelectedDatesChanged;
+ if (StartDate.HasValue)
+ _startDate = StartDate.Value;
+ if (EndDate.HasValue)
+ _endDate = EndDate.Value;
+ _clickCount = 0;
+ SetSelectedDates(EndDate);
+ _startCalendar.SelectedDatesChanged += OnStartCalendar_SelectedDatesChanged;
+ _endCalendar.SelectedDatesChanged += OnEndCalendar_SelectedDatesChanged;
+ }
+
+ private void OnEndCalendar_DisplayDateChanged(object sender, CalendarDateChangedEventArgs e)
+ {
+ if (!_startDate.HasValue || !_endDate.HasValue)
+ return;
+ var isYearMonthBetween = IsYearMonthBetween(e.AddedDate.Value, _startDate.Value, _endDate.Value);
+ if (!isYearMonthBetween)
+ {
+ SetIsHighlightFalse(_endCalendarDayButtons);
+ }
+ else
+ {
+ SetIsHighlightFalse(_endCalendarDayButtons);
+ SetSelectedDates();
+ }
+ }
+
+ private void OnStartCalendar_DisplayDateChanged(object sender, CalendarDateChangedEventArgs e)
+ {
+ if (!_startDate.HasValue || !_endDate.HasValue)
+ return;
+ var isYearMonthBetween = IsYearMonthBetween(e.AddedDate.Value, _startDate.Value, _endDate.Value);
+ if (!isYearMonthBetween)
+ {
+ SetIsHighlightFalse(_startCalendarDayButtons);
+ }
+ else
+ {
+ SetIsHighlightFalse(_startCalendarDayButtons);
+ SetSelectedDates();
+ }
+ }
+
+ private void OnStartCalendar_SelectedDatesChanged(object sender, SelectionChangedEventArgs e)
+ {
+ if (_isHandlingSelectionChange)
+ return;
+ _isHandlingSelectionChange = true;
+ try
+ {
+ if (e.AddedItems.Count > 0)
+ {
+ var dateTime = Convert.ToDateTime(e.AddedItems[0]);
+ _endCalendar.SelectedDates.Clear();
+ ResetDate(dateTime);
+ }
+
+ SetSelectedDates();
+ }
+ finally
+ {
+ _isHandlingSelectionChange = false;
+ }
+ }
+
+ private void OnEndCalendar_SelectedDatesChanged(object sender, SelectionChangedEventArgs e)
+ {
+ if (_isHandlingSelectionChange)
+ return;
+ _isHandlingSelectionChange = true;
+ try
+ {
+ if (e.AddedItems.Count > 0)
+ {
+ var dateTime = Convert.ToDateTime(e.AddedItems[0]);
+ _startCalendar.SelectedDates.Clear();
+ ResetDate(dateTime);
+ }
+
+ SetSelectedDates();
+ }
+ finally
+ {
+ _isHandlingSelectionChange = false;
+ }
+ }
+
+ private void OnCalendar_PreviewMouseUp(object sender, MouseButtonEventArgs e)
+ {
+ if (Mouse.Captured is CalendarItem)
+ {
+ _clickCount++;
+ Mouse.Capture(null);
+ }
+ }
+
+ private void OnWindow_MouseDown(object sender, MouseButtonEventArgs e)
+ {
+ if (_popup != null && _popup.IsOpen)
+ _popup.IsOpen = false;
+ }
+
+ private void OnPreviewMouseUp(object sender, MouseButtonEventArgs e)
+ {
+ if (_popup != null && !_popup.IsOpen)
+ _popup.IsOpen = true;
+ }
+
+ private void ResetDate(DateTime? dateTime)
+ {
+ if (_startDate.HasValue && _endDate.HasValue)
+ {
+ _startDate = Convert.ToDateTime(dateTime);
+ _endDate = null;
+ if (_startCalendarDayButtons != null)
+ {
+ var startDays = _startCalendarDayButtons.Where(x => DatePickerHelper.GetIsHighlight(x));
+ foreach (var day in startDays) DatePickerHelper.SetIsHighlight(day, false);
+ }
+
+ if (_endCalendarDayButtons != null)
+ {
+ var endDays = _endCalendarDayButtons.Where(x => DatePickerHelper.GetIsHighlight(x));
+ foreach (var day in endDays) DatePickerHelper.SetIsHighlight(day, false);
+ }
+ }
+ else
+ {
+ if (!_startDate.HasValue)
+ _startDate = Convert.ToDateTime(dateTime);
+ else
+ _endDate = Convert.ToDateTime(dateTime);
+ }
+ }
+
+ private void SetSelectedDates(DateTime? endDate = null)
+ {
+ if (_startDate.HasValue && _endDate.HasValue)
+ {
+ if (DateTime.Compare(_startDate.Value, _endDate.Value) > 0)
+ {
+ var temp = _startDate.Value;
+ _startDate = _endDate.Value;
+ _endDate = temp;
+ }
+
+ _startCalendar.SelectedDates.Clear();
+ _endCalendar.SelectedDates.Clear();
+ var eDate = _endDate;
+ if (endDate.HasValue)
+ eDate = endDate.Value;
+ for (var date = _startDate.Value; date < eDate.Value.AddDays(1); date = date.AddDays(1))
+ {
+ if (date.Date <= eDate.Value.Date
+ &&
+ !_startCalendar.SelectedDates.Contains(date.Date)
+ &&
+ date.Date <= _startCalendar.DisplayDateEnd.Value.Date)
+ {
+ _startCalendar.SelectedDates.Add(date);
+ if (date.Date == _startDate.Value.Date || date.Date >= eDate.Value.Date)
+ continue;
+ if (_startCalendarDayButtons != null)
+ {
+ var day = _startCalendarDayButtons.FirstOrDefault(x =>
+ x.DataContext is DateTime buttonDate && buttonDate.Date == date.Date);
+ if (day != null)
+ DatePickerHelper.SetIsHighlight(day, true);
+ }
+ }
+
+ if (date.Date >= _endCalendar.DisplayDateStart.Value.Date &&
+ !_endCalendar.SelectedDates.Contains(date.Date))
+ if (date.Date >= _startDate.Value.Date
+ &&
+ !_endCalendar.SelectedDates.Contains(date)
+ &&
+ date.Date >= _endCalendar.DisplayDateStart.Value.Date)
+ {
+ _endCalendar.SelectedDates.Add(date);
+ if (date.Date == eDate.Value.Date || date.Date <= _startDate.Value.Date)
+ continue;
+ if (_endCalendarDayButtons != null)
+ {
+ var day = _endCalendarDayButtons.FirstOrDefault(x =>
+ x.DataContext is DateTime buttonDate && buttonDate.Date == date.Date);
+ if (day != null)
+ DatePickerHelper.SetIsHighlight(day, true);
+ }
+ }
+ }
+
+ if (_clickCount == 2)
+ {
+ _popup.IsOpen = false;
+ StartDate = _startDate;
+ EndDate = _endDate;
+ _textBoxStart.Text = _startDate.Value.ToString(DateFormat);
+ _textBoxEnd.Text = _endDate.Value.ToString(DateFormat);
+ }
+ }
+ }
+
+ private void SetIsHighlightFalse(IEnumerable calendarDayButtons)
+ {
+ if (calendarDayButtons == null)
+ return;
+ var days = calendarDayButtons.Where(x => DatePickerHelper.GetIsHighlight(x));
+ foreach (var day in days)
+ DatePickerHelper.SetIsHighlight(day, false);
+ }
+
+ private bool IsYearMonthBetween(DateTime dateToCheck, DateTime startDate, DateTime endDate)
+ {
+ return dateToCheck.Year == startDate.Year && dateToCheck.Month >= startDate.Month &&
+ dateToCheck.Year == endDate.Year && dateToCheck.Month <= endDate.Month;
+ }
+
+ private IEnumerable GetCalendarDayButtons(DependencyObject parent)
+ {
+ if (parent == null) yield break;
+
+ for (var i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++)
+ {
+ var child = VisualTreeHelper.GetChild(parent, i);
+ if (child is CalendarDayButton dayButton)
+ yield return dayButton;
+ foreach (var result in GetCalendarDayButtons(child))
+ yield return result;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/WPFDevelopers.Shared/Controls/Drawer/Drawer.cs b/src/WPFDevelopers.Shared/Controls/Drawer/Drawer.cs
new file mode 100644
index 00000000..24784596
--- /dev/null
+++ b/src/WPFDevelopers.Shared/Controls/Drawer/Drawer.cs
@@ -0,0 +1,175 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+
+namespace WPFDevelopers.Controls
+{
+ [TemplatePart(Name = BorderHeaderTemplateName, Type = typeof(Border))]
+ [TemplatePart(Name = BorderMarkTemplateName, Type = typeof(Border))]
+ public class Drawer : HeaderedContentControl
+ {
+ private const string BorderHeaderTemplateName = "PART_Header";
+ private const string BorderMarkTemplateName = "PART_Mark";
+
+ public static readonly DependencyProperty EdgePositionProperty =
+ DependencyProperty.Register("Position", typeof(Position), typeof(Drawer),
+ new PropertyMetadata(Position.Left));
+
+ public static readonly DependencyProperty IsOpenProperty =
+ DependencyProperty.Register("IsOpen", typeof(bool), typeof(Drawer),
+ new PropertyMetadata(false, OnIsOpenChanged));
+
+ private Storyboard _enterStoryboard;
+ private Storyboard _exitStoryboard;
+
+ private Border _headerBorder;
+ private double _headerHeight;
+ private double _headerWidth;
+ private Border _markBorder;
+
+ static Drawer()
+ {
+ DefaultStyleKeyProperty.OverrideMetadata(typeof(Drawer), new FrameworkPropertyMetadata(typeof(Drawer)));
+ }
+
+ public Position Position
+ {
+ get => (Position) GetValue(EdgePositionProperty);
+ set => SetValue(EdgePositionProperty, value);
+ }
+
+ public bool IsOpen
+ {
+ get => (bool) GetValue(IsOpenProperty);
+ set => SetValue(IsOpenProperty, value);
+ }
+
+ private static void OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ var ctrl = d as Drawer;
+ if (ctrl != null)
+ {
+ if (ctrl.IsOpen)
+ {
+ ctrl._headerBorder.Visibility = Visibility.Visible;
+ ctrl._enterStoryboard.Begin();
+ }
+ else
+ {
+ ctrl._exitStoryboard.Begin();
+ }
+ }
+ }
+
+ public override void OnApplyTemplate()
+ {
+ base.OnApplyTemplate();
+ _headerBorder = GetTemplateChild(BorderHeaderTemplateName) as Border;
+ if (_headerBorder != null)
+ _headerBorder.Loaded += HeaderBorder_Loaded;
+ _markBorder = GetTemplateChild(BorderMarkTemplateName) as Border;
+ if (_markBorder != null)
+ _markBorder.MouseDown += MarkBorder_MouseDown;
+ }
+
+ private void MarkBorder_MouseDown(object sender, MouseButtonEventArgs e)
+ {
+ IsOpen = false;
+ }
+
+ private void HeaderBorder_Loaded(object sender, RoutedEventArgs e)
+ {
+ TranslateTransform translateTransform;
+ DoubleAnimation animation, exitAnimation;
+ switch (Position)
+ {
+ case Position.Left:
+ case Position.Right:
+ _headerWidth = _headerBorder.ActualWidth;
+ if (Position == Position.Left)
+ translateTransform = new TranslateTransform(-_headerWidth, 0);
+ else
+ translateTransform = new TranslateTransform(_headerWidth, 0);
+ _headerBorder.RenderTransform = new TransformGroup
+ {
+ Children = new TransformCollection {translateTransform}
+ };
+ animation = new DoubleAnimation
+ {
+ From = Position == Position.Left ? -_headerWidth : _headerWidth,
+ To = 0,
+ Duration = TimeSpan.FromMilliseconds(300)
+ };
+
+ Storyboard.SetTarget(animation, _headerBorder);
+ Storyboard.SetTargetProperty(animation, new PropertyPath("RenderTransform.Children[0].X"));
+ _enterStoryboard = new Storyboard();
+ _enterStoryboard.Children.Add(animation);
+
+ exitAnimation = new DoubleAnimation
+ {
+ From = 0,
+ To = Position == Position.Left ? -_headerWidth : _headerWidth,
+ Duration = TimeSpan.FromMilliseconds(300)
+ };
+
+ Storyboard.SetTarget(exitAnimation, _headerBorder);
+ Storyboard.SetTargetProperty(exitAnimation, new PropertyPath("RenderTransform.Children[0].X"));
+ _exitStoryboard = new Storyboard();
+ _exitStoryboard.Completed += delegate
+ {
+ if (!IsOpen)
+ _headerBorder.Visibility = Visibility.Collapsed;
+ };
+ _exitStoryboard.Children.Add(exitAnimation);
+ break;
+ case Position.Top:
+ case Position.Bottom:
+ _headerHeight = _headerBorder.ActualHeight;
+ if (Position == Position.Top)
+ translateTransform = new TranslateTransform(0, -_headerHeight);
+ else
+ translateTransform = new TranslateTransform(0, _headerHeight);
+ _headerBorder.RenderTransform = new TransformGroup
+ {
+ Children = new TransformCollection {translateTransform}
+ };
+ animation = new DoubleAnimation
+ {
+ From = Position == Position.Top ? -_headerHeight : _headerHeight,
+ To = 0,
+ Duration = TimeSpan.FromMilliseconds(300)
+ };
+
+ Storyboard.SetTarget(animation, _headerBorder);
+ Storyboard.SetTargetProperty(animation, new PropertyPath("RenderTransform.Children[0].Y"));
+ _enterStoryboard = new Storyboard();
+ _enterStoryboard.Children.Add(animation);
+
+ exitAnimation = new DoubleAnimation
+ {
+ From = 0,
+ To = Position == Position.Top ? -_headerHeight : _headerHeight,
+ Duration = TimeSpan.FromMilliseconds(300)
+ };
+
+ Storyboard.SetTarget(exitAnimation, _headerBorder);
+ Storyboard.SetTargetProperty(exitAnimation, new PropertyPath("RenderTransform.Children[0].Y"));
+ _exitStoryboard = new Storyboard();
+ _exitStoryboard.Completed += delegate
+ {
+ if (!IsOpen)
+ _headerBorder.Visibility = Visibility.Collapsed;
+ };
+ _exitStoryboard.Children.Add(exitAnimation);
+ break;
+ }
+
+ _headerBorder.Visibility = Visibility.Collapsed;
+ _headerBorder.Loaded -= HeaderBorder_Loaded;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/WPFDevelopers.Shared/Controls/Loadings/BallLoading.cs b/src/WPFDevelopers.Shared/Controls/Loadings/BallLoading.cs
index 8638f67e..c741b6eb 100644
--- a/src/WPFDevelopers.Shared/Controls/Loadings/BallLoading.cs
+++ b/src/WPFDevelopers.Shared/Controls/Loadings/BallLoading.cs
@@ -18,7 +18,7 @@ namespace WPFDevelopers.Controls
[TemplatePart(Name = Part_Eillipse3TemplateName, Type = typeof(Ellipse))]
[TemplatePart(Name = Part_EillpseDock4TemplateName, Type = typeof(SmallPanel))]
[TemplatePart(Name = Part_Eillipse4TemplateName, Type = typeof(Ellipse))]
- public class BallLoading : Control
+ public class BallLoading : LoadingBase
{
private const string Part_BackGridTemplateName = "Part_BackGrid";
private const string Part_EillipseTemplateName = "Part_Eillipse";
@@ -30,35 +30,19 @@ public class BallLoading : Control
private const string Part_Eillipse3TemplateName = "Part_Eillipse3";
private const string Part_EillpseDock4TemplateName = "Part_EillpseDock4";
private const string Part_Eillipse4TemplateName = "Part_Eillipse4";
-
private const int _nBallCount = 5;
-
- public static readonly DependencyProperty IsStartAnimationProperty =
- DependencyProperty.Register("IsStartAnimation", typeof(bool), typeof(BallLoading),
- new PropertyMetadata(true, OnPropertyChangedCallback));
-
private readonly int _AnimationSlowTime = 500;
-
private double _BallFrom;
-
private readonly double _BallSize = 40;
private double _BallTo;
-
private bool _bLoadedAnimation;
-
- private bool _IsStart;
-
private readonly Dictionary> _mapBallColors =
new Dictionary>();
-
private readonly int _OffsetTime = 1;
-
private readonly int _SingleAnimationTime = 4;
-
+ private bool _isLoading;
private Storyboard _Storyboard;
-
private Storyboard _Storyboard1;
-
private SmallPanel Part_BackGrid;
private Ellipse Part_Eillipse;
private Ellipse Part_Eillipse1;
@@ -82,13 +66,6 @@ public BallLoading()
Unloaded += BallLoading_Unloaded;
}
-
- public bool IsStartAnimation
- {
- get => (bool)GetValue(IsStartAnimationProperty);
- set => SetValue(IsStartAnimationProperty, value);
- }
-
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
@@ -109,37 +86,27 @@ private void BallLoading_Loaded(object sender, RoutedEventArgs e)
LoadingProcedure();
}
-
private void BallLoading_Unloaded(object sender, RoutedEventArgs e)
{
Close();
}
- private static void OnPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ protected override void OnIsLoadingChanged(bool oldValue, bool newValue)
{
- if (d == null)
- return;
-
- if (d is BallLoading control)
- if (e.Property == IsStartAnimationProperty)
- if (bool.TryParse(e.NewValue.ToString(), out var bResult))
- {
- if (bResult)
- control.Start();
- else
- control.Stop();
- }
+ base.OnIsLoadingChanged(oldValue, newValue);
+ if (newValue)
+ Start();
+ else
+ Stop();
}
private bool LoadingProcedure()
{
if (_bLoadedAnimation)
return true;
-
CalculateContainer();
LoadResource();
LoadAnimation();
-
_bLoadedAnimation = true;
return true;
}
@@ -148,12 +115,9 @@ private bool CalculateContainer()
{
var vActualWidth = Part_BackGrid.ActualWidth;
var vSingleWidth = vActualWidth / _nBallCount;
-
var vMargin = (vSingleWidth - _BallSize) / 2;
-
_BallFrom = vMargin;
_BallTo = vActualWidth - vMargin - _BallSize;
-
return true;
}
@@ -161,35 +125,24 @@ private bool CalculateContainer()
private bool LoadResource()
{
_mapBallColors.Clear();
-
var tuple0 = new Tuple(Color.FromRgb(0xff, 0x93, 0x03), Color.FromRgb(0xff, 0x8c, 0x09));
_mapBallColors[0] = tuple0;
-
var tuple1 = new Tuple(Color.FromRgb(0xff, 0x78, 0x1a), Color.FromRgb(0xff, 0x6a, 0x27));
_mapBallColors[1] = tuple1;
-
var tuple2 = new Tuple(Color.FromRgb(0xff, 0x55, 0x39), Color.FromRgb(0xff, 0x48, 0x45));
_mapBallColors[2] = tuple2;
-
var tuple3 = new Tuple(Color.FromRgb(0xff, 0x33, 0x57), Color.FromRgb(0xff, 0x24, 0x65));
_mapBallColors[3] = tuple3;
-
var tuple4 = new Tuple(Color.FromRgb(0xff, 0x09, 0x7c), Color.FromRgb(0xff, 0x03, 0x82));
_mapBallColors[4] = tuple4;
-
-
var rotate1 = new RotateTransform();
Part_EillpseDock1.RenderTransform = rotate1;
-
var rotate2 = new RotateTransform();
Part_EillpseDock2.RenderTransform = rotate2;
-
var rotate3 = new RotateTransform();
Part_EillpseDock3.RenderTransform = rotate3;
-
var rotate4 = new RotateTransform();
Part_EillpseDock4.RenderTransform = rotate4;
-
return true;
}
@@ -217,14 +170,11 @@ private bool LoadAnimation()
LoadAnimationBall1RotateBack(_Storyboard1);
-
- if (IsStartAnimation)
+ if (IsLoading)
Start();
-
return true;
}
-
//第一个小球 从左向右移动 从0号位移动到4号位 单程4s 动画缓动 500ms
private bool LoadAnimationFromLeftToRight(Storyboard storyboard)
{
@@ -235,11 +185,9 @@ private bool LoadAnimationFromLeftToRight(Storyboard storyboard)
BeginTime = TimeSpan.FromMilliseconds(_AnimationSlowTime),
Duration = new Duration(new TimeSpan(0, 0, _SingleAnimationTime))
};
-
Storyboard.SetTarget(animation, Part_Eillipse);
Storyboard.SetTargetProperty(animation, new PropertyPath("(Canvas.Left)"));
storyboard.Children.Add(animation);
-
return true;
}
@@ -266,44 +214,32 @@ private bool LoadAnimationBallLToRTurnColors(Storyboard storyboard)
{
{
//第一个小球移动过程中变色 移动到下一个位置前变色
-
var animation1 = BallMoveColor(Part_Eillipse, 0, 0, 1);
storyboard.Children.Add(animation1);
-
var animation2 = BallMoveColor(Part_Eillipse, 1, 0, 1);
storyboard.Children.Add(animation2);
}
-
{
//第一个小球移动过程中变色 移动到下一个位置前变色
-
var animation1 = BallMoveColor(Part_Eillipse, 0, 1, 2);
storyboard.Children.Add(animation1);
-
var animation2 = BallMoveColor(Part_Eillipse, 1, 1, 2);
storyboard.Children.Add(animation2);
}
-
{
//第一个小球移动过程中变色 移动到下一个位置前变色
-
var animation1 = BallMoveColor(Part_Eillipse, 0, 2, 3);
storyboard.Children.Add(animation1);
-
var animation2 = BallMoveColor(Part_Eillipse, 1, 2, 3);
storyboard.Children.Add(animation2);
}
-
{
//第一个小球移动过程中变色 移动到下一个位置前变色
-
var animation1 = BallMoveColor(Part_Eillipse, 0, 3, 4);
storyboard.Children.Add(animation1);
-
var animation2 = BallMoveColor(Part_Eillipse, 1, 3, 4);
storyboard.Children.Add(animation2);
}
-
return true;
}
@@ -313,45 +249,33 @@ private bool LoadAnimationBallRToLTurnColors(Storyboard storyboard)
//从右向左
{
//第一个小球移动过程中变色 移动到下一个位置前变色
-
var animation1 = BallMoveColor(Part_Eillipse, 0, 4, 3);
storyboard.Children.Add(animation1);
-
var animation2 = BallMoveColor(Part_Eillipse, 1, 4, 3);
storyboard.Children.Add(animation2);
}
-
{
//第一个小球移动过程中变色 移动到下一个位置前变色
-
var animation1 = BallMoveColor(Part_Eillipse, 0, 3, 2);
storyboard.Children.Add(animation1);
-
var animation2 = BallMoveColor(Part_Eillipse, 1, 3, 2);
storyboard.Children.Add(animation2);
}
-
{
//第一个小球移动过程中变色 移动到下一个位置前变色
-
var animation1 = BallMoveColor(Part_Eillipse, 0, 2, 1);
storyboard.Children.Add(animation1);
-
var animation2 = BallMoveColor(Part_Eillipse, 1, 2, 1);
storyboard.Children.Add(animation2);
}
-
{
//第一个小球移动过程中变色 移动到下一个位置前变色
-
var animation1 = BallMoveColor(Part_Eillipse, 0, 1, 0);
storyboard.Children.Add(animation1);
-
var animation2 = BallMoveColor(Part_Eillipse, 1, 1, 0);
storyboard.Children.Add(animation2);
}
-
return true;
}
@@ -359,7 +283,6 @@ private bool LoadAnimationBallRToLTurnColors(Storyboard storyboard)
private bool LoadAnimationBall1Rotate(Storyboard storyboard)
{
var nIndex = 0;
-
{
//替补小球1 从0-180度翻转
var animation = new DoubleAnimation
@@ -369,11 +292,9 @@ private bool LoadAnimationBall1Rotate(Storyboard storyboard)
BeginTime = TimeSpan.FromMilliseconds(_AnimationSlowTime + nIndex * 1000),
Duration = new Duration(new TimeSpan(0, 0, _OffsetTime))
};
-
Storyboard.SetTarget(animation, Part_EillpseDock1);
Storyboard.SetTargetProperty(animation, new PropertyPath("RenderTransform.Angle"));
storyboard.Children.Add(animation);
-
//替补小球1 从1号位移动到0号位颜色变化
var color1 = new Color();
var color2 = new Color();
@@ -383,19 +304,16 @@ private bool LoadAnimationBall1Rotate(Storyboard storyboard)
color1 = vResult.Item1;
color2 = vResult.Item2;
}
-
var animation1 = new ColorAnimation
{
To = color1,
BeginTime = TimeSpan.FromMilliseconds(_AnimationSlowTime + nIndex * 1000),
Duration = new Duration(new TimeSpan(0, 0, _OffsetTime))
};
-
Storyboard.SetTarget(animation1, Part_Eillipse1);
Storyboard.SetTargetProperty(animation1,
new PropertyPath("(Ellipse.Fill).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)"));
storyboard.Children.Add(animation1);
-
var animation2 = new ColorAnimation
{
To = color2,
@@ -406,11 +324,8 @@ private bool LoadAnimationBall1Rotate(Storyboard storyboard)
Storyboard.SetTargetProperty(animation2,
new PropertyPath("(Ellipse.Fill).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)"));
storyboard.Children.Add(animation2);
-
++nIndex;
}
-
-
{
//替补小球2 从0-180度翻转
var animation = new DoubleAnimation
@@ -420,11 +335,9 @@ private bool LoadAnimationBall1Rotate(Storyboard storyboard)
BeginTime = TimeSpan.FromMilliseconds(_AnimationSlowTime + nIndex * 1000),
Duration = new Duration(new TimeSpan(0, 0, _OffsetTime))
};
-
Storyboard.SetTarget(animation, Part_EillpseDock2);
Storyboard.SetTargetProperty(animation, new PropertyPath("RenderTransform.Angle"));
storyboard.Children.Add(animation);
-
//替补小球2 从2号位移动到1号位颜色变化
var color1 = new Color();
var color2 = new Color();
@@ -434,19 +347,16 @@ private bool LoadAnimationBall1Rotate(Storyboard storyboard)
color1 = vResult.Item1;
color2 = vResult.Item2;
}
-
var animation1 = new ColorAnimation
{
To = color1,
BeginTime = TimeSpan.FromMilliseconds(_AnimationSlowTime + nIndex * 1000),
Duration = new Duration(new TimeSpan(0, 0, _OffsetTime))
};
-
Storyboard.SetTarget(animation1, Part_Eillipse2);
Storyboard.SetTargetProperty(animation1,
new PropertyPath("(Ellipse.Fill).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)"));
storyboard.Children.Add(animation1);
-
var animation2 = new ColorAnimation
{
To = color2,
@@ -457,10 +367,8 @@ private bool LoadAnimationBall1Rotate(Storyboard storyboard)
Storyboard.SetTargetProperty(animation2,
new PropertyPath("(Ellipse.Fill).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)"));
storyboard.Children.Add(animation2);
-
++nIndex;
}
-
{
//替补小球3 从0-180度翻转
var animation = new DoubleAnimation
@@ -470,11 +378,9 @@ private bool LoadAnimationBall1Rotate(Storyboard storyboard)
BeginTime = TimeSpan.FromMilliseconds(_AnimationSlowTime + nIndex * 1000),
Duration = new Duration(new TimeSpan(0, 0, _OffsetTime))
};
-
Storyboard.SetTarget(animation, Part_EillpseDock3);
Storyboard.SetTargetProperty(animation, new PropertyPath("RenderTransform.Angle"));
storyboard.Children.Add(animation);
-
//替补小球3 从3号位移动到2号位颜色变化
var color1 = new Color();
var color2 = new Color();
@@ -484,19 +390,16 @@ private bool LoadAnimationBall1Rotate(Storyboard storyboard)
color1 = vResult.Item1;
color2 = vResult.Item2;
}
-
var animation1 = new ColorAnimation
{
To = color1,
BeginTime = TimeSpan.FromMilliseconds(_AnimationSlowTime + nIndex * 1000),
Duration = new Duration(new TimeSpan(0, 0, _OffsetTime))
};
-
Storyboard.SetTarget(animation1, Part_Eillipse3);
Storyboard.SetTargetProperty(animation1,
new PropertyPath("(Ellipse.Fill).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)"));
storyboard.Children.Add(animation1);
-
var animation2 = new ColorAnimation
{
To = color2,
@@ -507,10 +410,8 @@ private bool LoadAnimationBall1Rotate(Storyboard storyboard)
Storyboard.SetTargetProperty(animation2,
new PropertyPath("(Ellipse.Fill).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)"));
storyboard.Children.Add(animation2);
-
++nIndex;
}
-
{
//替补小球4 从0-180度翻转
var animation = new DoubleAnimation
@@ -520,11 +421,9 @@ private bool LoadAnimationBall1Rotate(Storyboard storyboard)
BeginTime = TimeSpan.FromMilliseconds(_AnimationSlowTime + nIndex * 1000),
Duration = new Duration(new TimeSpan(0, 0, _OffsetTime))
};
-
Storyboard.SetTarget(animation, Part_EillpseDock4);
Storyboard.SetTargetProperty(animation, new PropertyPath("RenderTransform.Angle"));
storyboard.Children.Add(animation);
-
//替补小球4 从4号位移动到3号位颜色变化
var color1 = new Color();
var color2 = new Color();
@@ -534,19 +433,16 @@ private bool LoadAnimationBall1Rotate(Storyboard storyboard)
color1 = vResult.Item1;
color2 = vResult.Item2;
}
-
var animation1 = new ColorAnimation
{
To = color1,
BeginTime = TimeSpan.FromMilliseconds(_AnimationSlowTime + nIndex * 1000),
Duration = new Duration(new TimeSpan(0, 0, _OffsetTime))
};
-
Storyboard.SetTarget(animation1, Part_Eillipse4);
Storyboard.SetTargetProperty(animation1,
new PropertyPath("(Ellipse.Fill).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)"));
storyboard.Children.Add(animation1);
-
var animation2 = new ColorAnimation
{
To = color2,
@@ -557,10 +453,8 @@ private bool LoadAnimationBall1Rotate(Storyboard storyboard)
Storyboard.SetTargetProperty(animation2,
new PropertyPath("(Ellipse.Fill).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)"));
storyboard.Children.Add(animation2);
-
++nIndex;
}
-
return true;
}
@@ -568,7 +462,6 @@ private bool LoadAnimationBall1Rotate(Storyboard storyboard)
private bool LoadAnimationBall1RotateBack(Storyboard storyboard)
{
var nIndex = 0;
-
{
//替补小球4 从180 -360翻转
var animation = new DoubleAnimation
@@ -578,11 +471,9 @@ private bool LoadAnimationBall1RotateBack(Storyboard storyboard)
BeginTime = TimeSpan.FromMilliseconds(nIndex * 1000 + _AnimationSlowTime),
Duration = new Duration(new TimeSpan(0, 0, _OffsetTime))
};
-
Storyboard.SetTarget(animation, Part_EillpseDock4);
Storyboard.SetTargetProperty(animation, new PropertyPath("RenderTransform.Angle"));
storyboard.Children.Add(animation);
-
//替补小球4 从3号位移动到4号位颜色变化
var color1 = new Color();
var color2 = new Color();
@@ -592,19 +483,16 @@ private bool LoadAnimationBall1RotateBack(Storyboard storyboard)
color1 = vResult.Item1;
color2 = vResult.Item2;
}
-
var animation1 = new ColorAnimation
{
To = color1,
BeginTime = TimeSpan.FromMilliseconds(nIndex * 1000 + _AnimationSlowTime),
Duration = new Duration(new TimeSpan(0, 0, _OffsetTime))
};
-
Storyboard.SetTarget(animation1, Part_Eillipse4);
Storyboard.SetTargetProperty(animation1,
new PropertyPath("(Ellipse.Fill).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)"));
storyboard.Children.Add(animation1);
-
var animation2 = new ColorAnimation
{
To = color2,
@@ -615,11 +503,8 @@ private bool LoadAnimationBall1RotateBack(Storyboard storyboard)
Storyboard.SetTargetProperty(animation2,
new PropertyPath("(Ellipse.Fill).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)"));
storyboard.Children.Add(animation2);
-
-
++nIndex;
}
-
{
//替补小球3 从180 -360翻转
var animation = new DoubleAnimation
@@ -629,11 +514,9 @@ private bool LoadAnimationBall1RotateBack(Storyboard storyboard)
BeginTime = TimeSpan.FromMilliseconds(nIndex * 1000 + _AnimationSlowTime),
Duration = new Duration(new TimeSpan(0, 0, _OffsetTime))
};
-
Storyboard.SetTarget(animation, Part_EillpseDock3);
Storyboard.SetTargetProperty(animation, new PropertyPath("RenderTransform.Angle"));
storyboard.Children.Add(animation);
-
//替补小球3 从2号位移动到3号位颜色变化
var color1 = new Color();
var color2 = new Color();
@@ -643,19 +526,16 @@ private bool LoadAnimationBall1RotateBack(Storyboard storyboard)
color1 = vResult.Item1;
color2 = vResult.Item2;
}
-
var animation1 = new ColorAnimation
{
To = color1,
BeginTime = TimeSpan.FromMilliseconds(nIndex * 1000 + _AnimationSlowTime),
Duration = new Duration(new TimeSpan(0, 0, _OffsetTime))
};
-
Storyboard.SetTarget(animation1, Part_Eillipse3);
Storyboard.SetTargetProperty(animation1,
new PropertyPath("(Ellipse.Fill).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)"));
storyboard.Children.Add(animation1);
-
var animation2 = new ColorAnimation
{
To = color2,
@@ -666,11 +546,8 @@ private bool LoadAnimationBall1RotateBack(Storyboard storyboard)
Storyboard.SetTargetProperty(animation2,
new PropertyPath("(Ellipse.Fill).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)"));
storyboard.Children.Add(animation2);
-
-
++nIndex;
}
-
{
//替补小球2 从180 -360翻转
var animation = new DoubleAnimation
@@ -680,7 +557,6 @@ private bool LoadAnimationBall1RotateBack(Storyboard storyboard)
BeginTime = TimeSpan.FromMilliseconds(nIndex * 1000 + _AnimationSlowTime),
Duration = new Duration(new TimeSpan(0, 0, _OffsetTime))
};
-
Storyboard.SetTarget(animation, Part_EillpseDock2);
Storyboard.SetTargetProperty(animation, new PropertyPath("RenderTransform.Angle"));
storyboard.Children.Add(animation);
@@ -694,7 +570,6 @@ private bool LoadAnimationBall1RotateBack(Storyboard storyboard)
color1 = vResult.Item1;
color2 = vResult.Item2;
}
-
var animation1 = new ColorAnimation
{
To = color1,
@@ -717,11 +592,8 @@ private bool LoadAnimationBall1RotateBack(Storyboard storyboard)
Storyboard.SetTargetProperty(animation2,
new PropertyPath("(Ellipse.Fill).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)"));
storyboard.Children.Add(animation2);
-
-
++nIndex;
}
-
{
//替补小球1 从180 -360翻转
var animation = new DoubleAnimation
@@ -731,11 +603,9 @@ private bool LoadAnimationBall1RotateBack(Storyboard storyboard)
BeginTime = TimeSpan.FromMilliseconds(nIndex * 1000 + _AnimationSlowTime),
Duration = new Duration(new TimeSpan(0, 0, _OffsetTime))
};
-
Storyboard.SetTarget(animation, Part_EillpseDock1);
Storyboard.SetTargetProperty(animation, new PropertyPath("RenderTransform.Angle"));
storyboard.Children.Add(animation);
-
//替补小球1 从0号位移动到1号位颜色变化
var color1 = new Color();
var color2 = new Color();
@@ -745,19 +615,16 @@ private bool LoadAnimationBall1RotateBack(Storyboard storyboard)
color1 = vResult.Item1;
color2 = vResult.Item2;
}
-
var animation1 = new ColorAnimation
{
To = color1,
BeginTime = TimeSpan.FromMilliseconds(nIndex * 1000 + _AnimationSlowTime),
Duration = new Duration(new TimeSpan(0, 0, _OffsetTime))
};
-
Storyboard.SetTarget(animation1, Part_Eillipse1);
Storyboard.SetTargetProperty(animation1,
new PropertyPath("(Ellipse.Fill).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)"));
storyboard.Children.Add(animation1);
-
var animation2 = new ColorAnimation
{
To = color2,
@@ -769,12 +636,9 @@ private bool LoadAnimationBall1RotateBack(Storyboard storyboard)
new PropertyPath("(Ellipse.Fill).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)"));
storyboard.Children.Add(animation2);
}
-
-
return true;
}
-
private ColorAnimation BallMoveColor(DependencyObject dependencyObject, int nIndex, int from, int to)
{
var color = new Color();
@@ -784,78 +648,75 @@ private ColorAnimation BallMoveColor(DependencyObject dependencyObject, int nInd
beginTime = from * 1000 + _AnimationSlowTime;
else
beginTime = (_SingleAnimationTime - from) * 1000 + _AnimationSlowTime;
-
switch (to)
{
case 1:
- {
- var vResult = _mapBallColors[1];
- if (vResult != null)
{
- if (nIndex == 0)
- color = vResult.Item1;
- else
- color = vResult.Item2;
+ var vResult = _mapBallColors[1];
+ if (vResult != null)
+ {
+ if (nIndex == 0)
+ color = vResult.Item1;
+ else
+ color = vResult.Item2;
+ }
}
- }
break;
case 2:
- {
- var vResult = _mapBallColors[2];
- if (vResult != null)
{
- if (nIndex == 0)
- color = vResult.Item1;
- else
- color = vResult.Item2;
+ var vResult = _mapBallColors[2];
+ if (vResult != null)
+ {
+ if (nIndex == 0)
+ color = vResult.Item1;
+ else
+ color = vResult.Item2;
+ }
}
- }
break;
case 3:
- {
- var vResult = _mapBallColors[3];
- if (vResult != null)
{
- if (nIndex == 0)
- color = vResult.Item1;
- else
- color = vResult.Item2;
+ var vResult = _mapBallColors[3];
+ if (vResult != null)
+ {
+ if (nIndex == 0)
+ color = vResult.Item1;
+ else
+ color = vResult.Item2;
+ }
}
- }
break;
case 4:
- {
- var vResult = _mapBallColors[4];
- if (vResult != null)
{
- if (nIndex == 0)
- color = vResult.Item1;
- else
- color = vResult.Item2;
+ var vResult = _mapBallColors[4];
+ if (vResult != null)
+ {
+ if (nIndex == 0)
+ color = vResult.Item1;
+ else
+ color = vResult.Item2;
+ }
}
- }
break;
default:
- {
- var vResult = _mapBallColors[0];
- if (vResult != null)
{
- if (nIndex == 0)
- color = vResult.Item1;
- else
- color = vResult.Item2;
+ var vResult = _mapBallColors[0];
+ if (vResult != null)
+ {
+ if (nIndex == 0)
+ color = vResult.Item1;
+ else
+ color = vResult.Item2;
+ }
}
- }
break;
}
-
var animation = new ColorAnimation
{
To = color,
BeginTime = TimeSpan.FromMilliseconds(beginTime),
Duration = new Duration(new TimeSpan(0, 0, _OffsetTime))
};
-
Storyboard.SetTarget(animation, dependencyObject);
if (nIndex == 0)
@@ -864,7 +725,6 @@ private ColorAnimation BallMoveColor(DependencyObject dependencyObject, int nInd
else
Storyboard.SetTargetProperty(animation,
new PropertyPath("(Ellipse.Fill).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)"));
-
return animation;
}
@@ -872,19 +732,14 @@ private void _Storyboard_Completed(object sender, EventArgs e)
{
if (Part_EillpseDock1.RenderTransform is RotateTransform rotate1)
rotate1.Angle = 180;
-
if (Part_EillpseDock2.RenderTransform is RotateTransform rotate2)
rotate2.Angle = 180;
-
if (Part_EillpseDock3.RenderTransform is RotateTransform rotate3)
rotate3.Angle = 180;
-
if (Part_EillpseDock4.RenderTransform is RotateTransform rotate4)
rotate4.Angle = 180;
-
Canvas.SetLeft(Part_Eillipse, _BallTo);
-
- if (IsStartAnimation)
+ if (IsLoading)
_Storyboard1.Begin();
}
@@ -892,34 +747,25 @@ private void _Storyboard1_Completed(object sender, EventArgs e)
{
if (Part_EillpseDock1.RenderTransform is RotateTransform rotate1)
rotate1.Angle = 0;
-
if (Part_EillpseDock2.RenderTransform is RotateTransform rotate2)
rotate2.Angle = 0;
-
if (Part_EillpseDock3.RenderTransform is RotateTransform rotate3)
rotate3.Angle = 0;
-
if (Part_EillpseDock4.RenderTransform is RotateTransform rotate4)
rotate4.Angle = 0;
-
Canvas.SetLeft(Part_Eillipse, _BallFrom);
-
- if (IsStartAnimation)
+ if (IsLoading)
_Storyboard.Begin();
}
-
private bool Start()
{
if (_Storyboard == null || _Storyboard1 == null)
return false;
-
- if (_IsStart)
+ if (_isLoading)
return true;
-
- _IsStart = true;
+ _isLoading = true;
_Storyboard.Begin();
-
return true;
}
@@ -927,17 +773,15 @@ private bool Stop()
{
_Storyboard?.Stop();
_Storyboard1?.Stop();
- _IsStart = false;
+ _isLoading = false;
return true;
}
private bool Close()
{
Stop();
-
_Storyboard = null;
_Storyboard1 = null;
-
return true;
}
}
diff --git a/src/WPFDevelopers.Shared/Controls/Loadings/CycleLoading.cs b/src/WPFDevelopers.Shared/Controls/Loadings/CycleLoading.cs
index f1cee32a..e1e7bac1 100644
--- a/src/WPFDevelopers.Shared/Controls/Loadings/CycleLoading.cs
+++ b/src/WPFDevelopers.Shared/Controls/Loadings/CycleLoading.cs
@@ -3,7 +3,7 @@
namespace WPFDevelopers.Controls
{
- public class CycleLoading : ContentControl
+ public class CycleLoading : LoadingBase
{
public static readonly DependencyProperty MaxValueProperty =
DependencyProperty.Register("MaxValue", typeof(double), typeof(CycleLoading), new PropertyMetadata(100d));
@@ -16,8 +16,8 @@ public class CycleLoading : ContentControl
DependencyProperty.Register("ValueDescription", typeof(string), typeof(CycleLoading),
new PropertyMetadata(default(string)));
- public static readonly DependencyProperty IsStartProperty =
- DependencyProperty.Register("IsStart", typeof(bool), typeof(CycleLoading), new PropertyMetadata(true));
+ //public static readonly DependencyProperty IsStartProperty =
+ // DependencyProperty.Register("IsStart", typeof(bool), typeof(CycleLoading), new PropertyMetadata(true));
public static readonly DependencyProperty LoadTitleProperty =
DependencyProperty.Register("LoadTitle", typeof(string), typeof(CycleLoading),
@@ -29,33 +29,29 @@ static CycleLoading()
new FrameworkPropertyMetadata(typeof(CycleLoading)));
}
-
public double MaxValue
{
get => (double)GetValue(MaxValueProperty);
set => SetValue(MaxValueProperty, value);
}
-
public double Value
{
get => (double)GetValue(ValueProperty);
set => SetValue(ValueProperty, value);
}
-
internal string ValueDescription
{
get => (string)GetValue(ValueDescriptionProperty);
set => SetValue(ValueDescriptionProperty, value);
}
- public bool IsStart
- {
- get => (bool)GetValue(IsStartProperty);
- set => SetValue(IsStartProperty, value);
- }
-
+ //public bool IsStart
+ //{
+ // get => (bool)GetValue(IsStartProperty);
+ // set => SetValue(IsStartProperty, value);
+ //}
public string LoadTitle
{
@@ -68,28 +64,23 @@ public override void OnApplyTemplate()
base.OnApplyTemplate();
}
-
private static void OnValuePropertyChangedCallBack(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (!(d is CycleLoading loading))
return;
-
if (!double.TryParse(e.NewValue?.ToString(), out var value))
return;
-
if (value >= loading.MaxValue)
{
value = loading.MaxValue;
-
- if (loading.IsStart)
- loading.IsStart = false;
+ if (loading.IsLoading)
+ loading.IsLoading = false;
}
else
{
- if (!loading.IsStart)
- loading.IsStart = true;
+ if (!loading.IsLoading)
+ loading.IsLoading = true;
}
-
var dValue = value / loading.MaxValue;
loading.ValueDescription = dValue.ToString("P0");
}
diff --git a/src/WPFDevelopers.Shared/Controls/Loadings/LoadingBase.cs b/src/WPFDevelopers.Shared/Controls/Loadings/LoadingBase.cs
new file mode 100644
index 00000000..b849a75f
--- /dev/null
+++ b/src/WPFDevelopers.Shared/Controls/Loadings/LoadingBase.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace WPFDevelopers.Controls
+{
+ public abstract class LoadingBase:ContentControl
+ {
+ public bool IsLoading
+ {
+ get { return (bool)GetValue(IsLoadingProperty); }
+ set { SetValue(IsLoadingProperty, value); }
+ }
+
+ public static readonly DependencyProperty IsLoadingProperty =
+ DependencyProperty.Register("IsLoading", typeof(bool), typeof(LoadingBase), new FrameworkPropertyMetadata(
+ true,
+ FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,
+ OnIsLoadingChanged,
+ CoerceIsLoading));
+
+ private static void OnIsLoadingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ var ctrl = (LoadingBase)d;
+ ctrl.OnIsLoadingChanged((bool)e.OldValue, (bool)e.NewValue);
+ }
+ private static object CoerceIsLoading(DependencyObject d, object baseValue)
+ {
+ return baseValue;
+ }
+ protected virtual void OnIsLoadingChanged(bool oldValue, bool newValue)
+ {
+ }
+ }
+}
diff --git a/src/WPFDevelopers.Shared/Controls/Loadings/RingLoading.cs b/src/WPFDevelopers.Shared/Controls/Loadings/RingLoading.cs
index b75869e6..9e8f1388 100644
--- a/src/WPFDevelopers.Shared/Controls/Loadings/RingLoading.cs
+++ b/src/WPFDevelopers.Shared/Controls/Loadings/RingLoading.cs
@@ -3,10 +3,10 @@
namespace WPFDevelopers.Controls
{
- public class RingLoading : Control
+ public class RingLoading : LoadingBase
{
- public static readonly DependencyProperty IsStartProperty =
- DependencyProperty.Register("IsStart", typeof(bool), typeof(RingLoading), new PropertyMetadata(default));
+ //public static readonly DependencyProperty IsStartProperty =
+ // DependencyProperty.Register("IsStart", typeof(bool), typeof(RingLoading), new PropertyMetadata(default));
public static readonly DependencyProperty ProgressValueProperty =
DependencyProperty.Register("ProgressValue", typeof(double), typeof(RingLoading),
@@ -29,11 +29,11 @@ static RingLoading()
new FrameworkPropertyMetadata(typeof(RingLoading)));
}
- public bool IsStart
- {
- get => (bool)GetValue(IsStartProperty);
- set => SetValue(IsStartProperty, value);
- }
+ //public bool IsStart
+ //{
+ // get => (bool)GetValue(IsStartProperty);
+ // set => SetValue(IsStartProperty, value);
+ //}
public double ProgressValue
@@ -66,10 +66,8 @@ private static void OnProgressValueChangedCallBack(DependencyObject d, Dependenc
{
if (!(d is RingLoading control))
return;
-
if (!double.TryParse(e.NewValue?.ToString(), out var value))
return;
-
var progress = value / control.Maximum;
control.SetCurrentValue(ProgressProperty, progress.ToString("P0"));
}
@@ -78,13 +76,10 @@ private static void OnMaximumPropertyChangedCallBack(DependencyObject d, Depende
{
if (!(d is RingLoading control))
return;
-
if (!double.TryParse(e.NewValue?.ToString(), out var maxValue))
return;
-
if (maxValue <= 0)
return;
-
var progress = control.ProgressValue / maxValue;
control.SetCurrentValue(ProgressProperty, progress.ToString("P0"));
}
diff --git a/src/WPFDevelopers.Shared/Controls/Loadings/RollLoading.cs b/src/WPFDevelopers.Shared/Controls/Loadings/RollLoading.cs
index c6a9ba3a..a7c7aa8c 100644
--- a/src/WPFDevelopers.Shared/Controls/Loadings/RollLoading.cs
+++ b/src/WPFDevelopers.Shared/Controls/Loadings/RollLoading.cs
@@ -4,35 +4,24 @@
namespace WPFDevelopers.Controls
{
- public class RollLoading : ContentControl
+ public class RollLoading : LoadingBase
{
public static readonly DependencyProperty ForegroundColorProperty =
DependencyProperty.Register("ForegroundColor", typeof(Color), typeof(RollLoading),
new PropertyMetadata(Colors.Red));
- public static readonly DependencyProperty IsStartProperty =
- DependencyProperty.Register("IsStart", typeof(bool), typeof(RollLoading), new PropertyMetadata(true));
-
static RollLoading()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(RollLoading),
new FrameworkPropertyMetadata(typeof(RollLoading)));
}
-
public Color ForegroundColor
{
get => (Color)GetValue(ForegroundColorProperty);
set => SetValue(ForegroundColorProperty, value);
}
-
-
- public bool IsStart
- {
- get => (bool)GetValue(IsStartProperty);
- set => SetValue(IsStartProperty, value);
- }
-
+
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
diff --git a/src/WPFDevelopers.Shared/Controls/Loadings/WaitLoading.cs b/src/WPFDevelopers.Shared/Controls/Loadings/WaitLoading.cs
index 728ce395..883b9416 100644
--- a/src/WPFDevelopers.Shared/Controls/Loadings/WaitLoading.cs
+++ b/src/WPFDevelopers.Shared/Controls/Loadings/WaitLoading.cs
@@ -3,7 +3,7 @@
namespace WPFDevelopers.Controls
{
- public class WaitLoading : Control
+ public class WaitLoading : LoadingBase
{
static WaitLoading()
{
diff --git a/src/WPFDevelopers.Shared/Controls/Message/Message.cs b/src/WPFDevelopers.Shared/Controls/Message/Message.cs
index 2cb96ef1..7852c295 100644
--- a/src/WPFDevelopers.Shared/Controls/Message/Message.cs
+++ b/src/WPFDevelopers.Shared/Controls/Message/Message.cs
@@ -1,5 +1,4 @@
using System;
-using System.Linq;
using System.Windows;
using WPFDevelopers.Helpers;
diff --git a/src/WPFDevelopers.Shared/Controls/Message/MessageListBoxItem.cs b/src/WPFDevelopers.Shared/Controls/Message/MessageListBoxItem.cs
index 2f1f8ff6..6954e033 100644
--- a/src/WPFDevelopers.Shared/Controls/Message/MessageListBoxItem.cs
+++ b/src/WPFDevelopers.Shared/Controls/Message/MessageListBoxItem.cs
@@ -22,6 +22,5 @@ public bool IsCenter
public static readonly DependencyProperty IsCenterProperty =
DependencyProperty.Register("IsCenter", typeof(bool), typeof(MessageListBoxItem), new PropertyMetadata(false));
-
}
}
diff --git a/src/WPFDevelopers.Shared/Controls/MessageBox/MessageBox.cs b/src/WPFDevelopers.Shared/Controls/MessageBox/MessageBox.cs
index 64354120..d4ca3779 100644
--- a/src/WPFDevelopers.Shared/Controls/MessageBox/MessageBox.cs
+++ b/src/WPFDevelopers.Shared/Controls/MessageBox/MessageBox.cs
@@ -1,39 +1,38 @@
-using System.Linq;
-using System.Windows;
+using System.Windows;
using WPFDevelopers.Helpers;
namespace WPFDevelopers.Controls
{
public static class MessageBox
{
- public static MessageBoxResult Show(string messageBoxText,Window owner = null)
+ public static MessageBoxResult Show(string messageBoxText, Window owner = null, double buttonRadius = 0d)
{
- var msg = new WDMessageBox(messageBoxText);
+ var msg = new WDMessageBox(messageBoxText, buttonRadius);
return GetWindow(msg, owner);
}
- public static MessageBoxResult Show(string messageBoxText, string caption, Window owner = null)
+ public static MessageBoxResult Show(string messageBoxText, string caption, Window owner = null, double buttonRadius = 0d)
{
- var msg = new WDMessageBox(messageBoxText, caption);
+ var msg = new WDMessageBox(messageBoxText, caption, buttonRadius);
return GetWindow(msg, owner);
}
- public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button, Window owner = null)
+ public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button, Window owner = null, double buttonRadius = 0d)
{
- var msg = new WDMessageBox(messageBoxText, caption, button);
+ var msg = new WDMessageBox(messageBoxText, caption, button, buttonRadius);
return GetWindow(msg, owner);
}
- public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxImage icon, Window owner = null)
+ public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxImage icon, Window owner = null, double buttonRadius = 0d)
{
- var msg = new WDMessageBox(messageBoxText, caption, icon);
+ var msg = new WDMessageBox(messageBoxText, caption, icon, buttonRadius);
return GetWindow(msg, owner);
}
public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button,
- MessageBoxImage icon, Window owner = null)
+ MessageBoxImage icon, Window owner = null, double buttonRadius = 0d)
{
- var msg = new WDMessageBox(messageBoxText, caption, button, icon);
+ var msg = new WDMessageBox(messageBoxText, caption, button, icon, buttonRadius);
return GetWindow(msg, owner);
}
@@ -49,7 +48,7 @@ private static MessageBoxResult GetWindow(WDMessageBox msg, Window owner = null)
else
{
var win = ControlsHelper.GetDefaultWindow();
- if (win != null)
+ if (win != null && win != msg)
{
if (win.WindowState == WindowState.Minimized)
msg.BorderThickness = new Thickness(1);
diff --git a/src/WPFDevelopers.Shared/Controls/MessageBox/WDMessageBox.cs b/src/WPFDevelopers.Shared/Controls/MessageBox/WDMessageBox.cs
index eaa52f7f..fe03db52 100644
--- a/src/WPFDevelopers.Shared/Controls/MessageBox/WDMessageBox.cs
+++ b/src/WPFDevelopers.Shared/Controls/MessageBox/WDMessageBox.cs
@@ -49,40 +49,55 @@ internal sealed class WDMessageBox : Window
private TextBlock _title;
+ public CornerRadius ButtonCornerRadius
+ {
+ get { return (CornerRadius)GetValue(ButtonRadiusProperty); }
+ set { SetValue(ButtonRadiusProperty, value); }
+ }
+
+ public static readonly DependencyProperty ButtonRadiusProperty =
+ DependencyProperty.Register("ButtonCornerRadius", typeof(CornerRadius), typeof(WDMessageBox), new PropertyMetadata(null));
+
+
static WDMessageBox()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(WDMessageBox),
new FrameworkPropertyMetadata(typeof(WDMessageBox)));
}
- public WDMessageBox(string message)
+ public WDMessageBox(string message, double buttonRadius = 0d)
{
_messageString = message;
+ ButtonCornerRadius = new CornerRadius(buttonRadius);
}
- public WDMessageBox(string message, string caption)
+ public WDMessageBox(string message, string caption, double buttonRadius = 0d)
{
_titleString = caption;
_messageString = message;
+ ButtonCornerRadius = new CornerRadius(buttonRadius);
}
- public WDMessageBox(string message, string caption, MessageBoxButton button)
+ public WDMessageBox(string message, string caption, MessageBoxButton button, double buttonRadius = 0d)
{
_titleString = caption;
_messageString = message;
+ ButtonCornerRadius = new CornerRadius(buttonRadius);
}
- public WDMessageBox(string message, string caption, MessageBoxImage image)
+ public WDMessageBox(string message, string caption, MessageBoxImage image, double buttonRadius = 0d)
{
_titleString = caption;
_messageString = message;
+ ButtonCornerRadius = new CornerRadius(buttonRadius);
DisplayImage(image);
}
- public WDMessageBox(string message, string caption, MessageBoxButton button, MessageBoxImage image)
+ public WDMessageBox(string message, string caption, MessageBoxButton button, MessageBoxImage image, double buttonRadius = 0d)
{
_titleString = caption;
_messageString = message;
+ ButtonCornerRadius = new CornerRadius(buttonRadius);
DisplayImage(image);
DisplayButtons(button);
}
@@ -200,17 +215,25 @@ private void DisplayButtons(MessageBoxButton button)
case MessageBoxButton.OKCancel:
_cancelVisibility = Visibility.Visible;
_okVisibility = Visibility.Visible;
+ _yesVisibility = Visibility.Collapsed;
+ _noVisibility = Visibility.Collapsed;
break;
case MessageBoxButton.YesNo:
+ _okVisibility = Visibility.Collapsed;
+ _cancelVisibility = Visibility.Collapsed;
_yesVisibility = Visibility.Visible;
_noVisibility = Visibility.Visible;
break;
case MessageBoxButton.YesNoCancel:
+ _okVisibility = Visibility.Collapsed;
_yesVisibility = Visibility.Visible;
_noVisibility = Visibility.Visible;
_cancelVisibility = Visibility.Visible;
break;
default:
+ _cancelVisibility = Visibility.Collapsed;
+ _yesVisibility = Visibility.Collapsed;
+ _noVisibility = Visibility.Collapsed;
_okVisibility = Visibility.Visible;
break;
}
@@ -243,4 +266,4 @@ private void DisplayImage(MessageBoxImage image)
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/WPFDevelopers.Shared/Controls/MultiSelectComboBox/MultiSelectComboBox.cs b/src/WPFDevelopers.Shared/Controls/MultiSelectComboBox/MultiSelectComboBox.cs
index 140efa63..f9894a04 100644
--- a/src/WPFDevelopers.Shared/Controls/MultiSelectComboBox/MultiSelectComboBox.cs
+++ b/src/WPFDevelopers.Shared/Controls/MultiSelectComboBox/MultiSelectComboBox.cs
@@ -24,7 +24,7 @@ public static readonly DependencyProperty MaxDropDownHeightProperty
public static readonly DependencyProperty SelectAllContentProperty =
DependencyProperty.Register("SelectAllContent", typeof(object), typeof(MultiSelectComboBox),
- new PropertyMetadata("全选"));
+ new PropertyMetadata(LanguageManager.Instance["SelectAll"]));
public static readonly DependencyProperty IsSelectAllActiveProperty =
DependencyProperty.Register("IsSelectAllActive", typeof(bool), typeof(MultiSelectComboBox),
@@ -48,7 +48,6 @@ public bool IsDropDownOpen
set => SetValue(IsDropDownOpenProperty, value);
}
-
[Bindable(true)]
[Category("Layout")]
[TypeConverter(typeof(LengthConverter))]
@@ -58,28 +57,24 @@ public double MaxDropDownHeight
set => SetValue(MaxDropDownHeightProperty, value);
}
-
public object SelectAllContent
{
get => GetValue(SelectAllContentProperty);
set => SetValue(SelectAllContentProperty, value);
}
-
public bool IsSelectAllActive
{
get => (bool) GetValue(IsSelectAllActiveProperty);
set => SetValue(IsSelectAllActiveProperty, value);
}
-
public string Delimiter
{
get => (string) GetValue(DelimiterProperty);
set => SetValue(DelimiterProperty, value);
}
-
public string Text
{
get => (string) GetValue(TextProperty);
@@ -99,7 +94,6 @@ private static void OnTextChanged(DependencyObject d, DependencyPropertyChangedE
{
}
-
protected override bool IsItemItsOwnContainerOverride(object item)
{
return item is MultiSelectComboBoxItem;
@@ -115,18 +109,22 @@ protected override void OnSelectionChanged(SelectionChangedEventArgs e)
UpdateText();
base.OnSelectionChanged(e);
}
-
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
-
+ LanguageManager.Instance.PropertyChanged += Instance_PropertyChanged;
_popup = GetTemplateChild(PART_Popup) as Popup;
_multiSelectComboBoxItem = GetTemplateChild(PART_CheckBoxAll) as MultiSelectComboBoxItem;
- _multiSelectComboBoxItem.Selected += _MultiSelectComboBoxItem_Selected;
- _multiSelectComboBoxItem.Unselected += _MultiSelectComboBoxItem_Unselected;
+ _multiSelectComboBoxItem.Selected += OnMultiSelectComboBoxItem_Selected;
+ _multiSelectComboBoxItem.Unselected += OnMultiSelectComboBoxItem_Unselected;
+ }
+
+ private void Instance_PropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ SelectAllContent = LanguageManager.Instance["SelectAll"];
}
- private void _MultiSelectComboBoxItem_Unselected(object sender, RoutedEventArgs e)
+ private void OnMultiSelectComboBoxItem_Unselected(object sender, RoutedEventArgs e)
{
if (_ignoreTextValueChanged) return;
_ignoreTextValueChanged = true;
@@ -135,7 +133,7 @@ private void _MultiSelectComboBoxItem_Unselected(object sender, RoutedEventArgs
UpdateText();
}
- private void _MultiSelectComboBoxItem_Selected(object sender, RoutedEventArgs e)
+ private void OnMultiSelectComboBoxItem_Selected(object sender, RoutedEventArgs e)
{
if (_ignoreTextValueChanged) return;
_ignoreTextValueChanged = true;
diff --git a/src/WPFDevelopers.Shared/Controls/MultiSelectionSearchComboBox/MultiSelectListBox.cs b/src/WPFDevelopers.Shared/Controls/MultiSelectionSearchComboBox/MultiSelectListBox.cs
index 93c0cc62..04fb6691 100644
--- a/src/WPFDevelopers.Shared/Controls/MultiSelectionSearchComboBox/MultiSelectListBox.cs
+++ b/src/WPFDevelopers.Shared/Controls/MultiSelectionSearchComboBox/MultiSelectListBox.cs
@@ -14,6 +14,5 @@ protected override DependencyObject GetContainerForItemOverride()
{
return new MultiSelectComboBoxItem();
}
-
}
}
diff --git a/src/WPFDevelopers.Shared/Controls/MultiSelectionSearchComboBox/MultiSelectSearchComboBox.cs b/src/WPFDevelopers.Shared/Controls/MultiSelectionSearchComboBox/MultiSelectSearchComboBox.cs
index c4991883..6fd5046e 100644
--- a/src/WPFDevelopers.Shared/Controls/MultiSelectionSearchComboBox/MultiSelectSearchComboBox.cs
+++ b/src/WPFDevelopers.Shared/Controls/MultiSelectionSearchComboBox/MultiSelectSearchComboBox.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows;
@@ -58,7 +59,7 @@ public class MultiSelectionSearchComboBox : Control
public static readonly DependencyProperty SelectAllContentProperty =
DependencyProperty.Register("SelectAllContent", typeof(object), typeof(MultiSelectionSearchComboBox),
- new PropertyMetadata("全选"));
+ new PropertyMetadata(LanguageManager.Instance["SelectAll"]));
public static readonly DependencyProperty IsSelectAllActiveProperty =
DependencyProperty.Register("IsSelectAllActive", typeof(bool), typeof(MultiSelectionSearchComboBox),
@@ -190,56 +191,61 @@ public event RoutedEventHandler Closed
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
+ LanguageManager.Instance.PropertyChanged += Instance_PropertyChanged;
selectedList = new List