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

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: ssugden **

Your solution works well.

Many thanks for spending the time to help me.

Scott


New Post: PropertyGrid: Dynamically add Properties or Hide Properties on Runtime.

$
0
0
Good morning,

I'm searching for a way to dynamically hide properties that are 'String.IsNullOrEmpty'.
I tried using reflection:
  private void SetBrowsableProperty(string strPropertyName, bool bIsBrowsable)
        {

            PropertyDescriptor propertyDesc = TypeDescriptor.GetProperties(GetType())[strPropertyName];

            BrowsableAttribute attribute = (BrowsableAttribute)propertyDesc.Attributes[typeof(BrowsableAttribute)];
            FieldInfo fiedInfo = attribute.GetType().GetField("Browsable", BindingFlags.IgnoreCase | BindingFlags.NonPublic | BindingFlags.Instance);

            fiedInfo.SetValue(attribute, bIsBrowsable);
        }
..to set the Browsable Attribute, but that causes the Properties in the PropertyGrid to dissapear completely, independent if they have a value or not.

Any help is highly appreciated.

New Post: PropertyGrid : Dynamically change DropDown List at runtime

$
0
0
Is there a way to dynamically change a dropdonw list during runtime (in my case the list need to change depending on other property selection).

I debug the ItemCollection solution, but the GetValue() is only calling at initial population, not with each dropdown selection.

New Post: PropertyGrid: Dynamically add Properties or Hide Properties on Runtime.

$
0
0
Got it working.
The trick was to set the Browsable Attribute to true on all properties, then call the SetBrowsableProperty in the setter of the property.
        [Category("Projekt")]
        [PropertyOrder(1)]
        [DisplayName("Projectnumber")]
        [Browsable(true)]
        public string ProjectNumber
        {
            get
            {
                return _projectNumber;
            }
            set
            {
                _projectNumber = value;
                SetBrowsableProperty("ProjectNumber", !String.IsNullOrEmpty(_projectNumber));
            }
        }

        private void SetBrowsableProperty(string strPropertyName, bool bIsBrowsable)
        {

            PropertyDescriptor propertyDesc = TypeDescriptor.GetProperties(GetType())[strPropertyName];

            BrowsableAttribute attribute = (BrowsableAttribute)propertyDesc.Attributes[typeof(BrowsableAttribute)];
            FieldInfo fiedInfo = attribute.GetType().GetField("Browsable", BindingFlags.IgnoreCase | BindingFlags.NonPublic | BindingFlags.Instance);

            fiedInfo.SetValue(attribute, bIsBrowsable);
        }

New Post: PropertyGrid : Dynamically change DropDown List at runtime

$
0
0
Hi,

Have you look at the LiveExplorer available here : https://wpftoolkit.codeplex.com/releases/view/610794 ?
In the sample PropertyGrid/Using SelectedObject(s)/Using Attributes, modifying the "IsMale" property will modify the "FirstName" property ComboBox Editor values.
This sample is using the "DependsOn" attribute. Please note that this is a feature from the Plus version of the Toolkit.

New Post: PropertyGrid Reset Value

$
0
0
Thanks for your response. I am a little unclear after reading your issue ticket. Is reset supposed to work for community edition? You said it should in your ticket and that it should not in your post above.

Since my original post I have managed to hack together the ability to reset the properties by setting the tooltip and adding in code to get the default value from the attribute. If anyone needs help on this let me know. I am not sure how this will be the only post about resetting properties. I figured this would have been dealt with many times.

Thanks again

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

$
0
0
I am also trying to define a custom style for the property grid. I have gotten pretty far but I am running into the same issue as far as not being able to see the properties. Here is the template I have created. To use it simple save it to a project with a property grid. I have it set to apply to all property grids.

https://gist.github.com/Tide/2bf6d30297904a9a650c1e9cf800e07d

I made sure that PropertyItemBase is defined.

The only parts I could not add were the 4 Internal PropertyGrid numeric Editors.

New Post: PropertyGrid Reset Value

$
0
0
Hi,

Yes, the Reset option is available in the Community edition of the Toolkit. The bug with it in the Community edition will be fixed in v3.1.
The Plus edition doesn't have the bug.

Thanks.

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

$
0
0
Hi,

