自定义散点视图控件形状 [英] Custom scatterview control shape

查看:83
本文介绍了自定义散点视图控件形状的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以创建自定义散点图形状?我的应用程序在右上角有一个徽标,客户端不希望被任何散点图项目遮挡。如果无法使用自定义形状,是否有人有解决方法?

Is it possible to create a custom scatterview shape? My application has a logo in the top right corner which the client does not want to be obscured by any scatterview item's. If a custom shape is not possible, does anyone have a workaround?

谢谢,

Chris

推荐答案

您好

   只需使用下面的poligon创建用户控件

    just create your user control with the poligon inside like the one below

<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="http://schemas.microsoft.com/surface/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="SurfaceBluetoothV2.Controls.Polygon" x:Name="UserControl" d:DesignWidth="640" d:DesignHeight="480" MinHeight="300" MinWidth="300"> <Grid>

<路径x:名称="路径"伸展= QUOT;填写" StrokeLineJoin = QUOT;圆形"行程="#FF000000"
数据="F1 M 18.4961,238.647C 21.6102,239.937 25.3401,238.964 28.4961,240.147C 29.194,240.409 29.8999,240.7 30.4961,241.147C 31.2504,241.713 31.6966,242.648 32.4961,243.147C 36.0323,245.357 41.0916,244.111 44.9961,242.647C 50.0215,240.763 54.2893,236.949 59.4961,235.647C 62.6356,234.862 67.5489,234.753 68.9961,237.647C 71.6959,243.047 71.2649,251.378 66.9961,255.647C 61.2178,261.426 51.1679,260.647 42.9961,260.647C 40.888,260.647 38.8818,261.704 36.9961,262.647C 34.8774,263.707 32.3279,264.929 31.4961,267.147C 31.2621,267.771 31.2621,268.523 31.4961,269.147C 31.7887,269.927 32.3634,270.605 32.9961,271.147C 34.5356,272.467 37.0976,271.435 38.9961,272.147C 39.7764,272.44 40.2895,273.206 40.9961,273.647C 41.6282,274.042 42.2685,274.486 42.9961,274.647C 53.7539,277.038 65.5415,273.162 75.9961,276.647C 80.4906,278.145 82.5017,284.149 86.9961,285.647C 90.3203,286.755 93.9922,286.147 97.4961,286.147C 98.4961,286.147 99.5011,286.247 100.496,286.147C 101.18,286.079 101.865,285.377 102 .496,285.647C 103.262,285.975 103.996,286.814 103.996,287.647C 103.996,290.016 100.171,290.472 98.4961,292.147C 97.9691,292.674 97.2193,293.455 97.4961,294.147C 97.7513,294.785 98.8142,294.562 99.4961,294.647C 105.624,295.413 112.094,295.463 117.996 ,293.647C 120.989,292.726 123.573,290.771 126.496,289.647C 129.028,288.673 131.897,288.927 134.496,288.147C 144.176,285.243 154.191,283.598 163.996,281.147C 167.99,280.149 171.503,277.646 175.496,276.647C 179.538,275.637 183.862,277.164 187.996 ,276.647C 193.451,275.965 198.499,272.647 203.996,272.647C 205.996,272.647 208.332,271.538 209.996,272.647C 211.799,273.849 210.964,277.115 212.496,278.647C 213.023,279.174 213.829,279.314 214.496,279.647C 215.163,279.981 215.769,280.486 216.496 ,280.647C 223.347,282.17 230.774,281.164 237.496,279.147C 241.949,277.811 247.128,273.069 250.996,275.647C 252.683,276.772 252.903,279.834 251.996,281.647C 250.888,283.863 247.455,283.84 244.996,284.147C 241.024,284.644 236.199,282.245 232.996 ,284.647C 229.413,2 87.334 226.445,290.777 223.496,294.147C 222.875,294.857 222.062,295.393 221.496,296.147C 221.049,296.743 221.023,297.62 220.496,298.147C 218.911,299.733 215.287,301.02 215.996,303.147C 216.699,305.257 220.273,304.647 222.496,304.647C 226.996, 304.647 231.496,304.647 235.996,304.647C 241.329,304.647 246.663,304.647 251.996,304.647C 255.329,304.647 258.875,303.477 261.996,304.647C 264.612,305.628 267.224,306.801 269.996,307.147C 276.335,307.94 285.283,304.449 288.996,309.647C 290.62, 311.921 287.746,315.148 286.496,317.647C 284.627,321.386 286.51,326.092 285.496,330.147C 284.969,332.255 285.266,334.491 284.996,336.647C 284.747,338.639 283.077,341.228 284.496,342.647C 285.915,344.066 288.549,342.66 290.496,343.147C 293.922, 344.004 297.189,345.407 300.496,346.647C 302.395,347.359 304.913,346.381 306.496,347.647C 307.033,348.077 306.911,348.965 306.996,349.647C 307.079,350.309 306.762,351.023 306.996,351.647C 308.072,354.516 309.252,357.347 310.496,360.147C 312.766, 365.256 313.256,372.184 317 .996,375.147C 320.826,376.916 324.871,375.819 327.996,374.647C 330.874,373.568 334.329,371.647 334.996,368.647C 336.316,362.709 333.471,356.548 331.996,350.647C 329.389,340.219 327.996,329.397 327.996,318.647C 327.996,313.636 325.989,307.656 328.996 ,303.647C 330.765,301.288 333.524,299.839 335.496,297.647C 338.965,293.793 342.05,289.315 346.496,286.647C 352.314,283.157 359.141,281.312 364.496,277.147C 369.333,273.385 374.755,269.629 377.496,264.147C 377.803,263.533 377.911,262.829 377.996 ,262.147C 378.079,261.486 377.762,260.771 377.996,260.147C 380.404,253.726 383.666,247.642 386.996,241.647C 389.69,236.798 393.056,232.352 395.996,227.647C 397.539,225.179 399.611,221.569 397.996,219.147C 396.446,216.823 392.365,218.128 389.996 ,216.647C 385.199,213.649 379.982,209.944 377.996,204.647C 376.878,201.666 378.081,198.197 378.996,195.147C 379.879,192.204 380.024,189.063 380.996,186.147C 382.113,182.797 386.702,178.905 384.496,176.147C 384.067,175.611 383.178,175.732 382.496 ,175.647C 381.835, 175.565 381.163,175.647 380.496,175.647C 378.388,175.647 376.097,175.019 374.496,173.647C 371.815,171.349 370.996,167.179 370.996,163.647C 370.996,161.647 372.105,159.311 370.996,157.647C 369.505,155.411 365.684,156.647 362.996,156.647C 358.982, 156.647 354.89,156.674 350.996,157.647C 350.273,157.828 349.694,158.386 348.996,158.647C 348.353,158.889 347.611,159.455 346.996,159.147C 346.042,158.67 345.392,157.638 344.996,156.647C 343.325,152.469 344.996,147.647 344.996,143.147C 344.996, 137.362 344.944,130.714 348.496,126.147C 350.894,123.065 353.031,119.689 355.996,117.147C 358.771,114.768 363.043,112.774 363.496,109.147C 363.848,106.331 360.151,104.494 357.996,102.647C 355.475,100.486 351.646,100.697 348.496,99.6472C 344.569, 98.3381 339.894,95.6886 338.996,91.6472C 337.257,83.8208 349.441,76.9252 347.496,69.1472C 346.592,65.5318 344.163,62.4806 342.496,59.1472C 342.189,58.5326 342.396,57.7065 341.996,57.1472C 341.512,56.4691 340.829,55.6472 339.996,55.6472C 339.163, 55.6472 338.538,56.514 5 337.996,57.1472C 337.511,57.7132 337.569,58.6701 336.996,59.1472C 335.497,60.3961 332.113,58.9979 331.496,57.1472C 330.388,53.8231 329.959,49.4985 331.996,46.6472C 333.314,44.8026 336.546,43.3465 335.996,41.1472C 334.616,35.6284 329.978, 31.4921 326.996,26.6472C 325.348,23.9691 323.883,21.163 321.996,18.6472C 321.549,18.051 321.329,17.3139 320.996,16.6472C 320.663,15.9806 320.616,15.0607 319.996,14.6472C 318.326,13.534 316.741,17.2838 315.996,19.1472C 313.892,24.4086 313.619, 33.4444 307.996,34.1472C 304.623,34.5689 301.369,32.5689 297.996,32.1472C 293.339,31.5651 287.56,33.7017 283.996,30.6472C 280.954,28.0396 279.383,23.1191 275.496,22.1472C 272.132,21.3061 268.834,25.2063 266.996,28.1472C 266.601,28.7793 266.481, 29.5813 265.996,30.1472C 265.454,30.78 264.821,31.7651 263.996,31.6472C 261.045,31.2256 262.477,25.3011 259.996,23.6472C 257.635,22.0729 254.312,24.4993 251.496,24.1472C 248.123,23.7256 244.448,20.4607 241.496,22.1472C 239.424,23.3312 239.014, 26.3178 238.496,28.6472C 238.026 ,30.7623 236.757,32.6185 235.996,34.6472C 234.791,37.8606 234.326,42.8149 230.996,43.6472C 228.081,44.376 225.299,41.0509 223.496,38.6472C 221.996,36.6472 219.874,34.9881 218.996,32.6472C 218.2,30.5247 217.147,27.8641 214.996,27.1472C 210.187 ,25.5443 204.742,26.4271 199.996,24.6472C 194.98,22.7664 188.787,20.7517 183.996,23.1472C 181.969,24.161 181.471,26.9261 179.996,28.6472C 178.369,30.5454 176.232,32.0292 173.996,33.1472C 169.224,35.5336 163.291,33.3091 157.996,32.6472C 151.51 ,31.8365 144.851,29.8955 139.496,26.1472C 135.443,23.3104 131.191,20.7691 126.996,18.1472C 124.252,16.4321 122.155,13.3492 118.996,12.6472C 116.23,12.0326 113.308,12.9987 110.496,12.6472C 109.814,12.562 109.183,12.1472 108.496,12.1472C 107.809 ,12.1472 106.982,12.1613 106.496,12.6472C 105.861,13.2819 105.78,14.2958 105.496,15.1472C 105.279,15.7992 105.237,16.5038 104.996,17.1472C 103.878,20.1287 101.656,24.5422 98.4961,24.1472C 93.6294,23.5389 88.9008,21.6472 83.9961,21.6472C 80.6628 ,21.6472 76.3532,24.0043 73.9 961,21.6472C 73.4691,21.1202 73.2578,20.3452 72.9961,19.6472C 72.7548,19.0038 72.6628,18.3139 72.4961,17.6472C 71.9691,15.5391 71.1396,11.79 68.9961,12.1472C 68.2609,12.2698 68.2989,13.4662 67.9961,14.1472C 67.6316,14.9674 67.3295,15.8139 66.9961,16.6472C 65.6831,19.9299 65.4961,23.6117 65.4961,27.1472C 65.4961,36.3381 67.6064,46.4267 63.4961,54.6472C 62.1218,57.396 58.9969,58.861 56.4961,60.6472C 52.5537,63.4633 50.6422,68.4569 46.9961,71.6472C 44.6901,73.665 40.8226,73.1532 38.4961,75.1472C 33.7987,79.1736 33.2752,86.4008 29.9961,91.6472C 25.7195,98.4899 18.9149,103.594 14.9961,110.647C 11.0103,117.822 6.01414,125.003 4.99614,133.147C 3.6731,143.732 7.58319,154.799 4.99614,165.147C 3.25374,172.117 3.49614,179.463 3.49614,186.647C 3.49614,192.481 3.49614,198.314 3.49614,204.147C 3.49614,206.814 2.1731,209.832 3.49614,212.147C 5.12704,215.001 7.34193,217.569 8.49614,220.647C 10.3281,225.533 12.3656,230.473 15.4961,234.647C 15.9434,235.244 16.0489,236.051 16.4961,236.647C 17.0618,237.40 1 17.6251,238.286 18.4961,238.647 Z"不透明度= QUOT; 0.6">
< Path.Fill>
< SolidColorBrush Color =" {DynamicResource Velvet}" />
< /Path.Fill>
< / Path>
<其他一些控件/>

