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

New Post: Limit PropertyGrid Control Standard Properties and Use Toolkit ColorPickerEditor

$
0
0
Hi,

First, "EditorDefinition" is obsolete, you should use "EditorTemplateDefinition". You can bind the PropertyGridEditorColorPicker.SelectedColor to the Value of the EditorTemplateDefinition without code-behind. You only need to use the SolidColorBrushToColorConverter. Here's how to do it :
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"

 <Window.Resources>
      <xctk:SolidColorBrushToColorConverter x:Key="SolidColorBrushToColorConverter1" />
   </Window.Resources>
    
   <Grid>
      <StackPanel>
         <Ellipse x:Name="_ellipse"
                  Fill="Green"
                  Width="150"
                  Height="150" />
         
         <xctk:PropertyGrid x:Name="_propertyGrid"
                            AutoGenerateProperties="False"
                            SelectedObject="{Binding ElementName=_ellipse}">
            <xctk:PropertyGrid.PropertyDefinitions>
               <xctk:PropertyDefinition TargetProperties="Fill" />
            </xctk:PropertyGrid.PropertyDefinitions>
            
            <xctk:PropertyGrid.EditorDefinitions>
               <xctk:EditorTemplateDefinition TargetProperties="Fill">
                  <xctk:EditorTemplateDefinition.EditingTemplate>
                     <DataTemplate>
                        <xctk:PropertyGridEditorColorPicker SelectedColor="{Binding Value, Converter={StaticResource SolidColorBrushToColorConverter1}}"
                                                            DisplayColorAndName="True"/>
                     </DataTemplate>
                  </xctk:EditorTemplateDefinition.EditingTemplate>
               </xctk:EditorTemplateDefinition>
            </xctk:PropertyGrid.EditorDefinitions>

         </xctk:PropertyGrid>
      </StackPanel>
   </Grid>

Commented Unassigned: CheckComboBox mvvm problem [20774]

$
0
0
hi

this is my sample

when checked multiple item in CheckComboBox

but only one checked item CheckComboBox save to database

how to save All checked items CheckComboBox to database?

thanks
Comments: ** Comment from web user: BoucherS **

Hi,

I'm not sure I understand the sample. On the CheckComboBox, you set the SelectedMemberPath, the SelectedValue and the SelectedItem, but all these properties try to set the current selected item.

-SelectedMemberPath : using Binding SelectedItemPerson says that he checkComboBox.SelectedItems will be the Persons with the path SelectedItemPerson == true. But SelectedItemPerson is not a path of a Person.

-SelectedValue : using "Binding Documentdata.PersonID" says that the checkComboBox.SelectedItems will be the Persons with PersonID specified in Documentdata.PersonID. Since DocumentData.PersonID is a int, only 1 Person can be selected in the CheckComboBox.

-SelectedItem : using {Binding SelectedItemPerson} says that checkComboBox.SelectedItems will be SelectedItemPerson : only this Person.

Thse 3 Properties shouldn't be used together. Doc : https://wpftoolkit.codeplex.com/wikipage?title=CheckComboBox&referringTitle=Documentation

From what I understand, PersonViewModel.DoSave() method will add Documentdata (which is a Document) to context.Documents and save the changes to the database. But there is only 1 Document being added to context.Documents and a Document only points to 1 Person. I don't see how persons could be saved.

If you have a property like :
```
public ObservableCollection<Person> _SelectedItemPersons = new ObservableCollection<Person>();
public ObservableCollection<Person> SelectedItemPersons
{
get
{
return _SelectedItemPersons;
}
set
{
if( _SelectedItemPersons != value )
{
_SelectedItemPersons = value;
RaisePropertyChanged( "SelectedItemPersons" );
}
}
}
```
and the CheckComboBox have
```
SelectedItemsOverride="{Binding SelectedItemPersons}"
```
then you could save the property SelectedItemPersons.

Commented Unassigned: CheckComboBox mvvm problem [20774]

$
0
0
hi

this is my sample

when checked multiple item in CheckComboBox

but only one checked item CheckComboBox save to database

how to save All checked items CheckComboBox to database?

thanks
Comments: ** Comment from web user: md110 **


hi
Thank you for your attention
All Right , Thse 3 Properties shouldn't be used together
Unused the SelectedMemberPath And SelectedItem in this sample
i forget Remove this tags from Xaml code

i am using SelectedValue And binding To Documentdata.PersonID and save PersonID value to Document Table
but only one item checked save.

i am understand use SelectedItemsOverride="{Binding SelectedItemPersons}" but i Do not know
how to use SelectedItemPersons in view model and save values to database

when

private void DoAddNew()
{
Documentdata = Documentdata ?? new Document();
Documentdata.Person = SelectedItemPersons ;
RaisePropertyChanged("Persondata");
RaisePropertyChanged("Documentdata");
}