Have a look at "PART_PropertyItemsControl" in the style targeting "PropertyGrid" : There is no ItemsSource. Set it to
ItemsSource="{Binding Properties, RelativeSource={RelativeSource TemplatedParent}}"
and you will see the PropertyItems.

Also, instead of defining a style for "PropertyItemBase", try to define a style for "PropertyItem" based on "PropertyItemBase" ;
<Style TargetType="{x:Type xctk:PropertyItem}"
                BasedOn="{StaticResource {x:Type xctk:PropertyItemBase}}">
and you will be able to modify the PropertyItem displayed in the PropertyGrid.

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

$
0
0
Thanks for the quick reply,

Can't believe I missed the ItemsSource. That fixed it! I also added the based on part and that fixed it as well.

I have updated my Gist for anyone who is interested in defining their own template.

Couple of notes on my template (BoucherS - maybe they interest you for the toolkit) :
  1. I made the spacing on the right side of the property grid match what is going on on the left. That is the original layout of the property grid butted up against the right side of the control. I added some margins in to make it more uniform in appearance. I forget exactly the changes so you will have to do a quick compare if you want to remove them and are using my template.
  2. I did not like how the search box resized when the mouse went over it. I liked the border it put up but not he way it made the whole control look so I removed the mouse over trigger on the search box. I would have preferred to leave it but I could not figure out how to get the mouse over border without making the control resize.
I have attached a screenshot to show what I changed. I forgot to highlight the additional margin to the right of the clear search button.

The top image is default. The bottom is with this template.

Image

Thanks again for your help!

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

$
0
0
Hi,

For 2), instead of modifying the BorderThickness of the SearchTextBox, you can modify the BorderBrush. In the "searchBoxContainer", use this :
<local:WatermarkTextBox x:Name="_txtFilter"
                                                      Background="Transparent"
                                                      Text="{Binding Filter, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}"
                                                      Watermark="{TemplateBinding FilterWatermark}"
                                                      BorderThickness="1">
                                 <local:WatermarkTextBox.Style>
                                    <Style TargetType="Control">
                                       <Setter Property="BorderBrush"
                                               Value="Transparent" />
                                       <Style.Triggers>
                                          <Trigger Property="IsMouseOver"
                                                   Value="True">
                                             <Setter Property="BorderBrush"
                                                     Value="{StaticResource MouseOverBorderBrush}" />
                                          </Trigger>
                                       </Style.Triggers>
                                    </Style>
                                 </local:WatermarkTextBox.Style>

</local:WatermarkTextBox>
This will be included in v3.1 of the Toolkit.
Thanks

New Post: MaskedTextBox/ValueRangeText box clearing text OnLostFocus

$
0
0
Hello
Community version 2.7.0 was released and fortunately this issues was not fixed.
Was it forgot or is not planned to be changed ?

Thanks

New Post: MaskedTextBox/ValueRangeText box clearing text OnLostFocus

New Post: MaskedTextBox/ValueRangeText box clearing text OnLostFocus

$
0
0
Thank you very much for the info.
Best Regards

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

$
0
0
Sounds good will try that. Thanks again for all your help and effort.

Created Unassigned: LayoutAnchorable doesn't resize correctly if below a LayoutDocumentPane [22243]

$
0
0
If you have a LayoutAnchorable below a LayoutDocumentPane and you resize the document to its minimum height, then the LayoutAnchorable doesn't resize correctly if you resize the height of the window.

For a sample please see my code below:

```
<Window x:Class="AvalonTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ad="http://schemas.xceed.com/wpf/xaml/avalondock"
xmlns:local="clr-namespace:AvalonTest"
mc:Ignorable="d"
Title="MainWindow" Height="600" Width="800">
<Grid>
<ad:DockingManager>
<ad:LayoutRoot>
<ad:LayoutPanel Orientation="Vertical">
<ad:LayoutDocumentPane>
<ad:LayoutDocument>
<Button>
First move splitter up. Then Resize the height of the window.
</Button>
</ad:LayoutDocument>
</ad:LayoutDocumentPane>
<ad:LayoutAnchorablePane>
<ad:LayoutAnchorable>
<Button>
Lower part of this anchorable disappeares.
</Button>
</ad:LayoutAnchorable>
</ad:LayoutAnchorablePane>
</ad:LayoutPanel>
</ad:LayoutRoot>
</ad:DockingManager>
</Grid>
</Window>

```

