Posted 11 years ago
by Konstantin
-
Edifecs
Version: 13.1.0581
Platform: .NET 4.0
Environment: Windows 7 (64-bit)
Hi,
I use property grid with editable collection of expandable items. When i add new item to collection existing expandable items blink.
Here is sample code:
<Window x:Class="ActiProTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:propgrid="clr-namespace:ActiproSoftware.Windows.Controls.PropertyGrid;assembly=ActiproSoftware.PropertyGrid.Wpf"
xmlns:propgridPrimitives="clr-namespace:ActiproSoftware.Windows.Controls.PropertyGrid.Primitives;assembly=ActiproSoftware.PropertyGrid.Wpf"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<Style TargetType="{x:Type propgridPrimitives:PropertyGridDataAccessorItem}">
<Setter Property="IsExpanded" Value="True"/>
</Style>
</Window.Resources>
<propgrid:PropertyGrid x:Name="propGrid" SelectedObject="{Binding}" CollectionDisplayMode="EditableInline"/>
</Window>
[TypeConverter(typeof(ExpandableObjectConverter))]
public class ExpandableItem
{
public String Name { get; set; }
public bool Visible { get; set; }
public ExpandableItem()
{
Name = "New Item";
Visible = true;
}
}
public class DataContext
{
private ObservableCollection<ExpandableItem> _items;
public ObservableCollection<ExpandableItem> Items
{
get
{
return _items ?? (_items = new ObservableCollection<ExpandableItem>
{
new ExpandableItem()
{
Name = "John",
Visible = true
},
new ExpandableItem()
{
Name = "Silver",
Visible = true
},
});
}
}
}
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
DataContext = new DataContext();
}
}
Thanks
[Modified 11 years ago]