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

New Post: Custom Style Template for PropertyGrid not Working, Any Ideas?

$
0
0
I am using the toolkit v2.6 from NuGet in my project, but I don't know if there is something more I should be doing to allow me to theme or customize a control template.

After asking Designer/Blend to create a Copy of the Existing default Template for the PropertyGrid control, the UI is broken. The Template looks correct but no longer functions at Design-Time or Run-Time.

Before:
Image

After specifying a Style:
Image

Here is the Template Blend is Generating when specifying Edit Template > Edit a Copy...

```<Style x:Key="PropertyGridStyleDark" TargetType="{x:Type xctk:PropertyGrid}">
<Setter Property="AdvancedOptionsMenu">
            <Setter.Value>
                <ContextMenu>
                    <MenuItem Header="Reset Value">
                        <MenuItem.Command>
                            <RoutedCommand />
                        </MenuItem.Command>
                    </MenuItem>
                </ContextMenu>
            </Setter.Value>
        </Setter>
        <Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonNormalBackgroundKey, TypeInTargetAssembly={x:Type Themes:ResourceKeys}}}" />
        <Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=ControlNormalBorderKey, TypeInTargetAssembly={x:Type Themes:ResourceKeys}}}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="SelectedObjectType">
            <Setter.Value>
                <Binding
                    ConverterParameter="Type"
                    Path="SelectedObject"
                    RelativeSource="{RelativeSource Self}">
                    <Binding.Converter>
                        <xctk:SelectedObjectConverter />
                    </Binding.Converter>
                </Binding>
            </Setter.Value>
        </Setter>
        <Setter Property="SelectedObjectTypeName">
            <Setter.Value>
                <Binding
                    ConverterParameter="TypeName"
                    Path="SelectedObject"
                    RelativeSource="{RelativeSource Self}">
                    <Binding.Converter>
                        <xctk:SelectedObjectConverter />
                    </Binding.Converter>
                </Binding>
            </Setter.Value>
        </Setter>
        <Setter Property="SelectedObjectName">
            <Setter.Value>
                <Binding
                    ConverterParameter="SelectedObjectName"
                    Path="SelectedObject"
                    RelativeSource="{RelativeSource Self}">
                    <Binding.Converter>
                        <xctk:SelectedObjectConverter />
                    </Binding.Converter>
                </Binding>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type xctk:PropertyGrid}">
                    <Border
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid Margin="{TemplateBinding Padding}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <StackPanel x:Name="selectObjectNamePanel" Orientation="Horizontal">
                                <Border
                                    Width="44"
                                    Height="44"
                                    Margin="6,4,0,4"
                                    Padding="2"
                                    Background="White"
                                    BorderBrush="Black"
                                    BorderThickness="1">
                                    <Border.Visibility>
                                        <Binding Path="ShowPreview" RelativeSource="{RelativeSource TemplatedParent}">
                                            <Binding.Converter>
                                                <BooleanToVisibilityConverter />
                                            </Binding.Converter>
                                        </Binding>
                                    </Border.Visibility>
                                    <Rectangle>
                                        <Rectangle.Fill>
                                            <VisualBrush Stretch="Uniform">
                                                <VisualBrush.Visual>
                                                    <Binding Path="SelectedObject" RelativeSource="{RelativeSource TemplatedParent}">
                                                        <Binding.Converter>
                                                            <xctk:ObjectToUIElementConverter />
                                                        </Binding.Converter>
                                                    </Binding>
                                                </VisualBrush.Visual>
                                            </VisualBrush>
                                        </Rectangle.Fill>
                                    </Rectangle>
                                </Border>
                                <StackPanel
                                    Margin="6,2,6,4"
                                    VerticalAlignment="Center"
                                    Orientation="Horizontal">
                                    <StackPanel.Visibility>
                                        <Binding Path="ShowTitle" RelativeSource="{RelativeSource TemplatedParent}">
                                            <Binding.Converter>
                                                <BooleanToVisibilityConverter />
                                            </Binding.Converter>
                                        </Binding>
                                    </StackPanel.Visibility>
                                    <Grid>
                                        <Grid.MaxWidth>
                                            <Binding
                                                ConverterParameter="17"
                                                Path="ActualWidth"
                                                RelativeSource="{RelativeSource TemplatedParent}">
                                                <Binding.Converter>
                                                    <xctk:HalfConverter />
                                                </Binding.Converter>
                                            </Binding>
                                        </Grid.MaxWidth>
                                        <xctk:TrimmedTextBlock
                                            FontWeight="Bold"
                                            Text="{TemplateBinding SelectedObjectTypeName}"
                                            TextTrimming="CharacterEllipsis" />
                                    </Grid>
                                    <Grid Margin="5,0,0,0">
                                        <Grid.MaxWidth>
                                            <Binding
                                                ConverterParameter="17"
                                                Path="ActualWidth"
                                                RelativeSource="{RelativeSource TemplatedParent}">
                                                <Binding.Converter>
                                                    <xctk:HalfConverter />
                                                </Binding.Converter>
                                            </Binding>
                                        </Grid.MaxWidth>
                                        <xctk:TrimmedTextBlock Text="{TemplateBinding SelectedObjectName}" TextTrimming="CharacterEllipsis" />
                                    </Grid>
                                </StackPanel>
                            </StackPanel>
                            <ListView
                                x:Name="multiSelectObjectsNamePanel"
                                Background="Transparent"
                                Foreground="{TemplateBinding Foreground}"
                                BorderThickness="0"
                                Visibility="Collapsed">
                                <ListView.ItemTemplate>
.
.
.
``

New Post: Get/Set PropertyGrid scroll position?

$
0
0
I can use the VerticalOffset property and ScrollToVerticalOffset() method to get and set the position of a ScrollViewer container.

Is it possible to get and set the scroll position of a PropertyGrid?

New Post: Set minimum date and time spinner steps

$
0
0
How can I:
  • Set the current date+time as the minimum "selectable" date in the calendar?
  • Is it possible to set the Time spinner to increase in steps of 5 minutes instead of 1 minute?
  • Automatically show the current date as default?
Thank you for the help!

Commented Unassigned: PropertyGrid Category Header Style [22206]

$
0
0
How do we style the PropertyGrid Category Header (GroupItem)? I would like to be able to style the Background, Border and glyphs (Up_Arrow and Down_Arrow) in the Category Header. I can style other elements (including editors etc) but I can't see a way to style the Category Header. I have tried to replace the template (starting with the template provided by the VS Edit Template/Edit Copy tool) and even though I change colors etc for what appears to be the relevant elements in the template the Category Header remains unchanged. The one exception is the Foreground color which I can change in the Category Header.

Thank you,

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

Hi,

You are at the right place : in the triggers of the style for PropertyItemBase. Doing the following modifications in
-Xceed.Wpf.Toolkit/PropertyGrid/Themes/Aero2.NormalColor.xaml (in Windows 8)
-Xceed,Wpf.Toolkit/PropertyGrid/Themes/Generic.xaml (other Windows)

modify the Background for the PART_Name of the PropertyItemBase as expected :
```
<Trigger Property="IsMouseOver"
Value="True">
<Setter TargetName="PART_Name"
Property="Background"
Value="Green" />
</Trigger>
<Trigger Property="IsSelected"
Value="True">
<Setter TargetName="PART_Name"
Property="Background"
Value="Red" />
</Trigger>
```

Commented Unassigned: DoubleUpDown handles 0 and .1 weird [22210]

$
0
0
When setting the increment to .1, when I shift up and down and pass and .1 it displays -1.38777878078145E-16 for 0 and 0.0999999999999999 for 1
Comments: ** Comment from web user: BoucherS **

Hi,

Try adding a FormatString, something like :
```
<xctk:DoubleUpDown Value="0" Increment="0.1" FormatString="{}{0:N1}"/>
```

Closed Unassigned: DoubleUpDown handles 0 and .1 weird [22210]

$
0
0
When setting the increment to .1, when I shift up and down and pass and .1 it displays -1.38777878078145E-16 for 0 and 0.0999999999999999 for 1

Commented Unassigned: DoubleUpDown handles 0 and .1 weird [22210]

$
0
0
When setting the increment to .1, when I shift up and down and pass and .1 it displays -1.38777878078145E-16 for 0 and 0.0999999999999999 for 1
Comments: ** Comment from web user: jhebbel **

Why did you close it, its still improper behavior and thus a bug.

Commented Unassigned: DoubleUpDown handles 0 and .1 weird [22210]

$
0
0
When setting the increment to .1, when I shift up and down and pass and .1 it displays -1.38777878078145E-16 for 0 and 0.0999999999999999 for 1
Comments: ** Comment from web user: jhebbel **

And your fix does nothing.


Created Unassigned: DoubleUpDown handles 0 and .1 weird. [22211]

$
0
0
When setting the increment to .1, when I shift up and down and pass and .1 it displays -1.38777878078145E-16 for 0 and 0.0999999999999999 for 1

Created Unassigned: NumericUpDown handles .1 and 0 weird [22212]

$
0
0
When setting the increment to .1, when I shift up and down and pass and .1 it displays -1.38777878078145E-16 for 0 and 0.0999999999999999 for 1

Created Unassigned: Color name not displayed when using custom color list [22213]

$
0
0
I need to use a color picker in WPF and thought I would give the color picker in this toolkit in a try. I have to be able to display a custom list of colors because they relate to colors in another application. The colors correspond to indexes in a custom pallet so I need to display these indexes as the color names in the picker.

As a quick test I added the following in the initialization of my form

```
myColorPicker.DisplayColorAndName = true;
myColorPicker.AvailableColors.Clear();
myColorPicker.AvailableColors.Add(new Xceed.Wpf.Toolkit.ColorItem(System.Windows.Media.Color.FromRgb(110, 110, 110), "Color 12"));
```

When the form is loaded I can confirm the color picker only has my one color. If I hover over the color swatch the tooltip shows "Color 12" but when I pick the color it shows the hex color value of "#FF6E6E6E" in the picker control. This was a bit disappointing.

Is this expected when using custom colors?

When using the default colors it seems to show the name in the control after the color is picked. Although picking Cyan, which has a tooltip of Cyan, displays Aqua in the control after it's picked. The same happens when you pick Magenta which ends up showing Fuchsia in the control.

Reviewed: Extended WPF Toolkit - 2.2.1 (mrt 19, 2016)

$
0
0
Rated 5 Stars (out of 5) - Guys, Have to go into detail for a proper understanding of what you've produced here but I can already say: it looks very sexy! :-) Promising stuff! Regards Chris

Created Issue: CheckComboBox : Nested properties not working for SelectedMemberPath [22216]

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

A user wants to use a CheckComboBox on a list of object with nested properties : KeyPairValue<int, MyData> where MyData has properties "IsChecked" and "Name". User wants to set :
_checkComboBox.DisplayMemberPath = "MyData.Name";
_checkComboBox.SelectedMemberPath = "MyData.IsChecked";

Nested properties are not working for SelectedMemberPath and when selecting an item from the popup, the SelectedValue string displays a KeyPairValue instead of the DisplayMemberPath.

New Post: CheckComboBox and [Flags] enum

$
0
0
Hi,

This looks like a different problem. You are not using the dynamic enum anymore, but a Dictionary. In v3.0, the propertyGrid will support the Dictionary type property and use the CollectionEditor to edit this property.
If you want to use the CheckComboBox for Dictionaries, here's the CheckComboBoxEditor that could work :
public class CheckComboBoxEditor : TypeEditor<CheckComboBox>, ITypeEditor
    {
      protected override void SetValueDependencyProperty()
      {
         ValueProperty = CheckComboBox.ItemsSourceProperty;
      }

      protected override void SetControlProperties( PropertyItem propertyItem )
      {
        Editor.DisplayMemberPath = "Value.DisplayText";
        Editor.SelectedMemberPath = "Value.IsChecked";
        base.SetControlProperties( propertyItem );
      }

      protected override CheckComboBox CreateEditor()
      {
        return new CheckComboBox();
      }

      protected override void ResolveValueBinding( PropertyItem propertyItem )
      {
        var _binding = new Binding( "Value" );
        _binding.Source = propertyItem;
        _binding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
        _binding.Mode = BindingMode.TwoWay;
        _binding.Converter = CreateValueConverter();
        BindingOperations.SetBinding( Editor, ValueProperty, _binding );

        Editor.Initialized += Editor_Initialized;
      }

      private void Editor_Initialized( object sender, EventArgs e )
      {
        Editor.EndInit();
      }
    }
BUT...
There is a problem with nested PropertyItems : they are not working. "Value.IsChecked" won't be found. Issue https://wpftoolkit.codeplex.com/workitem/22216 has been created.

Edited Issue: CheckComboBox : Nested properties not working for SelectedMemberPath [22216]

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

A user wants to use a CheckComboBox on a list of object with nested properties : KeyPairValue<int, MyData> where MyData has properties "IsChecked" and "Name". User wants to set :
_checkComboBox.DisplayMemberPath = "MyData.Name";
_checkComboBox.SelectedMemberPath = "MyData.IsChecked";

Nested properties are not working for SelectedMemberPath and when selecting an item from the popup, the SelectedValue string displays a KeyPairValue instead of the DisplayMemberPath.
Comments: ** Comment from web user: BoucherS **

This will be supported in v3.1.


New Post: Custom Style Template for PropertyGrid not Working, Any Ideas?

$
0
0
Hi,

Its probably missing the implicit style for "PropertyItemBase". You can find it in :
-Xceed.Wpf.Toolkit/PropertyGrid/Themes/Aero2.NormalColor.xaml (for Windows 8)
-Xceed.Wpf.Toolkit/PropertyGrid/Themes/Generic.xaml (for other Windows)

New Post: MessageBox only opens once

$
0
0
Hello!

Ive started using your messagebox to be able to style my messageboxes.

Xceed.Wpf.Toolkit.MessageBox.Show(message, caption, MessageBoxButton.YesNoCancel, MessageBoxImage.Question);

The first time i run this code it works, i press a button to close it again, and then immediately after i run the same code again. The messagebox isnt shown the second time, and my mainwindow now cant be interacted with (like ive opened a modal window). Now i have to close down the application and restart it.

The same thing happens if i set a breakpoint in the application before the window is shown the first time. Nothing is shown and i cant interact with my main window.

The regular System.Window.MessageBox works fine.

And i should mention that the application is a WinForms application with hosted WPF windows and usercontrols.

Created Unassigned: PropertyGrid : Need scroll methods [22218]

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

User want to be able to scroll to a specific position in the PropertyGrid.

New Post: Get/Set PropertyGrid scroll position?

Edited Feature: PropertyGrid : Need scroll methods [22218]

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

User want to be able to scroll to a specific position in the PropertyGrid.
Comments: ** Comment from web user: BoucherS **

New Methods will be added in v3.1 ;
-GetScrollPosition
-ScrollToPosition
-ScrollToTop
-ScrollToBottom
This will be fixed in v3.1.

Viewing all 4964 articles
Browse latest View live


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