New Post: Controls missing from designer in x64 build mode

$
0
0
I am using Extended WPF Toolkit Community Edition v2.7.0 in Visual Studio 2015. When set to x64 build mode, the XAML/WPF Designer does not show any of the Extended WPF Toolkit controls. When I switch to x86 or Any CPU build mode, they show up correctly. However, once I build, the controls show up and work fine in any mode.

New Post: Set CategoryOrderAttribute

$
0
0
Hello,

i use the propertygrid and i have create some categories dynamic like this:
    private IEnumerable<PropertyDescriptor> _getProperties()
    {
        // Die Eigenschaften des PluginSetting in Attribute für das PropertyGrid umwandeln
        return _properties.Select(pair =>
        {
            var attributes = new List<Attribute>();
            var setting = pair.Value;
            attributes.Add(new DisplayNameAttribute(setting.DisplayName));
            attributes.Add(new CategoryAttribute(setting.Category));
            attributes.Add(new DescriptionAttribute(setting.Description));
            attributes.Add(new PropertyOrderAttribute(setting.Order));
            if (setting.SecurityMode == SettingSecurityMode.Password)
            {
                attributes.Add(new EditorAttribute(typeof(PasswordEditor), typeof(PasswordEditor)));
            }
            if (ReflectionHelper.HasInterface(setting.Value, typeof(IDictionary)))
            {
                attributes.Add(new EditorAttribute(typeof(CheckListBoxEditor), typeof(CheckListBoxEditor)));
            }
            return new DynamicPropertyDescriptor(this, pair.Key, pair.Value.Value.GetType(), attributes.ToArray());
        });
    }
Sorting is now alphabetical -> Sorting of properties inside category works fine. Now i Try to add CategoryOrder like this:
            attributes.Add(new CategoryOrderAttribute(setting.Category,setting.CategoryOrder));
I create new Public int CategoryOrder which is set on Init for each PropertyAttribute like this:

dynamic settings = new SerializableDynamicObject();
        settings.AnwesenheiteVon = new PluginSetting
        {
            DisplayName = "Test1",
            Description = "",
            Category = "MyTest1",
            CategoryOrder = 0,
            Value = 0,
            Order = 0,
        };
        settings.AnwesenheiteBis = new PluginSetting
        {
            DisplayName = "Test2",
            Description = "",
            Category = "MyTest1",
            CategoryOrder = 0,
            Value = 0,
            Order = 1,
        };

        settings.AnwesenheiteVon = new PluginSetting
        {
            DisplayName = "FirstTest1",
            Description = "",
            Category = "FirstTest",
            CategoryOrder = 1,
            Value = 0,
            Order = 0,
        };
        settings.AnwesenheiteBis = new PluginSetting
        {
            DisplayName = "FirstTest2",
            Description = "",
            Category = "FirstTest",
            CategoryOrder = 1,
            Value = 0,
            Order = 1,
        };
I want to get (MyTest1 -> FirstTest) but i get (FirstTest -> MyTest1)

Do you have any Idea to help me with my problem.

Thanks.

Paul

New Post: Disable DataGrid cell focus style

$
0
0
I am trying to get rid of the default effect when the DataGrid cell gets focus. The foreground of the text elements in selected line becomes white, and I can't find out how to prevent this behavior.
I am using the version 2.7.0 on .NET 3.5.
I'd like to know which property exactly should I override to define my own focusing behavior.

Created Unassigned: Cannot reference version 2.7.0 in Visual Studio 2010 [22246]

$
0
0
We have been using an older version specifically for the DateTimePicker. In needing some of the newer features, we tried using 2.7.0, but to no avail.

By adding a reference and pointing to the .dll, and adding a reference in xaml, it's not recognized and intellisense does not work. The following exception is also shown:

Unable to load the metadata for assembly 'Xceed.Wpf.Toolkit'. This assembly may have been downloaded from the web. See http://go.microsoft.com/fwlink/?LinkId=179545. The following error was encountered during load: Could not load file or assembly 'Xceed.Wpf.Toolkit, Version=2.6.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

By trying to install via NuGet, it errors out stating it's not supported.

Any help is appreciated. Thank you...
Viewing all 4964 articles
Browse latest View live


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