<Path x:Name="Path" Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" Data="F1 M 18.4961,238.647C 21.6102,239.937 25.3401,238.964 28.4961,240.147C 29.194,240.409 29.8999,240.7 30.4961,241.147C 31.2504,241.713 31.6966,242.648 32.4961,243.147C 36.0323,245.357 41.0916,244.111 44.9961,242.647C 50.0215,240.763 54.2893,236.949 59.4961,235.647C 62.6356,234.862 67.5489,234.753 68.9961,237.647C 71.6959,243.047 71.2649,251.378 66.9961,255.647C 61.2178,261.426 51.1679,260.647 42.9961,260.647C 40.888,260.647 38.8818,261.704 36.9961,262.647C 34.8774,263.707 32.3279,264.929 31.4961,267.147C 31.2621,267.771 31.2621,268.523 31.4961,269.147C 31.7887,269.927 32.3634,270.605 32.9961,271.147C 34.5356,272.467 37.0976,271.435 38.9961,272.147C 39.7764,272.44 40.2895,273.206 40.9961,273.647C 41.6282,274.042 42.2685,274.486 42.9961,274.647C 53.7539,277.038 65.5415,273.162 75.9961,276.647C 80.4906,278.145 82.5017,284.149 86.9961,285.647C 90.3203,286.755 93.9922,286.147 97.4961,286.147C 98.4961,286.147 99.5011,286.247 100.496,286.147C 101.18,286.079 101.865,285.377 102.496,285.647C 103.262,285.975 103.996,286.814 103.996,287.647C 103.996,290.016 100.171,290.472 98.4961,292.147C 97.9691,292.674 97.2193,293.455 97.4961,294.147C 97.7513,294.785 98.8142,294.562 99.4961,294.647C 105.624,295.413 112.094,295.463 117.996,293.647C 120.989,292.726 123.573,290.771 126.496,289.647C 129.028,288.673 131.897,288.927 134.496,288.147C 144.176,285.243 154.191,283.598 163.996,281.147C 167.99,280.149 171.503,277.646 175.496,276.647C 179.538,275.637 183.862,277.164 187.996,276.647C 193.451,275.965 198.499,272.647 203.996,272.647C 205.996,272.647 208.332,271.538 209.996,272.647C 211.799,273.849 210.964,277.115 212.496,278.647C 213.023,279.174 213.829,279.314 214.496,279.647C 215.163,279.981 215.769,280.486 216.496,280.647C 223.347,282.17 230.774,281.164 237.496,279.147C 241.949,277.811 247.128,273.069 250.996,275.647C 252.683,276.772 252.903,279.834 251.996,281.647C 250.888,283.863 247.455,283.84 244.996,284.147C 241.024,284.644 236.199,282.245 232.996,284.647C 229.413,287.334 226.445,290.777 223.496,294.147C 222.875,294.857 222.062,295.393 221.496,296.147C 221.049,296.743 221.023,297.62 220.496,298.147C 218.911,299.733 215.287,301.02 215.996,303.147C 216.699,305.257 220.273,304.647 222.496,304.647C 226.996,304.647 231.496,304.647 235.996,304.647C 241.329,304.647 246.663,304.647 251.996,304.647C 255.329,304.647 258.875,303.477 261.996,304.647C 264.612,305.628 267.224,306.801 269.996,307.147C 276.335,307.94 285.283,304.449 288.996,309.647C 290.62,311.921 287.746,315.148 286.496,317.647C 284.627,321.386 286.51,326.092 285.496,330.147C 284.969,332.255 285.266,334.491 284.996,336.647C 284.747,338.639 283.077,341.228 284.496,342.647C 285.915,344.066 288.549,342.66 290.496,343.147C 293.922,344.004 297.189,345.407 300.496,346.647C 302.395,347.359 304.913,346.381 306.496,347.647C 307.033,348.077 306.911,348.965 306.996,349.647C 307.079,350.309 306.762,351.023 306.996,351.647C 308.072,354.516 309.252,357.347 310.496,360.147C 312.766,365.256 313.256,372.184 317.996,375.147C 320.826,376.916 324.871,375.819 327.996,374.647C 330.874,373.568 334.329,371.647 334.996,368.647C 336.316,362.709 333.471,356.548 331.996,350.647C 329.389,340.219 327.996,329.397 327.996,318.647C 327.996,313.636 325.989,307.656 328.996,303.647C 330.765,301.288 333.524,299.839 335.496,297.647C 338.965,293.793 342.05,289.315 346.496,286.647C 352.314,283.157 359.141,281.312 364.496,277.147C 369.333,273.385 374.755,269.629 377.496,264.147C 377.803,263.533 377.911,262.829 377.996,262.147C 378.079,261.486 377.762,260.771 377.996,260.147C 380.404,253.726 383.666,247.642 386.996,241.647C 389.69,236.798 393.056,232.352 395.996,227.647C 397.539,225.179 399.611,221.569 397.996,219.147C 396.446,216.823 392.365,218.128 389.996,216.647C 385.199,213.649 379.982,209.944 377.996,204.647C 376.878,201.666 378.081,198.197 378.996,195.147C 379.879,192.204 380.024,189.063 380.996,186.147C 382.113,182.797 386.702,178.905 384.496,176.147C 384.067,175.611 383.178,175.732 382.496,175.647C 381.835,175.565 381.163,175.647 380.496,175.647C 378.388,175.647 376.097,175.019 374.496,173.647C 371.815,171.349 370.996,167.179 370.996,163.647C 370.996,161.647 372.105,159.311 370.996,157.647C 369.505,155.411 365.684,156.647 362.996,156.647C 358.982,156.647 354.89,156.674 350.996,157.647C 350.273,157.828 349.694,158.386 348.996,158.647C 348.353,158.889 347.611,159.455 346.996,159.147C 346.042,158.67 345.392,157.638 344.996,156.647C 343.325,152.469 344.996,147.647 344.996,143.147C 344.996,137.362 344.944,130.714 348.496,126.147C 350.894,123.065 353.031,119.689 355.996,117.147C 358.771,114.768 363.043,112.774 363.496,109.147C 363.848,106.331 360.151,104.494 357.996,102.647C 355.475,100.486 351.646,100.697 348.496,99.6472C 344.569,98.3381 339.894,95.6886 338.996,91.6472C 337.257,83.8208 349.441,76.9252 347.496,69.1472C 346.592,65.5318 344.163,62.4806 342.496,59.1472C 342.189,58.5326 342.396,57.7065 341.996,57.1472C 341.512,56.4691 340.829,55.6472 339.996,55.6472C 339.163,55.6472 338.538,56.5145 337.996,57.1472C 337.511,57.7132 337.569,58.6701 336.996,59.1472C 335.497,60.3961 332.113,58.9979 331.496,57.1472C 330.388,53.8231 329.959,49.4985 331.996,46.6472C 333.314,44.8026 336.546,43.3465 335.996,41.1472C 334.616,35.6284 329.978,31.4921 326.996,26.6472C 325.348,23.9691 323.883,21.163 321.996,18.6472C 321.549,18.051 321.329,17.3139 320.996,16.6472C 320.663,15.9806 320.616,15.0607 319.996,14.6472C 318.326,13.534 316.741,17.2838 315.996,19.1472C 313.892,24.4086 313.619,33.4444 307.996,34.1472C 304.623,34.5689 301.369,32.5689 297.996,32.1472C 293.339,31.5651 287.56,33.7017 283.996,30.6472C 280.954,28.0396 279.383,23.1191 275.496,22.1472C 272.132,21.3061 268.834,25.2063 266.996,28.1472C 266.601,28.7793 266.481,29.5813 265.996,30.1472C 265.454,30.78 264.821,31.7651 263.996,31.6472C 261.045,31.2256 262.477,25.3011 259.996,23.6472C 257.635,22.0729 254.312,24.4993 251.496,24.1472C 248.123,23.7256 244.448,20.4607 241.496,22.1472C 239.424,23.3312 239.014,26.3178 238.496,28.6472C 238.026,30.7623 236.757,32.6185 235.996,34.6472C 234.791,37.8606 234.326,42.8149 230.996,43.6472C 228.081,44.376 225.299,41.0509 223.496,38.6472C 221.996,36.6472 219.874,34.9881 218.996,32.6472C 218.2,30.5247 217.147,27.8641 214.996,27.1472C 210.187,25.5443 204.742,26.4271 199.996,24.6472C 194.98,22.7664 188.787,20.7517 183.996,23.1472C 181.969,24.161 181.471,26.9261 179.996,28.6472C 178.369,30.5454 176.232,32.0292 173.996,33.1472C 169.224,35.5336 163.291,33.3091 157.996,32.6472C 151.51,31.8365 144.851,29.8955 139.496,26.1472C 135.443,23.3104 131.191,20.7691 126.996,18.1472C 124.252,16.4321 122.155,13.3492 118.996,12.6472C 116.23,12.0326 113.308,12.9987 110.496,12.6472C 109.814,12.562 109.183,12.1472 108.496,12.1472C 107.809,12.1472 106.982,12.1613 106.496,12.6472C 105.861,13.2819 105.78,14.2958 105.496,15.1472C 105.279,15.7992 105.237,16.5038 104.996,17.1472C 103.878,20.1287 101.656,24.5422 98.4961,24.1472C 93.6294,23.5389 88.9008,21.6472 83.9961,21.6472C 80.6628,21.6472 76.3532,24.0043 73.9961,21.6472C 73.4691,21.1202 73.2578,20.3452 72.9961,19.6472C 72.7548,19.0038 72.6628,18.3139 72.4961,17.6472C 71.9691,15.5391 71.1396,11.79 68.9961,12.1472C 68.2609,12.2698 68.2989,13.4662 67.9961,14.1472C 67.6316,14.9674 67.3295,15.8139 66.9961,16.6472C 65.6831,19.9299 65.4961,23.6117 65.4961,27.1472C 65.4961,36.3381 67.6064,46.4267 63.4961,54.6472C 62.1218,57.396 58.9969,58.861 56.4961,60.6472C 52.5537,63.4633 50.6422,68.4569 46.9961,71.6472C 44.6901,73.665 40.8226,73.1532 38.4961,75.1472C 33.7987,79.1736 33.2752,86.4008 29.9961,91.6472C 25.7195,98.4899 18.9149,103.594 14.9961,110.647C 11.0103,117.822 6.01414,125.003 4.99614,133.147C 3.6731,143.732 7.58319,154.799 4.99614,165.147C 3.25374,172.117 3.49614,179.463 3.49614,186.647C 3.49614,192.481 3.49614,198.314 3.49614,204.147C 3.49614,206.814 2.1731,209.832 3.49614,212.147C 5.12704,215.001 7.34193,217.569 8.49614,220.647C 10.3281,225.533 12.3656,230.473 15.4961,234.647C 15.9434,235.244 16.0489,236.051 16.4961,236.647C 17.0618,237.401 17.6251,238.286 18.4961,238.647 Z " Opacity="0.6"> <Path.Fill> <SolidColorBrush Color="{DynamicResource Velvet}"/> </Path.Fill> </Path> <some other controls />

< / Grid>
< / UserControl>

</Grid> </UserControl>

然后将您的控件添加为散点图项目的内容。

then add your control as content of a scatterview item.

需要更多努力的其他方法是创建自己的自定义  polygonalscatterviewitem ...

An other approach that would require more effort woud be to create your own custom  polygonalscatterviewitem...

hth


这篇关于自定义散点视图控件形状的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