Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all 4964 articles
Browse latest View live

New Post: How to notify PropertyGrid that item in the Custom Editor has changed?

$
0
0
Hi,

I'm trying to create a PropertyGrid custom editor for the collections like ObservableCollection<T>.
Image
But the problem is that PropertyGrid control does not know about any changes in my editor.
How to tell the parent property grid that collection property has changed?

I added a INotifyPropertyChanged interface to my editor
    public partial class ListEditor : UserControl, ITypeEditor, INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        PropertyItem _item;

        public ListEditor()
        {
            InitializeComponent();
        }

        public FrameworkElement ResolveEditor(PropertyItem propertyItem)
        {
            _item = propertyItem;
            if (_item.Value != null)
            {
                itemsList.ItemsSource = (ICollection)_item.Value;
                ((INotifyPropertyChanged)_item.Value).PropertyChanged += ListEditor_PropertyChanged;
            }
            return this;
        }

        void ListEditor_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            OnPropertyChanged("_item");
        }

        protected void OnPropertyChanged(string name)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(name));
        }
        private void addItemBtn_Click(object sender, RoutedEventArgs e)
        {
            SingleItemEditor editor = new SingleItemEditor();
            Type t = itemsList.ItemsSource.GetType().GetGenericArguments()[0];
            Activator.CreateInstance(t);
            if (editor.ShowDialog(Activator.CreateInstance(t)) == true)
            {
                ((IList)itemsList.ItemsSource).Add(editor.item);
                itemsList.Items.Refresh();
            }
        }

        private void editItemBtn_Click(object sender, RoutedEventArgs e){}

        private void delItemBtn_Click(object sender, RoutedEventArgs e){}

        private void itemsList_SelectionChanged(object sender, SelectionChangedEventArgs e){}
    }
It doesn't works as expected.

I can track collection changes, but can't find a way to notify Property grid about them.

Thanks in advance for any help,
Xandro.

Commented Issue: CollectionControl.PersistChanges exception [20216]

$
0
0
Hi,

I have a nested structure of classes assigned to a PropertyGrid.
When i edit a collection field, the collection editor opens, fine.
Now when i change a (string) value in the collection editor and press the OK button an exception is thrown, from the code below.

The exception
2013-09-20 08:48:33,348 [9] FATAL Twister.App - CurrentDomain_UnhandledException - Unhandled exception : System.NotSupportedException: Collection was of a fixed size.
at System.Array.System.Collections.IList.Add(Object value)
at Xceed.Wpf.Toolkit.CollectionControl.PersistChanges()

The code where it is thrown
CollectionControl.c
public void PersistChanges()
{
IList list = ComputeItemsSource();
if( list == null )
return;

//the easiest way to persist changes to the source is to just clear the source list and then add all items to it.
list.Clear();

foreach( var item in Items )
{
list.Add( item ); <-------------------------- EXCEPTION
}
}

My data structure looks like this

// VectorType --- Data(list/collection of DataType)
// --- ID (string)

// DataType --- class(ExpectedKeywordSectionType)
// --- class(InputKeywordSectionType)
// --- Objective (string)

An VectorType instance is assigned to the SelectedObject of my PropertyGrid, and i'm trying to edit the Objective (in the collectioneditor)
In the debugger i saw that the 'list' object has property 'IsFixedSize = true', maybe a check should be added here?
But what is more important for me; how could i prevent this from happening? Is it my data structure that is not supported or is there a workaround for this?

Attached is a debugger screenshot with relevant values just before the point the exception is thrown.

Thanks in advance,

Ruud
Comments: ** Comment from web user: ruderik **

Hi,

Thanks for the workaround! And the future fix.

Regards,
Ruud

Edited Issue: Add Padding between CheckListBox items [19365]

