-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Begin WPF work on PropertiesDesigner * Refactor XmlEditor Designer to use Nuget package * PropertyGrid cleanup
- Loading branch information
Showing
52 changed files
with
506 additions
and
1,914 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="DiffPlex" version="1.4.3" targetFramework="net462" /> | ||
<package id="fireworks" version="5.1.10" targetFramework="net462" /> | ||
<package id="fireworks" version="5.1.13" targetFramework="net462" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="DiffPlex" version="1.4.3" targetFramework="net462" /> | ||
<package id="fireworks" version="5.1.10" targetFramework="net462" /> | ||
<package id="fireworks" version="5.1.13" targetFramework="net462" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="DiffPlex" version="1.4.3" targetFramework="net462" /> | ||
<package id="fireworks" version="5.1.10" targetFramework="net462" /> | ||
<package id="fireworks" version="5.1.13" targetFramework="net462" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="DiffPlex" version="1.4.3" targetFramework="net462" /> | ||
<package id="fireworks" version="5.1.10" targetFramework="net462" /> | ||
<package id="fireworks" version="5.1.13" targetFramework="net462" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
Application/Designers/GeneralInformationDesigner/Views/CustomEditor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using IsWiXAutomationInterface; | ||
using System; | ||
using System.Collections; | ||
using System.Drawing.Imaging; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using Xceed.Wpf.Toolkit.PropertyGrid; | ||
|
||
namespace GeneralInformationDesigner.Views | ||
{ | ||
public class CustomEditor<T> : Xceed.Wpf.Toolkit.PropertyGrid.Editors.ComboBoxEditor | ||
{ | ||
|
||
|
||
protected override IValueConverter CreateValueConverter() | ||
{ | ||
return new CustomValueConverter<T>(); | ||
} | ||
|
||
protected override ComboBox CreateEditor() | ||
{ | ||
ComboBox comboBox = base.CreateEditor(); | ||
FrameworkElementFactory textBlock = new FrameworkElementFactory(typeof(TextBlock)); | ||
textBlock.SetBinding(TextBlock.TextProperty, new Binding(".") { Converter = new CustomValueConverter<T>() }); | ||
comboBox.ItemTemplate = new DataTemplate() { VisualTree = textBlock }; | ||
return comboBox; | ||
} | ||
|
||
protected override IEnumerable CreateItemsSource(Xceed.Wpf.Toolkit.PropertyGrid.PropertyItem propertyItem) | ||
{ | ||
return new string[1] { CustomValueConverter<T>.Null } | ||
.Concat(Enum.GetValues(typeof(T)).OfType<T>().Select(x => x.ToString())); | ||
} | ||
} | ||
|
||
public class CustomValueConverter<T>: IValueConverter | ||
{ | ||
internal const string Null = ""; | ||
public object Convert(object value, System.Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value == null) | ||
return Null; | ||
|
||
return value.ToString(); | ||
} | ||
|
||
public object ConvertBack(object value, System.Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
string s = value?.ToString(); | ||
if (s == Null) | ||
return null; | ||
|
||
return Enum.Parse(typeof(T), s); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="DiffPlex" version="1.4.3" targetFramework="net462" /> | ||
<package id="fireworks" version="5.1.10" targetFramework="net462" /> | ||
<package id="fireworks" version="5.1.13" targetFramework="net462" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.