in line 2 exeption error:

cannot convert type observablecollection to target type ............................

please edit my sample and help me to resolve this problem And submit

thank you


New Comment on "BusyIndicator"

$
0
0
When I set IsBusy to true and then back to false and I have TabPanel with TabItems on screen then some of my TabItem controls remain disabled (3 of 7). I can see no clue why this happens.

New Post: Controls not all (always) enabled after Busy Indicator

$
0
0
I have the same problem with this control. Some TabItems in my TabPanel remain disabled after setting IsBusy=false. It applies only to the controls that are presently visible.

Created Unassigned: BusyIndicator some controls remain disabled after IsBusy = false [20778]

$
0
0
Based on:
https://wpftoolkit.codeplex.com/discussions/303717

TabItem controls in TabControl that are not selected get disabled after setting IsBusy = true. Then after setting IsBusy to false only some TabItem controls get re-enabled, the rest remains disabled.

Commented Unassigned: CheckComboBox mvvm problem [20774]

$
0
0
hi

this is my sample

when checked multiple item in CheckComboBox

but only one checked item CheckComboBox save to database

how to save All checked items CheckComboBox to database?

thanks
Comments: ** Comment from web user: BoucherS **

Hi,

SelectedItemPersons is a ObservableCollection<Person> while Documentdata.Person is a Person, so the conversion can't be done. This is the reason of the exception.

Can Documentdata.Person be changed for Documentdata.Persons, a ObservableCollection<Person> ? If Yes, removing
```
SelectedValue="{Binding Documentdata.PersonID,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
```
and using
```
SelectedItemsOverride="{Binding SelectedItemPersons}"
```
should do it.

If not, Documentdata.Person can only set 1 Person. So you won't be able to save more than 1 Person.

New Comment on "BusyIndicator"

$
0
0
Hi, Can you submit a sample or code snippet in the discussion tab ? When Using TabControl/TabItems/TabPanel, it all looks good for me.

New Post: Controls not all (always) enabled after Busy Indicator

$
0
0
Hi,

In v2.1 of the Toolkit, there is a property named BusyIndicator.FocusAferBusy. Before setting BusyIndicator.IsBusy to true, you could try to set the control you want to have the focus when BusyIndicator.IsBusy becomes false to this property.

Commented Unassigned: BusyIndicator some controls remain disabled after IsBusy = false [20778]

$
0
0
Based on:
https://wpftoolkit.codeplex.com/discussions/303717

TabItem controls in TabControl that are not selected get disabled after setting IsBusy = true. Then after setting IsBusy to false only some TabItem controls get re-enabled, the rest remains disabled.
Comments: ** Comment from web user: BoucherS **

Hi,

Can you try the Property BusyIndicator.FocusAferBusy ? Can you provide a sample if you still have the bug ?

Commented Unassigned: CheckComboBox mvvm problem [20774]

$
0
0
hi

this is my sample

when checked multiple item in CheckComboBox

but only one checked item CheckComboBox save to database

how to save All checked items CheckComboBox to database?

thanks
Comments: ** Comment from web user: md110 **

hi

i am using "SelectedItemsOverride="{Binding SelectedItemPersons}" in xaml

my problem is in View model

i Do not know, how to use SelectedItemsOverride and values of SelectedItemsOverride in __viewmodel__ and save to database?

please help me?

thanks

Commented Unassigned: CheckComboBox mvvm problem [20774]

$
0
0
hi

this is my sample

when checked multiple item in CheckComboBox

but only one checked item CheckComboBox save to database

how to save All checked items CheckComboBox to database?

thanks
Comments: ** Comment from web user: BoucherS **

Hi,

I don't have access to the Database, but here's a test that could work.

```
private void DoAddNew()
{
Documentdata = Documentdata ?? new Document();
Documentdata.Persons = SelectedItemPersons;

RaisePropertyChanged("Persondata");
RaisePropertyChanged("Documentdata");
}
```
In DocumentMap, I'm not sure about this change :
```
// Relationships
this.HasOptional(t => t.Persons[0])
.WithMany(t => t.Documents)
.HasForeignKey(d => d.PersonID);
```
You could have to modify some stuff to match your needs, but at least, this compiles.
Basically, the Documentdata holds a collection of Person instead of only 1 Person.

Commented Unassigned: CheckComboBox mvvm problem [20774]

$
0
0
hi

this is my sample

when checked multiple item in CheckComboBox

but only one checked item CheckComboBox save to database

how to save All checked items CheckComboBox to database?

thanks
Comments: ** Comment from web user: md110 **

Hi

Not Work

Documentdata.Persons = SelectedItemPersons;

