框架.NET6.0
编译器:vs Community2022
基于C#
大致框架
代码分享
纯文本按钮TextOnlyButton资源字典分享
Mainwindow.xm
带背景效果按钮设计BackDropButton资源字典分享
Mainwindow.xm
纯图标IconOnlyButton设计资源自带奶分享
Mainwindow.xm
M992.064 511.968c0 17.6-14.368 32-32 32H136.416l271.36 298.56c11.84 13.12 10.88 33.28-2.24 45.12a31.776 31.776 0 0 1-45.088-2.24l-320-352a31.488 31.488 0 0 1 0-42.88l320-352a31.904 31.904 0 1 1 47.328 42.88l-271.36 298.56h823.68c17.6 0 32 14.4 32 32z
以及图文按钮IconTextButton资源字典分享
Mainwindow.xm
M96 480c-9.6 0-19.2-3.2-25.6-12.8-12.8-12.8-9.6-35.2 3.2-44.8l377.6-310.4c35.2-25.6 86.4-25.6 118.4 0l377.6 307.2c12.8 9.6 16 32 3.2 44.8-12.8 12.8-32 16-44.8 3.2L531.2 166.4c-9.6-6.4-28.8-6.4-38.4 0L115.2 473.6c-6.4 6.4-12.8 6.4-19.2 6.4zM816 928H608c-19.2 0-32-12.8-32-32v-150.4c0-22.4-38.4-44.8-67.2-44.8-28.8 0-64 19.2-64 44.8V896c0 19.2-12.8 32-32 32H211.2C163.2 928 128 892.8 128 848V544c0-19.2 12.8-32 32-32s32 12.8 32 32v304c0 9.6 6.4 16 19.2 16H384v-118.4c0-64 67.2-108.8 128-108.8s131.2 44.8 131.2 108.8V864h176c9.6 0 16 0 16-19.2V544c0-19.2 12.8-32 32-32s32 12.8 32 32v304C896 896 864 928 816 928z
M513.704 1024C355.576 1024 224.2 895.776 224.2 737.664L224.2 286.336C224.2 128.224 355.576 0 513.704 0 671.816 0 800.04 128.224 800.04 286.336L800.04 737.664C800.04 895.776 671.816 1024 513.704 1024ZM736.04 286.336C736.04 163.744 636.296 64 513.704 64 391.096 64 288.2 163.744 288.2 286.336L288.2 737.664C288.2 860.256 391.096 960 513.704 960 636.296 960 736.04 860.256 736.04 737.664L736.04 286.336ZM512.456 416C494.776 416 480.456 401.664 480.456 384L480.456 224C480.456 206.32 494.776 192 512.456 192 530.136 192 544.456 206.32 544.456 224L544.456 384C544.456 401.664 530.136 416 512.456 416Z
M128 420.576v200.864h149.12l175.456 140.064V284.288l-169.792 136.288H128z m132.256-64l204.288-163.968a32 32 0 0 1 52.032 24.96v610.432a32 32 0 0 1-51.968 24.992l-209.92-167.552H96a32 32 0 0 1-32-32v-264.864a32 32 0 0 1 32-32h164.256zM670.784 720.128a32 32 0 0 1-44.832-45.664 214.08 214.08 0 0 0 64.32-153.312 213.92 213.92 0 0 0-55.776-144.448 32 32 0 1 1 47.36-43.04 277.92 277.92 0 0 1 72.416 187.488 278.08 278.08 0 0 1-83.488 198.976zM822.912 858.88a32 32 0 1 1-45.888-44.608A419.008 419.008 0 0 0 896 521.152c0-108.704-41.376-210.848-114.432-288.384a32 32 0 0 1 46.592-43.872c84.16 89.28 131.84 207.04 131.84 332.256 0 127.84-49.76 247.904-137.088 337.728z
M524.490551 1023.43355c-140.102939 0-271.81403-54.547017-370.878782-153.611769S0 639.045939 0 498.943c0-115.183242 36.995772-223.867918 106.944903-314.336142a523.825343 523.825343 0 0 1 119.276826-112.266563A533.035909 533.035909 0 0 1 376.55863 1.11192a25.584905 25.584905 0 0 1 30.036679 36.228225c-33.004527 64.320451-48.35547 125.621883-48.355471 193.012523 0 239.832899 195.110485 434.943383 434.943384 434.943383 67.39064 0 128.692072-15.350943 193.012523-48.35547a25.584905 25.584905 0 0 1 36.228225 30.036678 534.468663 534.468663 0 0 1-71.228375 150.336902 523.825343 523.825343 0 0 1-112.266563 119.276826 509.395457 509.395457 0 0 1-314.336142 106.944903zM336.18565 69.884144C163.538712 143.82452 51.16981 309.819383 51.16981 498.943 51.16981 759.90903 263.524521 972.26374 524.490551 972.26374c189.123617 0 355.11848-112.420072 429.058855-285.01584A451.98293 451.98293 0 0 1 793.132052 716.414691c-129.868977 0-251.908974-50.555772-343.707612-142.354411S307.018859 360.170475 307.018859 230.301498c0-55.109885 9.619924-108.019469 29.166791-160.417354z
带描述图文按钮设计WithDescIconTextButton设计资源字典分享
Mainwindow.xm
M600.2206314 984.7998978h99.43526823c0-76.59063766 29.83205337-149.82748912 84.44117799-204.43661374C837.53377636 726.93100402 908.20926016 697.01352262 983.32700093 695.75272291v-99.43379534C771.22985052 598.98487091 600.2206314 771.22985052 600.2206314 984.7998978z
M978.9083103 410.55422752v-99.43084953C610.68409082 316.44790021 314.96322016 616.57567833 314.96322016 984.7998978h99.43526822c0-78.06353453 15.17231074-152.78653895 45.09715661-223.53861335 28.9247489-68.38365626 70.35439227-129.81818503 123.13859769-182.60091755 52.78273251-52.78273251 114.25261083-94.20795722 182.63921286-123.13417899C832.9913624 426.88423523 905.2634664 411.7973525 978.9083103 410.55422752zM861.22532266 984.7998978H978.9083103v-127.11836504C912.62795078 862.76155409 861.22532266 917.04664143 861.22532266 984.7998978z
M41.66131287 984.7998978h99.43526824c0-114.88595647 22.39834283-225.47399987 66.57493886-329.91711747 42.6904431-100.93025856 103.82450092-191.5914801 181.70686916-269.4738483 77.8823682-77.8823682 168.30498045-139.01495313 269.235239-181.70392334C761.54113485 160.16764989 871.38683821 137.83264161 983.32700093 137.19193149V37.7272053c-519.9325979 2.67919942-941.66568806 425.66719773-941.66568806 947.0726925z
M823.00322 24.512277l-591.737042 0c-11.307533 0-20.466124 9.15859-20.466124 20.466124l0 934.043199c0 11.2973 9.15859 20.466124 20.466124 20.466124l591.737042 0c11.307533 0 20.466124-9.168824 20.466124-20.466124L843.469344 44.978401C843.469344 33.670867 834.310753 24.512277 823.00322 24.512277zM802.537096 773.96127l-480.135268 0c-11.307533 0-20.466124 9.168824-20.466124 20.466124 0 11.307533 9.15859 20.466124 20.466124 20.466124l480.135268 0 0 143.661957-550.804794 0L251.732301 65.444525l550.804794 0L802.537096 773.96127z
M527.134699 886.514719m-48.461735 0a47.358 47.358 0 1 0 96.92347 0 47.358 47.358 0 1 0-96.92347 0Z
windows设置主页按钮设计资源字典分享
0.5 0.5
Mainwindow.xm
M704 938.666667c0 10.666667-10.666667 21.333333-21.333333 21.333333H341.333333c-10.666667 0-21.333333-10.666667-21.333333-21.333333s8.533333-21.333333 21.333333-21.333334h341.333334c10.666667 0 21.333333 10.666667 21.333333 21.333334zM960 829.866667H64c-36.266667 0-64-27.733333-64-64v-640c0-36.266667 27.733333-64 64-64h896c36.266667 0 64 27.733333 64 64v640c0 34.133333-27.733333 64-64 64zM66.133333 104.533333c-12.8 0-21.333333 8.533333-21.333333 21.333334v640c0 12.8 8.533333 21.333333 21.333333 21.333333h896c12.8 0 21.333333-8.533333 21.333334-21.333333v-640c0-12.8-8.533333-21.333333-21.333334-21.333334h-896z
M256 85.333333h512c64.8 0 117.333333 52.533333 117.333333 117.333334v618.666666c0 64.8-52.533333 117.333333-117.333333 117.333334H256c-64.8 0-117.333333-52.533333-117.333333-117.333334V202.666667c0-64.8 52.533333-117.333333 117.333333-117.333334z m0 64a53.333333 53.333333 0 0 0-53.333333 53.333334v618.666666a53.333333 53.333333 0 0 0 53.333333 53.333334h512a53.333333 53.333333 0 0 0 53.333333-53.333334V202.666667a53.333333 53.333333 0 0 0-53.333333-53.333334H256z m170.666667 618.666667a32 32 0 0 1 0-64h170.666666a32 32 0 0 1 0 64H426.666667z
M342.2478125 213.89841269h-37.7953125c-45.345 0-69.316875 34.47375001-83.1403125 84.0628125l-84.7396875 415.4296875a22.9921875 22.9921875 0 0 0-0.1875 2.87062501c0 47.2509375 37.3059375 85.6415625 83.1609375 85.64156249h589.6846875c45.85875001 0 83.17874999-38.390625 83.17875-85.640625 0-0.94125001-0.08624999-1.925625-0.16312499-2.8715625l-78.42187501-415.4296875c-11.15625001-54.4903125-37.815-84.0628125-83.1365625-84.0628125h-83.836875m-384.1725 85.6171875c9.72-26.2696875 18.744375-43.003125 41.775-43.003125h426.234375c23.0109375 0 33.590625 15.9121875 41.0596875 42.98437501 0.24375001 0.9459375 0.5278125 1.378125 0.901875 2.91374999L830.5625 611.9140377H198.2384375m610.9921875 147.3703125H219.5459375c-22.5984375 0-41.0784375-18.58125001-41.750625-41.7121875l14.7646875-63.043125H836.215625l14.76562501 63.043125c-0.658125 23.1309375-19.1090625 41.7121875-41.75062501 41.7121875z
M613.175 726.6340377h25.880625c9.9271875 0 18.005625-8.289375 18.00562499-18.49875001 0-10.258125-8.0784375-18.5428125-18.00562499-18.5428125H613.175c-9.92624999 0-17.9615625 8.2903125-17.9615625 18.5428125 0 10.2140625 8.0353125 18.49875001 17.9625 18.49875001z m92.289375-8.52937501h13.93875c5.3325 0 9.68624999-4.47375001 9.68625-9.9646875 0-5.5003125-4.348125-10.0125-9.68625-10.0125h-13.93875c-5.3334375 0-9.6871875 4.5121875-9.6871875 10.0125 0 5.4909375 4.35 9.965625 9.6871875 9.965625z m-196.48875 8.52937501h25.8628125c9.9215625 0 17.9615625-8.289375 17.9615625-18.49875001 0-10.258125-8.04-18.5428125-17.9615625-18.5428125h-25.8628125c-9.945 0-17.985 8.2903125-17.985 18.5428125 0 10.2140625 8.04 18.49875001 17.985 18.49875001z m136.5984375-261.61875001c0 5.101875-4.0171875 9.249375-8.98125 9.24937501H430.53124999c-4.9640625 0-8.98125001-4.141875-8.98124999-9.24937501l6.335625-29.36624999c0-5.1075 4.018125-9.249375 8.98125-9.249375h193.3678125c5.00625001 0 9.0234375 4.141875 9.0234375 9.249375l6.316875 29.36624999z
M909.989 343.281c-21.76-51.446-52.904-97.643-92.568-137.307-39.663-39.664-85.86-70.808-137.306-92.568-53.28-22.536-109.858-33.962-168.164-33.962S397.067 90.87 343.787 113.406c-51.446 21.76-97.643 52.904-137.307 92.568-39.664 39.664-70.808 85.86-92.568 137.307-22.536 53.28-33.962 109.858-33.962 168.164s11.426 114.884 33.962 168.164c21.76 51.445 52.904 97.643 92.568 137.306 39.664 39.664 85.86 70.809 137.307 92.568 53.28 22.535 109.858 33.962 168.164 33.962s114.884-11.427 168.164-33.962c51.445-21.76 97.643-52.904 137.306-92.568 39.664-39.663 70.809-85.86 92.568-137.306 22.535-53.28 33.962-109.858 33.962-168.164s-11.427-114.884-33.962-168.164zM543.951 376.03c17.57-0.243 35.095-0.683 52.536-1.368a1990.762 1990.762 0 0 0 91.131-5.678c10.157 34.378 16.643 71.314 19.389 110.46H543.951V376.03z m0-64.069V163.41c17.617 12.176 39.372 29.845 61.074 54.197 23.42 26.28 43.109 56.138 58.784 89.019-41.937 3.147-82.117 4.783-119.858 5.335z m-64-144.763v144.705a2038.572 2038.572 0 0 1-103.41-4.309 1929.6 1929.6 0 0 1-11.183-0.786c15.195-31.915 34.175-60.991 56.676-86.711 20.284-23.185 40.722-40.49 57.917-52.899zM370.842 371.354a2124.301 2124.301 0 0 0 109.109 4.606v103.484H322.25c2.742-39.079 9.208-75.96 19.335-110.285 9.453 0.776 19.21 1.512 29.257 2.195z m-112.731 108.09H145.342c3.916-45.757 16.208-89.778 36.139-130.276 20.257 3.578 52.836 8.759 95.407 13.641-9.902 36.699-16.182 75.682-18.777 116.635z m-0.859 64c1.975 39.144 9.712 78.242 23.101 116.799-44.093 4.976-77.797 10.319-98.621 13.992-20.08-40.64-32.458-84.841-36.39-130.792h111.91z m64.098 0h158.601v104.048c-36.37 0.602-72.818 2.13-109.109 4.601-8.41 0.573-16.612 1.182-24.609 1.821-14.322-36.523-22.659-73.543-24.883-110.47z m158.601 168.103v131.712c-16.974-15.877-36.574-35.962-56.038-59.735-18.064-22.064-33.892-44.698-47.379-67.668a2038.38 2038.38 0 0 1 103.417-4.309z m64 136.665V711.487c34.387 0.503 70.782 1.903 108.68 4.527-13.467 22.915-29.263 45.496-47.286 67.509-21.547 26.32-43.262 48.119-61.394 64.689z m52.536-199.426a2063.187 2063.187 0 0 0-52.536-1.384V543.444h163.958c-2.227 36.975-10.582 74.045-24.939 110.615a1994.972 1994.972 0 0 0-86.483-5.273z m175.521-105.342H878.56c-3.928 45.898-16.283 90.051-36.322 130.652a1822.84 1822.84 0 0 0-93.476-13.439c13.478-38.691 21.264-77.929 23.246-117.213z m-0.859-64c-2.605-41.111-8.924-80.238-18.891-117.061a1821.491 1821.491 0 0 0 90.233-13.075c19.89 40.46 32.158 84.432 36.07 130.136H771.149z m1.017-228.215a373.188 373.188 0 0 1 34.046 39.155 1772.853 1772.853 0 0 1-75.117 9.98c-19.529-46.785-45.825-88.91-78.291-125.338a423.863 423.863 0 0 0-5.386-5.927c46.185 18.263 88.573 45.955 124.748 82.13zM384.81 165.9服务器托管网23a420.788 420.788 0 0 0-8.355 9.102c-32.552 36.525-58.904 78.775-78.449 125.71-32.357-3.484-59.48-7.244-80.226-10.469a373.386 373.386 0 0 1 33.956-39.037c38.338-38.338 83.654-67.152 133.074-85.306zM251.736 771.659a373.444 373.444 0 0 1-33.584-38.548c22.526-3.498 52.529-7.614 88.626-11.328 18.229 35.542 41.31 70.356 68.867 103.808a678.068 678.068 0 0 0 35.727 39.995c-59.757-16.875-114.524-48.814-159.636-93.927z m368.249 91.745a677.032 677.032 0 0 0 33.629-37.814c27.469-33.344 50.487-68.043 68.689-103.466a1780.315 1780.315 0 0 1 83.528 10.88 373.34 373.34 0 0 1-33.665 38.654c-43.23 43.232-95.324 74.373-152.181 91.746z
M882.5 77.6c-0.8-9-10.9-13.3-10.9-13.3s-10.7-1.6-19.3 3.2C837.6 75.7 816.2 86 714 210.7 642.9 297.5 555.1 413.9 504.2 480c-38.1 49.2-40.5 83.5-32.4 103 1.6 3.8 13.3 21.1 30.1 31.1 12.2 7.3 27.7 8.4 41.3 8.8 22 0.7 42.9-15 42.9-15s11.1-10.3 27.8-34C648.1 525.4 708.4 433 760.7 344 827 231.6 876.2 115 876.2 115s7.6-22.6 6.3-37.4zM461.9 658.1c-34.1-31.3-79.8-33.3-79.8-33.3s-44-4.6-73.4 15.7C260.1 674 259.2 742 258.8 752.1c-1.1 30.8 1.4 67.9-17.4 100.5-27.7 48-100.1 68-100.1 68s12.3 14.9 29.9 23.6c0.1 0.1 56 32 171.4 4.6 31.5-7.5 66.4-17.1 94.7-34.8 34.6-21.6 60.2-52.3 67.1-67.5 30-65 14.7-135.9-42.5-188.4z
M858.7 113.5H595.4c-34.6 0-62.7 28.1-62.7 62.7v263.3c0 34.6 28.1 62.7 62.7 62.7h263.3c34.6 0 62.7-26.9 62.7-59.9v-48c0-17.3-14-31.4-31.4-31.4-17.3 0-31.4 14-31.4 31.4V439.6H595.4V176.3h263.3V204.4c0 17.3 14 31.4 31.4 31.4 17.3 0 31.4-14 31.4-31.4v-31.7c0-32.6-28.2-59.2-62.8-59.2zM435 113.5H171.6c-34.6 0-62.7 28.1-62.7 62.7v263.3c0 34.6 28.1 62.7 62.7 62.7H435c34.6 0 62.7-28.1 62.7-62.7V176.3c0-34.6-28.1-62.8-62.7-62.8z m0 326.1H171.6V176.3H435v263.3zM431.8 533.9H168.5c-34.6 0-62.7 28.1-62.7 62.7V860c0 34.6 28.1 62.7 62.7 62.7h263.3c34.6 0 62.7-28.1 62.7-62.7V596.7c0.1-34.6-28.1-62.8-62.7-62.8z m0 326.1H168.5V596.7h263.3V860zM855.6 533.9H592.2c-34.6 0-62.7 28.1-62.7 62.7V860c0 34.6 28.1 62.7 62.7 62.7h263.3c34.6 0 62.7-28.1 62.7-服务器托管网62.7V596.7c0.1-34.6-28-62.8-62.6-62.8z m0 326.1H592.2V596.7h263.3V860z
M890.1 298.6m-31.4 0a31.4 31.4 0 1 0 62.8 0 31.4 31.4 0 1 0-62.8 0Z
M512 447.223c-88.224 0-160-71.776-160-160s71.776-160 160-160c88.225 0 160 71.776 160 160s-71.775 160-160 160z m0-256c-52.935 0-96 43.065-96 96s43.065 96 96 96 96-43.065 96-96-43.065-96-96-96zM454.901 870.594c-96.594 0-184.933-3.802-231.263-49.955C203.308 800.386 193 774.164 193 742.701c0-31.629 10.247-62.812 30.457-92.686 17.978-26.573 42.908-50.741 74.098-71.833C359.256 536.46 437.418 512.53 512 512.53c74.55 0 152.55 23.943 214.002 65.691 31.05 21.094 55.861 45.273 73.746 71.867C819.822 679.937 830 711.096 830 742.701c0 31.552-10.317 57.827-30.664 78.097-50.714 50.521-151.822 50.128-258.88 49.723a7395.45 7395.45 0 0 0-56.914-0.001c-9.605 0.037-19.163 0.074-28.641 0.074zM512 806.447c9.567 0 19.149 0.037 28.701 0.073 49.52 0.191 96.284 0.37 135.808-4.396 38.418-4.633 64.546-13.604 77.659-26.668 5.079-5.06 11.832-13.96 11.832-32.755 0-38.089-27.688-78.744-75.963-111.54C638.933 596.442 574.04 576.53 512 576.53c-126.309 0-255 83.862-255 166.171 0 18.675 6.738 27.547 11.807 32.596 32.045 31.922 128.975 31.55 214.491 31.224 9.556-0.037 19.139-0.074 28.702-0.074z
两个c#类IconButton.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace WpfApp3.Uicore.Controls
{
public class IconButton:Button
{
///
/// 图标数据
///
public Geometry IconData
{
get { return (Geometry)GetValue(IconDataProperty); }
set { SetValue(IconDataProperty, value); }
}
///
///
///
public static readonly DependencyProperty IconDataProperty =
DependencyProperty.Register(nameof(IconData), typeof(Geometry), typeof(IconButton), new PropertyMetadata(default(Geometry)));
}
}
和DescIconButton.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace WpfApp3.Uicore.Controls
{
///
/// 带描述文本的图标按钮
///
public class DescIconButton:IconButton
{
///
/// 按钮描述文本
///
public string Description
{
get { return (string)GetValue(DescriptionProperty); }
set { SetValue(DescriptionProperty, value); }
}
///
///
///
public static readonly DependencyProperty DescriptionProperty =
DependencyProperty.Register("Description", typeof(string), typeof(DescIconButton), new PropertyMetadata(default(string)));
}
}
app.xm
学习总结认识到了各类按钮设计,但是保持在浅层认识,协助英语翻译大致能了解并认识到Style,Setter,triggers的作用,在此学习期间有遇到过两次重大的困难
1.vs编译器出现error,找不到IconButton类,非人为,即编译器问题,多次重启后解决
2.描述文本无法自动过行,查找了chatgpt和百度知道,终于得到了答案,系width没有设置,而导致文本被遮挡没有自动过行(这里是高度)
以上为本人学习WPF一星期的成果。学习方式:网课,成果如下:
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.fwqtg.net
本文通过对市场上的大多数用户量比较大的手机APP是使用的调查,并对调查结果做出需求分析后,确定了基于安卓客户端的语音识别和语音合成的功能设计方案。实现了在手机端可以调用手机的客户端麦克风进行语音的录入和识别,同时也实现了文本信息朗读和合成的技术。本设计的框架为…