Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 5b3cfdb

Browse files
committed
Color & TimeSpan Editor in PropertyGrid
uses Controls from Extended WPF Toolkit fork (https://github.com/jogibear9988/WpfExToolkit)
1 parent 5a181c1 commit 5b3cfdb

5 files changed

Lines changed: 83 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<xctk:ColorPicker x:Class="ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.ColorEditor"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
5+
Focusable="False"
6+
SelectedColor="{Binding Value}">
7+
</xctk:ColorPicker>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2+
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
3+
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Linq;
7+
using System.Text;
8+
using System.Windows;
9+
using System.Windows.Controls;
10+
using System.Windows.Data;
11+
using System.Windows.Documents;
12+
using System.Windows.Input;
13+
using System.Windows.Media;
14+
using System.Windows.Media.Imaging;
15+
using System.Windows.Navigation;
16+
using System.Windows.Shapes;
17+
using ICSharpCode.WpfDesign.PropertyGrid;
18+
19+
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
20+
{
21+
[TypeEditor(typeof(Color))]
22+
public partial class ColorEditor
23+
{
24+
public ColorEditor()
25+
{
26+
InitializeComponent();
27+
}
28+
}
29+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<xctk:TimeSpanUpDown x:Class="ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.TimeSpanEditor"
2+
xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
5+
Value="{Binding Value}">
6+
</xctk:TimeSpanUpDown>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2+
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
3+
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Linq;
7+
using System.Text;
8+
using System.Windows;
9+
using System.Windows.Controls;
10+
using System.Windows.Data;
11+
using System.Windows.Documents;
12+
using System.Windows.Input;
13+
using System.Windows.Media;
14+
using System.Windows.Media.Imaging;
15+
using System.Windows.Navigation;
16+
using System.Windows.Shapes;
17+
using ICSharpCode.WpfDesign.PropertyGrid;
18+
19+
20+
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
21+
{
22+
[TypeEditor(typeof(TimeSpan))]
23+
public partial class TimeSpanEditor
24+
{
25+
public TimeSpanEditor()
26+
{
27+
InitializeComponent();
28+
}
29+
}
30+
}

src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@
7575
<Private>False</Private>
7676
<RequiredTargetFramework>3.0</RequiredTargetFramework>
7777
</Reference>
78+
<Reference Include="Xceed.Wpf.Toolkit">
79+
<HintPath>..\..\..\..\..\Libraries\WPFExtendedToolkit\Xceed.Wpf.Toolkit.dll</HintPath>
80+
</Reference>
7881
</ItemGroup>
7982
<ItemGroup>
8083
<Compile Include="..\..\..\..\..\Main\GlobalAssemblyInfo.cs">
@@ -89,13 +92,19 @@
8992
<Compile Include="Extensions\RightClickContextMenuExtension.cs" />
9093
<Compile Include="Extensions\SkewThumbExtension.cs" />
9194
<Compile Include="Extensions\TopLeftContainerDragHandleMultipleItems.cs" />
95+
<Compile Include="PropertyGrid\Editors\ColorEditor.xaml.cs">
96+
<DependentUpon>ColorEditor.xaml</DependentUpon>
97+
</Compile>
9298
<Compile Include="PropertyGrid\Editors\FlatCollectionEditor.xaml.cs">
9399
<DependentUpon>FlatCollectionEditor.xaml</DependentUpon>
94100
<SubType>Code</SubType>
95101
</Compile>
96102
<Compile Include="PropertyGrid\Editors\OpenCollectionEditor.xaml.cs">
97103
<DependentUpon>OpenCollectionEditor.xaml</DependentUpon>
98104
</Compile>
105+
<Compile Include="PropertyGrid\Editors\TimeSpanEditor.xaml.cs">
106+
<DependentUpon>TimeSpanEditor.xaml</DependentUpon>
107+
</Compile>
99108
<Compile Include="Translations.cs" />
100109
<Compile Include="Configuration\AssemblyInfo.cs" />
101110
<Compile Include="Controls\AdornerLayer.cs" />
@@ -254,8 +263,10 @@
254263
</ItemGroup>
255264
<ItemGroup>
256265
<Page Include="Extensions\RightClickContextMenu.xaml" />
266+
<Page Include="PropertyGrid\Editors\ColorEditor.xaml" />
257267
<Page Include="PropertyGrid\Editors\FlatCollectionEditor.xaml" />
258268
<Page Include="PropertyGrid\Editors\OpenCollectionEditor.xaml" />
269+
<Page Include="PropertyGrid\Editors\TimeSpanEditor.xaml" />
259270
<Page Include="ThumbnailView\ThumbnailView.xaml" />
260271
<ProjectReference Include="..\..\..\..\..\Main\ICSharpCode.SharpDevelop.Widgets\Project\ICSharpCode.SharpDevelop.Widgets.csproj">
261272
<Project>{8035765F-D51F-4A0C-A746-2FD100E19419}</Project>

0 commit comments

Comments
 (0)