Documentdata has not Persons and not access to Persons

and
this.HasOptional(t => t.Persons[0])
.WithMany(t => t.Documents)
.HasForeignKey(d => d.PersonID);

has bug and not work beacause not access "Persons[0]"

New Post: Controls not all (always) enabled after Busy Indicator

$
0
0
Thanks, I have 2.1 and this is not problem of focus I think, multiple (but not all) controls simply get disabled and not re-enabled. When I use WPF Inspector I can see IsEnabled = false. I will try to make up some example to reproduce the behavior.

New Post: Center of ChildWindow With Margins set

$
0
0
'ello

The ChildWindow does not seem to respect margins when calculating the centering. I would like to place the control, so that the modal background does not obscure my ribbon, but still be in the centre of the screen if I place it underneath the ribbon it gets displayed slightly to the bottom (obviously because it excludes the ribbon height in its calculations). If I place it above the ribbon (Fluent), the modal background obscures it in an ugly way. Then if you give it a margin to exclude the ribbon, it places the dialog way down at the bottom.

Thanx, I really would prefer not to hack your code :)

Cheerz
Hein

Created Unassigned: Display value as hex [20783]

$
0
0
Since 1.9 the numbericUpDown-elements got an property for hex-Input. After entering the number as hex and changing focus the value is displayed as decimal. is there a way to to display AND enter it as hex?

Commented Unassigned: CheckComboBox mvvm problem [20774]

$
0
0
hi

this is my sample

when checked multiple item in CheckComboBox

but only one checked item CheckComboBox save to database

how to save All checked items CheckComboBox to database?

thanks
Comments: ** Comment from web user: BoucherS **

Hi,

You also have to modify the Document class :
Replace
```
public virtual Person Person { get; set; }
```
with
```
public virtual ObservableCollection<Person> Persons { get; set; }
```

Created Unassigned: DoubleUpDown (probably any UpDown) - problem with IsFocused [20785]

$
0
0
I can't find a way of getting IsFocused to trigger for a DoubleUpDown control. (In fact it looks like this problem applies to all the xxxUpDown controls).

e.g., the following code does not trigger a background change:
```
<Style x:Key="expNumUpDownStyle" TargetType="xctk:DoubleUpDown" >
<Style.Triggers>
<Trigger Property="IsFocused" Value="True">
<Setter Property="Background" Value="Purple" />
</Trigger>
</Style.Triggers>
</Style>

```

```
<xctk:DoubleUpDown Style="{StaticResource expNumUpDownStyle}" />

```

A [stackoverflow answer](http://stackoverflow.com/questions/17160298/wpftoolkit-autocompletebox-style-trigger-isfocused-not-firing) for the same problem with a different toolkit control suggested attaching handlers to GotFocus and LostFocus on a derived control. I tried this but couldn't get this to work.

I also tried tracing the IsFocused value in these handlers, and it appeared to remain false, regardless of focus status.

Do you know if this is a known problem, and is there any workaround?

New Post: SplitButton with dropdown menu

$
0
0
I am writing an application and I want to have a dropdown menu connected to a SplitButton

I have the menu added to the DropDownContent of the SplitButton witth appropriate Command Bindings.

I do have 2 issues though.

1) When I select a MenuItem, I want the DropDownContent to close. The default behaviour doesn't do this, so how can I make it happen.

2) I want some of the MenuItems to be bound to the IsChecked property. Whatever I try, I cannot build an appropriate binding.

Any help on these two issues would be greatly appreciated.

New Post: Center of ChildWindow With Margins set

$
0
0
Hi,

What I would do is place the windowContainer underneath the ribbon. Something like :
<Grid>
<StackPanel>
<Ribbon />
   <Grid>
         <Grid>
               <Data/>
        </Grid>
        <WindowContainer>
             <ChildWindow />
        </WindowContainer>
    </Grid>
</StackPanel>
</Grid>

The ChildWindow would have the 2 following properties :
WindowStartupLocation="Center"
Margin="0,0,0,25" //25 is half the size of the ribbon's height

Then modifying the toolkit Code :

In file :Xceed.Wpf.Toolkit/Core/Primitives/WindowContainer.cs
in method : CenterChild
Replace the "if" content with this :
windowControl.Left = ( this.ActualWidth - windowControl.ActualWidth ) / 2.0;
windowControl.Left += (windowControl.Margin.Left - windowControl.Margin.Right);
windowControl.Top = ( this.ActualHeight - windowControl.ActualHeight ) / 2.0;
windowControl.Top += ( windowControl.Margin.Top - windowControl.Margin.Bottom );
Normally, the ChildWidow is centered in the WindowContainer. With this, the ChildWindow will be offsetted from this center.
Viewing all 4964 articles
Browse latest View live


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