Saturday, 15 March 2014

c# - How to fix an endless rendering / measure loop with WPF? -


I applied a data grid with DirectionalNavigation following the XAML code = bicycle.

  & lt; Data Grid Keyboard Navigation. Directional Navigation = "Chakra" X: Name = "Toolpath Grid View" VirtualizationPanel.VirtualizationMode = "Recycling" ScrollViewover. ISDrawfraedsCrossingEnated = "True" CannUzzerAdroz = "False" Selection Unit = "FULL" CanUserDeleteRows = "false" SelectionMode = " Single "ItemsSource =" {Binding ToolPath.ToolPath, Mode = Oneway, Converter = {StaticResource IndexedConverter}} "AutoGenerateColumns =" ​​false "SelectedIndex =" "& gt {SelectedIndex, Mode = TwoWay binding}; & Lt; DataGrid.Resources & gt; & Lt; SolidColorBrush X: Main = "{x: Static SystemColors.InactiveSelectionHighlightBrushKey}" color = "DarkGray" /> & Lt; /DataGrid.Resources> & Lt; DataGrid.Columns & gt; & Lt; DataGridTemplateColumn & gt; & Lt; DataGridTemplateColumn.Header & gt; Id & lt; / DataGridTemplateColumn.Header & gt; & Lt; DataGridTemplateColumn.CellTemplate & gt; & Lt; DataTemplate & gt; & Lt; Text block text = "{binding index}" /> & Lt; / DataTemplate & gt; & Lt; /DataGridTemplateColumn.CellTemplate> & Lt; / DataGridTemplateColumn & gt; & Lt; DataGridTemplateColumn & gt; & Lt; DataGridTemplateColumn.Header & gt; & Lt; StackPanel Orientation = "Horizontal" & gt; & Lt; Text block text = "{binding source = {static rsor t9n}, path = swaville}" /> & Lt; / StackPanel & gt; & Lt; /DataGridTemplateColumn.Header> & Lt; DataGridTemplateColumn.CellTemplate & gt; & Lt; DataTemplate & gt; & Lt; Label content = "{binding value toolAxes.Swivel}" /> & Lt; / DataTemplate & gt; & Lt; /DataGridTemplateColumn.CellTemplate> & Lt; / DataGridTemplateColumn & gt; & Lt; DataGridTemplateColumn & gt; & Lt; DataGridTemplateColumn.Header & gt; & Lt; StackPanel Orientation = "Horizontal" & gt; & Lt; TextBlock Text = "{Binding Source = {Static Resources T9n}, Path = Chuck Axis}" /> & Lt; / StackPanel & gt; & Lt; /DataGridTemplateColumn.Header> & Lt; DataGridTemplateColumn.CellTemplate & gt; & Lt; DataTemplate & gt; & Lt; Label content = "{binding value. ToulAxes.Chuck}" /> & Lt; / DataTemplate & gt; & Lt; /DataGridTemplateColumn.CellTemplate> & Lt; / DataGridTemplateColumn & gt; & Lt; DataGridTemplateColumn & gt; & Lt; DataGridTemplateColumn.Header & gt; & Lt; StackPanel Orientation = "Horizontal" & gt; & Lt; Text block text = "{binding source = {static resource T9N}, path = vertical axis}" /> & Lt; / StackPanel & gt; & Lt; /DataGridTemplateColumn.Header> & Lt; DataGridTemplateColumn.CellTemplate & gt; & Lt; DataTemplate & gt; & Lt; Label content = "{binding value toolAxes.Vertical}" /> & Lt; / DataTemplate & gt; & Lt; /DataGridTemplateColumn.CellTemplate> & Lt; / DataGridTemplateColumn & gt; & Lt; /DataGrid.Columns> & Lt; / Data grid & gt;  

datagrid

Using the arrow keys I can move rows up and down

The last line is selected in the data grid, as above, and down arrow then the first line If pressed in the list then it should be selected, though WPF goes into an endless solution / system loop.

I had custom user control in each of the first cell templates but removed them and just changed them with plain labels in case my controls were behaving badly.

Is anyone's idea if this is a bug in WPF or is there a problem in using my data grid?


No comments:

Post a Comment