我们有一个相当大的Dashboard WPF应用程序,它使用ListView / Gridview解决方案来显示单元格中表示的大约400个项目。
每个单元格都有一个带有ContentTemplateSelector的ContentControl,它根据绑定数据对象上的属性更改模板。
早些时候我们使用这个正常的ListView虚拟化,但我的用户抱怨滚动体验相当差,我同意。
当我们通过启用som分组或手动停用虚拟化来停用虚拟化时,滚动变得像等效的Excel工作表一样流畅(我们正在构建要替换的应用程序)。但是我们在数据模板中的相互作用变得非常缓慢。这意味着当我们在模板中使用上下文菜单并且用户右键单击时,在上下文菜单出现之前需要2-3秒。相同单击模板中的超链接。在发生事情之前需要2-3秒。
你们有关于如何调试这个的提示吗?
附件是仪表板的图片:
单元格中项目最常用的数据窗口示例:
<Grid DataContext="{Binding DtoParent, ElementName=userControl}" d:DataContext="{Binding DtoParent,Source={StaticResource ucVm}}" >
<Grid.ContextMenu>
<ContextMenu>
<MenuItem Header="test"/>
</ContextMenu>
</Grid.ContextMenu>
<Grid DataContext="{Binding Objekt}">
<ScrollViewer ScrollChanged="dataTemplatePresentasjonKampanjeDetalj_ScrollViewer_ScrollChanged" PreviewMouseWheel="dataTemplatePresentasjonKampanjeDetalj_ScrollViewer_PreviewMouseWheel">
<Border BorderBrush="DarkGray" BorderThickness="1" Padding="2" CornerRadius="5" MouseMove="Border_MouseMove" PreviewMouseDown="Border_PreviewMouseDown" Tag="{Binding}">
<Grid>
<Grid.ContextMenu>
<ContextMenu>
<MenuItem Header="Kopier hele kampanjedetaljen" x:Name="miKampanjeDetaljCopy" Click="miKampanjeDetaljCopy_Click" Tag="{Binding}" />
<MenuItem Header="Lim inn varegruppe" x:Name="miLimInnVareGruppe" Click="miLimInnVareGruppe_Click" Tag="{Binding}">
<MenuItem.Style>
<Style TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}">
<Setter Property="IsEnabled" Value="True" />
<Style.Triggers>
<DataTrigger Binding="{Binding DtoVersjonKampanje.Låst}" Value="True">
<Setter Property="IsEnabled" Value="False" />
</DataTrigger>
</Style.Triggers>
</Style>
</MenuItem.Style>
</MenuItem>
</ContextMenu>
</Grid.ContextMenu>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.Style>
<Style TargetType="Grid">
<Style.Triggers>
<DataTrigger Binding="{Binding DtoVersjonKampanjeDetalj.ErEkaFerdig}" Value="True">
<Setter Property="Background" Value="LightGreen" />
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<StackPanel Orientation="Horizontal">
<Viewbox Width="16" Height="16" Visibility="{Binding DtoVersjonElement.KunNett, Converter={StaticResource booleanToVisibilityConverter}}" ToolTip="Gjelder kun for Nettapotek">
<Rectangle Width="16" Height="16">
<Rectangle.Fill>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
<GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M16,8C16,12.418 12.418,16 8,16 3.582,16 0,12.418 0,8 0,3.582 3.582,0 8,0 12.418,0 16,3.582 16,8" />
<GeometryDrawing Brush="#FFF06421" Geometry="F1M9.3838,13.5752C9.9298,12.4292 10.3508,11.3602 10.6218,10.3822 11.5158,10.2662 12.4668,10.0392 13.5078,9.6472 12.9298,11.5842 11.3578,13.0872 9.3838,13.5752 M2.4858,9.6252C3.2838,9.8692 4.1978,10.1032 5.2308,10.2692 5.4368,11.3162 5.7728,12.3862 6.2118,13.4632 4.4218,12.8772 3.0208,11.4382 2.4858,9.6252 M2.2498,8.0002C2.2498,7.1802 2.4238,6.4032 2.7328,5.6982 3.4178,5.8992 4.1808,6.0912 5.0318,6.2362 4.9898,6.6412 4.9598,7.0572 4.9548,7.4942 4.9488,8.0292 4.9888,8.5772 5.0538,9.1312 3.9778,8.9352 3.0478,8.6672 2.2708,8.4032 2.2608,8.2692 2.2498,8.1362 2.2498,8.0002 M5.9168,2.6452C5.6268,3.3682 5.3608,4.2002 5.1848,5.1532 4.4928,5.0332 3.8608,4.8802 3.2818,4.7182 3.9298,3.7882 4.8458,3.0622 5.9168,2.6452 M7.9998,2.2502C8.1648,2.2502 8.3268,2.2612 8.4878,2.2742 8.9558,3.0862 9.4318,4.1202 9.7088,5.3822 9.1378,5.4212 8.5758,5.4262 8.0058,5.4212 7.4058,5.4142 6.8248,5.3732 6.2668,5.3102 6.4998,4.0952 6.8848,3.0962 7.2678,2.3022 7.5078,2.2712 7.7508,2.2502 7.9998,2.2502 M8.0058,9.4212C7.3698,9.4142 6.7578,9.3672 6.1678,9.2982 6.0838,8.6882 6.0388,8.0892 6.0448,7.5052 6.0488,7.1192 6.0758,6.7502 6.1128,6.3902 6.7148,6.4592 7.3428,6.5042 7.9938,6.5112 8.1288,6.5122 8.2628,6.5132 8.3978,6.5132 8.8858,6.5132 9.3798,6.4972 9.8848,6.4592 9.9228,6.7982 9.9508,7.1442 9.9548,7.5062 9.9608,8.0832 9.8868,8.7082 9.7458,9.3752 9.1618,9.4162 8.5878,9.4242 8.0058,9.4212 M7.9998,13.7502C7.8298,13.7502 7.6618,13.7392 7.4958,13.7242 6.9928,12.6082 6.6088,11.5002 6.3678,10.4192 6.8918,10.4712 7.4348,10.5052 7.9938,10.5112 8.1288,10.5122 8.2628,10.5122 8.3978,10.5122 8.7448,10.5122 9.0968,10.5032 9.4508,10.4852 9.1458,11.4762 8.6928,12.5622 8.0988,13.7452 8.0658,13.7462 8.0328,13.7502 7.9998,13.7502 M12.7488,4.7602C12.0628,4.9962 11.4148,5.1602 10.7978,5.2562 10.5838,4.2242 10.2468,3.3372 9.8808,2.5712 11.0568,2.9782 12.0598,3.7512 12.7488,4.7602 M10.9688,6.3382C11.6948,6.2242 12.4628,6.0302 13.2848,5.7352 13.5838,6.4302 13.7498,7.1952 13.7498,8.0002 13.7498,8.1262 13.7388,8.2492 13.7318,8.3742 12.6938,8.8262 11.7598,9.0962 10.8838,9.2372 10.9938,8.6252 11.0508,8.0432 11.0448,7.4942 11.0408,7.0942 11.0098,6.7122 10.9688,6.3382 M14.9998,8.0002C14.9998,7.9202 14.9898,7.8432 14.9878,7.7632 14.8628,4.0082 11.7858,1.0002 7.9998,1.0002 4.1338,1.0002 0.9998,4.1342 0.9998,8.0002 0.9998,8.2042 1.0118,8.4052 1.0298,8.6042 1.0458,8.7832 1.0708,8.9602 1.1008,9.1362 1.1018,9.1412 1.1018,9.1472 1.1028,9.1532 1.5918,12.0962 3.9088,14.4112 6.8528,14.8982 6.8598,14.8992 6.8658,14.9002 6.8728,14.9012 7.0468,14.9302 7.2218,14.9542 7.3998,14.9702 7.5978,14.9882 7.7968,15.0002 7.9998,15.0002 8.2318,15.0002 8.4598,14.9872 8.6848,14.9662 12.2298,14.6212 14.9998,11.6352 14.9998,8.0002" />
<GeometryDrawing Brush="#FFEFEFF0" Geometry="F1M10.9687,6.3384C11.6957,6.2244 12.4627,6.0304 13.2847,5.7344 13.5837,6.4304 13.7497,7.1954 13.7497,8.0004 13.7497,8.1264 13.7397,8.2494 13.7317,8.3744 12.6937,8.8264 11.7597,9.0954 10.8837,9.2374 10.9937,8.6254 11.0507,8.0434 11.0447,7.4944 11.0407,7.0944 11.0097,6.7124 10.9687,6.3384" />
<GeometryDrawing Brush="#FFEFEFF0" Geometry="F1M12.749,4.7598C12.063,4.9958 11.415,5.1598 10.798,5.2558 10.584,4.2248 10.247,3.3368 9.881,2.5718 11.057,2.9788 12.06,3.7508 12.749,4.7598" />
<GeometryDrawing Brush="#FFEFEFF0" Geometry="F1M8,13.75C7.83,13.75 7.662,13.739 7.496,13.725 6.993,12.608 6.608,11.5 6.368,10.419 6.892,10.471 7.435,10.505 7.994,10.511 8.129,10.513 8.263,10.513 8.398,10.513 8.745,10.513 9.097,10.503 9.451,10.485 9.146,11.477 8.692,12.563 8.099,13.745 8.065,13.746 8.033,13.75 8,13.75" />
<GeometryDrawing Brush="#FFEFEFF0" Geometry="F1M8,9.4209C7.364,9.4139 6.69,9.3189 6.1,9.2499 6.016,8.6409 6.039,8.0889 6.045,7.5049 6.049,7.1189 6.076,6.7509 6.112,6.3909 6.715,6.4589 7.349,6.5039 8,6.5109 8.135,6.5119 8.265,6.5129 8.4,6.5129 8.888,6.5129 9.38,6.4979 9.885,6.4599 9.923,6.7979 9.951,7.1439 9.955,7.5059 9.961,8.0829 9.841,8.7079 9.7,9.3749 9.116,9.4159 8.582,9.4239 8,9.4209" />
<GeometryDrawing Brush="#FFEFEFF0" Geometry="F1M8,2.25C8.165,2.25 8.327,2.261 8.488,2.274 8.956,3.086 9.423,4.12 9.7,5.382 9.129,5.421 8.57,5.426 8,5.421 7.4,5.415 6.759,5.374 6.2,5.31 6.434,4.095 6.885,3.096 7.268,2.302 7.508,2.271 7.751,2.25 8,2.25" />
<GeometryDrawing Brush="#FFEFEFF0" Geometry="F1M5.917,2.645C5.627,3.368 5.361,4.2 5.185,5.153 4.493,5.033 3.86,4.88 3.282,4.718 3.93,3.788 4.846,3.062 5.917,2.645" />
<GeometryDrawing Brush="#FFEFEFF0" Geometry="F1M2.25,8C2.25,7.181 2.424,6.403 2.732,5.698 3.418,5.899 4.181,6.091 5.032,6.236 4.99,6.642 4.96,7.057 4.955,7.494 4.949,8.029 4.989,8.577 5.054,9.131 3.977,8.935 3.048,8.667 2.27,8.403 2.261,8.27 2.25,8.136 2.25,8" />
<GeometryDrawing Brush="#FFEFEFF0" Geometry="F1M2.4863,9.625C3.2843,9.869 4.1983,10.104 5.2303,10.27 5.4363,11.316 5.7723,12.386 6.2123,13.463 4.4223,12.877 3.0203,11.439 2.4863,9.625" />
<GeometryDrawing Brush="#FFEFEFF0" Geometry="F1M9.3838,13.5752C9.9298,12.4292 10.3508,11.3602 10.6218,10.3822 11.5158,10.2662 12.4668,10.0392 13.5078,9.6472 12.9298,11.5842 11.3578,13.0872 9.3838,13.5752" />
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
</Viewbox>
<Viewbox Width="16" Height="16" Visibility="{Binding DtoVersjonElement.AvvikendePeriode, Converter={StaticResource booleanToVisibilityConverter}}" ToolTip="Avvikende periode OK">
<Rectangle Width="16" Height="16">
<Rectangle.Fill>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
<GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M15,2L15,15 1,15 1,2 4,2 4,1 7,1 7,2 9,2 9,1 12,1 12,2z" />
<GeometryDrawing Brush="#FF424242" Geometry="F1M10.5957,11.9639L10.5957,11.2149 9.1267,11.2149 9.1267,11.2019 9.4867,10.9019C10.0507,10.3989 10.5247,9.8769 10.5247,9.2229 10.5247,8.5159 10.0387,7.9999 9.1577,7.9999 8.6297,7.9999 8.1737,8.1799 7.8797,8.4019L8.1377,9.0559C8.3417,8.8999 8.6357,8.7319 8.9707,8.7319 9.4207,8.7319 9.6137,8.9839 9.6137,9.3009 9.6017,9.7569 9.1877,10.1949 8.3357,10.9569L7.8317,11.4119 7.8317,11.9639z M5.9057,11.9639L6.7867,11.9639 6.7867,8.0659 6.0317,8.0659 4.9997,8.5459 5.1497,9.2299 5.8937,8.8759 5.9057,8.8759z M12.9997,6.9999L2.9997,6.9999 2.9997,12.9999 12.9997,12.9999z M13.9997,2.9999L13.9997,13.9999 1.9997,13.9999 1.9997,2.9999 3.9997,2.9999 3.9997,4.9999 6.9997,4.9999 6.9997,2.9999 8.9997,2.9999 8.9997,4.9999 11.9997,4.9999 11.9997,2.9999z M10.9997,1.9999L9.9997,1.9999 9.9997,3.9999 10.9997,3.9999z M5.9997,3.9999L4.9997,3.9999 4.9997,1.9999 5.9997,1.9999z" />
<GeometryDrawing Brush="#FFF0EFF1" Geometry="F1M10.5957,11.9639L7.8317,11.9639 7.8317,11.4119 8.3357,10.9569C9.1877,10.1949 9.6017,9.7569 9.6137,9.3009 9.6137,8.9839 9.4207,8.7319 8.9707,8.7319 8.6357,8.7319 8.3417,8.8999 8.1377,9.0559L7.8797,8.4019C8.1737,8.1799 8.6297,7.9999 9.1577,7.9999 10.0387,7.9999 10.5247,8.5159 10.5247,9.2229 10.5247,9.8769 10.0507,10.3989 9.4867,10.9019L9.1267,11.2019 9.1267,11.2149 10.5957,11.2149z M6.7867,11.9639L5.9057,11.9639 5.9057,8.8759 5.8937,8.8759 5.1497,9.2299 4.9997,8.5459 6.0317,8.0659 6.7867,8.0659z M2.9997,12.9999L12.9997,12.9999 12.9997,6.9999 2.9997,6.9999z M2.9997,6.9999" />
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
</Viewbox>
<Viewbox Width="16" Height="16" Visibility="{Binding AvvikendePeriodeValidertFeil, Converter={StaticResource booleanToVisibilityConverter}}" ToolTip="Avvikende periode mangler, eller er feil utfyllt">
<Rectangle Width="16" Height="16">
<Rectangle.Fill>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
<GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M0.9999,0.999700000000001L0.9999,6.9997 2.9999,6.9997 2.9999,14.9997 15.9999,14.9997 15.9999,0.999700000000001z" />
<GeometryDrawing Brush="#FF1AA1E2" Geometry="F1M3,3L9,3 9,5 3,5z M14,3L12,5 10,3z M2,6L4,6 5,6 14,6 15,6 15,2 2,2z" />
<GeometryDrawing Brush="#FFC17C1A" Geometry="F1M13,12L10,12 10,9 13,9z" />
<GeometryDrawing Brush="#FFEFEFF0" Geometry="F1M13,7L12,7 12,8 13,8z M13,9L10,9 10,12 13,12z M9,7L8,7 8,8 9,8z M9,9L8,9 8,10 9,10z M9,11L8,11 8,12 9,12z M7,9L6,9 6,10 7,10z M7,11L6,11 6,12 7,12z M10,8L11,8 11,7 10,7z M14,13L5,13 5,6 14,6z M14,3L10,3 12,5z M3,3L9,3 9,5 3,5z" />
<GeometryDrawing Brush="#FF424242" Geometry="F1M7,9L6,9 6,10 7,10z M7,11L6,11 6,12 7,12z M14,13L5,13 5,6 4,6 4,14 15,14 15,6 14,6z M11,7L10,7 10,8 11,8z M13,7L12,7 12,8 13,8z M9,11L8,11 8,12 9,12z M9,9L8,9 8,10 9,10z M9,8L8,8 8,7 9,7z" />
<GeometryDrawing Brush="#FFEFEFF0" Geometry="F1M14,3L10,3 12,5z" />
<GeometryDrawing Brush="#FFEFEFF0" Geometry="F1M9,3L3,3 3,5 9,5z" />
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
</Viewbox>
<Viewbox Width="16" Height="16" Visibility="{Binding DtoVersjonKampanjeDetalj.ErDirekteutsendelse, Converter={StaticResource booleanToVisibilityConverter}}" ToolTip="Varer skal direkteutsendes">
<Rectangle Width="16" Height="16">
<Rectangle.Fill>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
<GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M10.4346,14L4.4936,14C4.0296,14.617 3.2956,15 2.4996,15 1.1216,15 -0.000400000000000844,13.879 -0.000400000000000844,12.5 -0.000400000000000844,11.121 1.1216,10 2.4996,10 3.2956,10 4.0296,10.383 4.4936,11L10.4346,11 11.4346,10 10.4346,9 4.4936,9C4.0296,9.617 3.2956,10 2.4996,10 1.1216,10 -0.000400000000000844,8.878 -0.000400000000000844,7.5 -0.000400000000000844,6.122 1.1216,5 2.4996,5 3.2956,5 4.0296,5.383 4.4936,6L10.4346,6 11.4346,5 10.4346,4 4.4936,4C4.0296,4.617 3.2956,5 2.4996,5 1.1216,5 -0.000400000000000844,3.878 -0.000400000000000844,2.5 -0.000400000000000844,1.122 1.1216,0 2.4996,0 3.2956,0 4.0296,0.382999999999999 4.4936,1L10.4346,1 11.4346,0 13.5046,0 15.9996,2.495 15.9996,2.505 13.5046,5 15.9996,7.495 15.9996,7.505 13.5046,10 15.9996,12.495 15.9996,12.505 12.5046,16 12.4346,16z" />
<GeometryDrawing Brush="#FF424242" Geometry="F1M11.7627,11.0859L12.6767,11.9999 3.9087,11.9999C3.7017,11.4189 3.1517,10.9999 2.4997,10.9999 1.6717,10.9999 0.999700000000001,11.6719 0.999700000000001,12.4999 0.999700000000001,13.3279 1.6717,13.9999 2.4997,13.9999 3.1517,13.9999 3.7017,13.5809 3.9087,12.9999L12.6767,12.9999 11.7627,13.9139 12.4697,14.6209 14.5907,12.4999 12.4697,10.3789z M11.7627,6.0859L12.6767,6.9999 3.9087,6.9999C3.7017,6.4189 3.1517,5.9999 2.4997,5.9999 1.6717,5.9999 0.999700000000001,6.6719 0.999700000000001,7.4999 0.999700000000001,8.3279 1.6717,8.9999 2.4997,8.9999 3.1517,8.9999 3.7017,8.5809 3.9087,7.9999L12.6767,7.9999 11.7627,8.9139 12.4697,9.6209 14.5907,7.4999 12.4697,5.3789z M0.999700000000001,2.4999C0.999700000000001,1.6719 1.6717,0.999899999999998 2.4997,0.999899999999998 3.1517,0.999899999999998 3.7017,1.4189 3.9087,1.9999L12.6767,1.9999 11.7627,1.0859 12.4697,0.378899999999998 14.5907,2.4999 12.4697,4.6209 11.7627,3.9139 12.6767,2.9999 3.9087,2.9999C3.7017,3.5809 3.1517,3.9999 2.4997,3.9999 1.6717,3.9999 0.999700000000001,3.3279 0.999700000000001,2.4999" />
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
</Viewbox>
<Viewbox Width="16" Height="16" Visibility="{Binding HarKundeklubbTilbud, Converter={StaticResource booleanToVisibilityConverter}}" ToolTip="Inneholder kundeklubb tilbud">
<Rectangle Width="16" Height="16">
<Rectangle.Fill>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
<GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M16,15L8.656,15C7.763,15.629 6.676,16 5.5,16 4.324,16 3.237,15.629 2.344,15L0,15 0,1 16,1z" />
<GeometryDrawing Brush="#FF424242" Geometry="F1M15,2L15,14 9.743,14C9.996,13.693,10.212,13.357,10.395,13L14,13 14,5 2,5 2,6.258C1.619,6.573,1.284,6.94,1,7.344L1,2z" />
<GeometryDrawing Brush="#FFF0EFF1" Geometry="F1M4.1875,7.1006C3.4995,7.3686 2.9105,7.8346 2.4945,8.4326 2.8665,8.5376 3.2725,8.6346 3.7165,8.7126 3.8315,8.1006 4.0015,7.5656 4.1875,7.1006 M6.6255,8.8596C6.4465,8.0486 6.1415,7.3846 5.8395,6.8626 5.7365,6.8546 5.6335,6.8466 5.5265,6.8466 5.3675,6.8466 5.2095,6.8606 5.0565,6.8796 4.8105,7.3906 4.5625,8.0326 4.4125,8.8146 4.7715,8.8556 5.1455,8.8806 5.5305,8.8846 5.8965,8.8886 6.2585,8.8846 6.6255,8.8596 M8.5795,8.4596C8.1365,7.8116 7.4925,7.3146 6.7355,7.0536 6.9715,7.5456 7.1875,8.1166 7.3245,8.7786 7.7235,8.7166 8.1385,8.6116 8.5795,8.4596 M9.0395,11.5926C8.3745,11.8426 7.7685,11.9886 7.1985,12.0606 7.0245,12.6856 6.7575,13.3666 6.4095,14.0976 7.6675,13.7866 8.6695,12.8276 9.0395,11.5926 M4.3875,14.0256C4.1065,13.3376 3.8925,12.6576 3.7615,11.9906 3.1035,11.8846 2.5205,11.7346 2.0115,11.5786 2.3535,12.7356 3.2455,13.6526 4.3875,14.0256 M1.8745,10.8006C2.3705,10.9676 2.9625,11.1386 3.6475,11.2636 3.6065,10.9106 3.5815,10.5606 3.5855,10.2206 3.5885,9.9416 3.6075,9.6776 3.6345,9.4176 3.0925,9.3266 2.6045,9.2046 2.1685,9.0756 1.9725,9.5256 1.8605,10.0216 1.8605,10.5426 1.8605,10.6296 1.8675,10.7146 1.8745,10.8006 M6.6405,11.4136C6.7295,10.9876 6.7765,10.5826 6.7725,10.2146 6.7705,9.9856 6.7795,9.7456 6.7545,9.5296 6.4335,9.5526 4.6975,9.5306 4.3135,9.4876 4.2905,9.7156 4.2825,10.2106 4.2805,10.4556 4.2765,10.8286 4.3055,11.0966 4.3585,11.4856 4.7345,11.5286 5.1245,11.5016 5.5305,11.5066 5.9015,11.5086 6.2675,11.4386 6.6405,11.4136 M5.5895,14.2056C5.9685,13.4516 6.2575,12.7596 6.4515,12.1266 6.2265,12.1386 6.0015,12.1446 5.7795,12.1446 5.6945,12.1446 5.6085,12.1446 5.5225,12.1426 5.1665,12.1406 4.8195,12.1186 4.4865,12.0846 4.6395,12.7736 4.8855,13.4806 5.2055,14.1916 5.3125,14.2016 5.4185,14.2086 5.5265,14.2086 5.5485,14.2086 5.5675,14.2066 5.5895,14.2056 M7.4685,10.2206C7.4725,10.5706 7.4355,10.9416 7.3645,11.3316 7.9235,11.2426 8.5195,11.0696 9.1815,10.7816 9.1855,10.7026 9.1935,10.6226 9.1935,10.5426 9.1935,10.0296 9.0855,9.5416 8.8955,9.0996 8.3725,9.2876 7.8825,9.4116 7.4195,9.4846 7.4445,9.7226 7.4655,9.9646 7.4685,10.2206 M5.4995,4.9996C8.5375,4.9996 10.9995,7.4626 10.9995,10.4996 10.9995,11.4006 10.7795,12.2496 10.3945,12.9996L14.0005,12.9996 14.0005,4.9996z M1.9995,4.9996L5.4995,4.9996C4.1695,4.9996,2.9515,5.4726,1.9995,6.2586z" />
<GeometryDrawing Brush="#FF00539C" Geometry="F1M9.2109,10.7832C8.5439,11.0742 7.9429,11.2482 7.3799,11.3382 7.4509,10.9452 7.4889,10.5702 7.4849,10.2192 7.4819,9.9602 7.4609,9.7162 7.4349,9.4752 7.9019,9.4022 8.3959,9.2772 8.9239,9.0882 9.1149,9.5332 9.2229,10.0252 9.2229,10.5432 9.2229,10.6232 9.2149,10.7032 9.2109,10.7832 M6.4179,14.1272C6.7669,13.3892 7.0379,12.7032 7.2119,12.0732 7.7869,12.0002 8.3979,11.8532 9.0679,11.6012 8.6959,12.8462 7.6849,13.8132 6.4179,14.1272 M5.5889,14.2352C5.5679,14.2362 5.5479,14.2392 5.5269,14.2392 5.4179,14.2392 5.3099,14.2312 5.2029,14.2212 4.8799,13.5052 4.6319,12.7922 4.4779,12.0972 4.8139,12.1312 5.1639,12.1542 5.5229,12.1562 5.6089,12.1582 5.6969,12.1582 5.7819,12.1582 6.0049,12.1582 6.2319,12.1522 6.4599,12.1402 6.2629,12.7782 5.9719,13.4752 5.5889,14.2352 M1.9819,11.5872C2.4949,11.7442 3.0829,11.8962 3.7469,12.0022 3.8779,12.6752 4.0949,13.3612 4.3779,14.0542 3.2269,13.6782 2.3269,12.7542 1.9819,11.5872 M1.8309,10.5432C1.8309,10.0172 1.9419,9.5172 2.1409,9.0622 2.5809,9.1932 3.0719,9.3162 3.6189,9.4082 3.5919,9.6702 3.5719,9.9362 3.5689,10.2192 3.5649,10.5602 3.5909,10.9132 3.6319,11.2692 2.9409,11.1432 2.3439,10.9702 1.8439,10.8032 1.8369,10.7172 1.8309,10.6312 1.8309,10.5432 M4.3139,9.4872C4.7009,9.5312,5.1039,9.5432,5.5229,9.5432L5.7819,9.5432C6.0959,9.5432 6.4139,9.5542 6.7379,9.5312 6.7629,9.7502 6.7819,9.9822 6.7839,10.2142 6.7879,10.5862 6.7399,10.9922 6.6489,11.4222 6.2729,11.4472 5.9049,11.4592 5.5309,11.4572 5.1209,11.4512 4.7289,11.4222 4.3489,11.3782 4.2949,10.9862 4.2669,10.5992 4.2709,10.2242 4.2729,9.9772 4.2899,9.7182 4.3139,9.4872 M4.1879,7.1002C4.0019,7.5652 3.8309,8.1002 3.7169,8.7132 3.2729,8.6352 2.8659,8.5382 2.4939,8.4322 2.9109,7.8352 3.4999,7.3682 4.1879,7.1002 M6.6259,8.8592C6.2579,8.8852 5.8969,8.8882 5.5309,8.8852 5.1449,8.8812 4.7719,8.8552 4.4119,8.8142 4.5619,8.0322 4.8099,7.3902 5.0559,6.8802 5.2099,6.8602 5.3669,6.8462 5.5269,6.8462 5.6329,6.8462 5.7369,6.8542 5.8389,6.8622 6.1409,7.3842 6.4469,8.0492 6.6259,8.8592 M8.5799,8.4592C8.1379,8.6112 7.7229,8.7172 7.3249,8.7782 7.1869,8.1162 6.9709,7.5452 6.7359,7.0532 7.4929,7.3152 8.1359,7.8112 8.5799,8.4592 M10.0199,10.3902C9.9379,7.9772 7.9609,6.0432 5.5269,6.0432 3.0419,6.0432 1.0269,8.0572 1.0269,10.5432 1.0269,10.6752 1.0349,10.8032 1.0459,10.9312 1.0559,11.0472 1.0729,11.1602 1.0919,11.2722 1.0919,11.2772 1.0919,11.2802 1.0939,11.2852 1.4069,13.1762 2.8969,14.6652 4.7899,14.9762 4.7939,14.9772 4.7979,14.9782 4.8019,14.9782 4.9149,14.9982 5.0269,15.0132 5.1409,15.0232 5.2679,15.0352 5.3969,15.0432 5.5269,15.0432 5.6749,15.0432 5.8219,15.0342 5.9659,15.0212 8.2449,14.7992 10.0269,12.8802 10.0269,10.5432 10.0269,10.4902 10.0199,10.4412 10.0199,10.3902" />
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
</Viewbox>
<customControls:ccAntallProdukterVisning ToolTip="Antall produkter" />
<!--<Button Content="{Binding DtoVersjonKampanjeDetalj.Tittel}"/>-->
</StackPanel>
<ItemsControl ItemsSource="{Binding ObsCollVareTittelVisning}" VerticalAlignment="Stretch" Grid.Row="1" Grid.Column="0" VirtualizingPanel.IsVirtualizing="False"
HorizontalAlignment="Stretch" Margin="4" ItemTemplate="{StaticResource dataTemplateVareTittelVisningeHyperLink}">
</ItemsControl>
<Image Source="/WpfVFAKampanjeMaster;component/Assets/lock.png" Height="20" ToolTip="Denne kampanjen er låst for redigering"
VerticalAlignment="Top" HorizontalAlignment="Right">
<Image.Style>
<Style TargetType="Image">
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger Binding="{Binding DtoVersjonKampanje.Låst}" Value="True">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</Grid>
</Border>
</ScrollViewer>
</Grid>
<DataTemplate x:Key="dataTemplateVareTittelVisningeHyperLink" DataType="presentasjon:DtoKampanjeDetaljVareTittelVisning">
<TextBlock Margin="4,0">
<TextBlock.ContextMenu>
<ContextMenu>
<MenuItem Header="Kopier varegruppe" x:Name="miKopierVareGruppe" Tag="{Binding}" Click="miKopierVareGruppe_Click" />
</ContextMenu>
</TextBlock.ContextMenu>
<Hyperlink Tag="{Binding}" x:Name="hyperLinkVareTittelVisning" Click="hyperLinkVareTittelVisning_Click">
<Hyperlink.ToolTip>
<ItemsControl ItemsSource="{Binding ObsCollTilbud}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Navn}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Hyperlink.ToolTip>
<TextBlock MaxWidth="300" TextWrapping="Wrap">
<TextBlock Text="{Binding DtoVersjonKampanjeDetaljVareTittel.Tittel}" Foreground="{Binding DtoVersjonKampanjeDetaljVareTittel.Status,Converter={StaticResource EnumVaretittelForgrunnsFargeConverter}}" />
<customControls:ccVareTittelTilbudVisning ObsCollTilbud="{Binding ObsCollTilbud}" Margin="-0,0,0,-3" />
</TextBlock>
</Hyperlink>
</TextBlock>
</DataTemplate>
答案 0 :(得分:0)
好的,需要进行很多更改才能获得性能。
现在我们已接近可接受的表现。
1.使用超链接删除所有TextBlock。
2.从UserControl更改为CustomControl
3.真正有所作为的那个:
public class CustomListView : ListView
{
protected override void OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs e)
{
//huge performance hit if next line is not commented out
//base.OnIsKeyboardFocusWithinChanged(e);
}
}
我们实际上最终得到了大约45秒的初始加载时间。但由于我们有一个初始负载的进度窗口,这应该是可以接受的。
但现在该应用程序在初始负载后很快且响应迅速。
当我们使用来自WCF服务器的回调合同将所有增量数据更改推送到所有已连接的客户端时,它已成为一个非常好的仪表板应用程序。