$
0
0
Extracted from [checklistbox documentation](http://wpftoolkit.codeplex.com/wikipage?title=CheckListBox&ANCHOR#C26605):

_Since updating to 1.9.0, the CheckListBox seems to have lost the padding between items in the list. Any ideas on how to get it back?_

We should in fact add some space between items.

Commented Issue: Add Padding between CheckListBox items [19365]

$
0
0
Extracted from [checklistbox documentation](http://wpftoolkit.codeplex.com/wikipage?title=CheckListBox&ANCHOR#C26605):

_Since updating to 1.9.0, the CheckListBox seems to have lost the padding between items in the list. Any ideas on how to get it back?_

We should in fact add some space between items.
Comments: ** Comment from web user: BoucherS **

Fix in v2.1.

New Post: Need some help in understanding the CheckListBox control better

New Post: DataGrid AutoFilterMode property missing?

New Comment on "RichTextBox"

$
0
0
Using the RichTextBox from the "Live Explorer app" available here https://wpftoolkit.codeplex.com/ is responding fast to key input.

New Post: Need some help in understanding the CheckListBox control better


New Post: When you see the "System Tray Taskbar Icon Tool"?

$
0
0
When you see the "System Tray Taskbar Icon Tool"?

Created Unassigned: Need to add image in header section of childwindow [20238]

$
0
0
Need to add image control & text control in header of childwindow control.Tried to create subclass as shown below:
```
public class CustomChildWindow : ChildWindow
{
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
var windowRoot = GetTemplateChild("PART_WindowRoot") as Grid;

if (NormalImage != null)
{
base.OnApplyTemplate();
Grid g = this.GetTemplateChild("Root") as Grid;
if(g!=null)

img.Source = this.NormalImage;
}

}
}
```
But line "base.OnApplyTemplate()" gives null exception.Please suggest any alternate to add image control in header of ChildWindow.
Thanks in advance.

New Post: How to notify PropertyGrid that item in the Custom Editor has changed?

$
0
0
Solved, no more help required.
I added SelectedPropertyItemChanged handler to the PropertyGrid and RaiseEvent call on OnPropertyChanged in custom editor.
        protected void OnPropertyChanged(string name)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(name));
            RaiseEvent(new RoutedPropertyChangedEventArgs<PropertyItemBase>(_item, _item, PropertyGrid.SelectedPropertyItemChangedEvent));
        }
Regards,
Xandro

New Post: PropertyGrid ExpandableObject. How to make expanded by default?

$
0
0
Thanks, that was exactly what I was looking for!

Created Unassigned: DateTimePicker.OnPreviewMouseUp [20403]

$
0
0
When selecting a date, if the AutoCloseCalendar property is true and the calendar DisplayMode is Year or Decade it is not possible to select a date using the calendar. Selecting a month or year in these modes invokes OnPreviewMouseUp which in turn invokes CloseDateTimePicker and prevents the user from making the selection.

A possible work around is

```
protected override void OnPreviewMouseUp(MouseButtonEventArgs e)
{
if (Mouse.Captured is CalendarItem)
{
Mouse.Capture(null);

if (AutoCloseCalendar && _calendar.DisplayMode != CalendarMode.Month)
{
CloseDateTimePicker(true);
}
}
}
```

Commented Unassigned: DateTimePicker.OnPreviewMouseUp [20403]

$
0
0
When selecting a date, if the AutoCloseCalendar property is true and the calendar DisplayMode is Year or Decade it is not possible to select a date using the calendar. Selecting a month or year in these modes invokes OnPreviewMouseUp which in turn invokes CloseDateTimePicker and prevents the user from making the selection.

A possible work around is

```
protected override void OnPreviewMouseUp(MouseButtonEventArgs e)
{
if (Mouse.Captured is CalendarItem)
{
Mouse.Capture(null);

if (AutoCloseCalendar && _calendar.DisplayMode == CalendarMode.Month)
{
CloseDateTimePicker(true);
}
}
}
```
Comments: ** Comment from web user: BoucherS **

Hi,

This is fixed in v2.1

Edited Issue: DateTimePicker.OnPreviewMouseUp [20403]

$
0
0
When selecting a date, if the AutoCloseCalendar property is true and the calendar DisplayMode is Year or Decade it is not possible to select a date using the calendar. Selecting a month or year in these modes invokes OnPreviewMouseUp which in turn invokes CloseDateTimePicker and prevents the user from making the selection.

A possible work around is

```
protected override void OnPreviewMouseUp(MouseButtonEventArgs e)
{
if (Mouse.Captured is CalendarItem)
{
Mouse.Capture(null);

if (AutoCloseCalendar && _calendar.DisplayMode == CalendarMode.Month)
{
CloseDateTimePicker(true);
}
}
}
```

New Comment on "DateTimeUpDown"

$
0
0
Spinner does not seem to work for the following locales: pt-BR,ru-RU,es-ES,ko-KR,ja-JP,zh-CN Is this a known issue ? Are these locales not supported ?

New Comment on "DateTimeUpDown"

$
0
0
Can you create a thread in the discussion tab ? Setting the CultureInfo to those locales and using the DateTimePicker works well in v2.1.

New Post: Details for 3.5-Code

$
0
0
Hi there,

in the Source-Code you have a _35-Version.
Could you provide me some information about this code? Because it has some external dependencies I cannot build it as it is provided.
It seems interesting for me because some of our projects still are 3.5

Thanks for your information!
Joerg

PS: Search for "35" or "3.5" doesn't help a lot, so sorry if this is a duplicate

New Post: Details for 3.5-Code

$
0
0
Hi,

What errors exactly are you having ? I download the sourceCode _35 from codePlex and build it without problems.

New Post: Details for 3.5-Code

$
0
0
Hello,

there are no errors. I CAN build it. But there is this external depency to the signed WPFToolkit.dll. So I don't have all sources.
Viewing all 4964 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>