Browse Source
Changed the Filter TextBox to a Clearable Text Box Made Icons for Switching between Events and Properties View Mad already icons for different property Group Modes (Popular, PropertyGroups and All) but these need to be implemented (Icons now commented out!)pull/52/head
14 changed files with 912 additions and 659 deletions
@ -0,0 +1,74 @@
@@ -0,0 +1,74 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Text; |
||||
using System.Windows; |
||||
using System.Windows.Controls; |
||||
using System.Windows.Data; |
||||
|
||||
namespace ICSharpCode.WpfDesign.Designer.Controls |
||||
{ |
||||
public class ClearableTextBox : EnterTextBox |
||||
{ |
||||
private Button textRemoverButton; |
||||
|
||||
static ClearableTextBox() |
||||
{ |
||||
DefaultStyleKeyProperty.OverrideMetadata(typeof (ClearableTextBox), |
||||
new FrameworkPropertyMetadata(typeof (ClearableTextBox))); |
||||
} |
||||
|
||||
public ClearableTextBox() |
||||
{ |
||||
this.GotFocus += this.TextBoxGotFocus; |
||||
this.LostFocus += this.TextBoxLostFocus; |
||||
this.TextChanged += this.TextBoxTextChanged; |
||||
} |
||||
|
||||
public override void OnApplyTemplate() |
||||
{ |
||||
base.OnApplyTemplate(); |
||||
|
||||
this.textRemoverButton = this.GetTemplateChild("TextRemover") as Button; |
||||
if (null != this.textRemoverButton) |
||||
{ |
||||
this.textRemoverButton.Click += this.TextRemoverClick; |
||||
} |
||||
|
||||
this.UpdateState(); |
||||
} |
||||
|
||||
protected void UpdateState() |
||||
{ |
||||
if (string.IsNullOrEmpty(this.Text)) |
||||
{ |
||||
VisualStateManager.GoToState(this, "TextRemoverHidden", true); |
||||
} |
||||
else |
||||
{ |
||||
VisualStateManager.GoToState(this, "TextRemoverVisible", true); |
||||
} |
||||
} |
||||
|
||||
private void TextBoxTextChanged(object sender, TextChangedEventArgs e) |
||||
{ |
||||
this.UpdateState(); |
||||
} |
||||
|
||||
private void TextRemoverClick(object sender, RoutedEventArgs e) |
||||
{ |
||||
this.Text = string.Empty; |
||||
this.Focus(); |
||||
} |
||||
|
||||
private void TextBoxGotFocus(object sender, RoutedEventArgs e) |
||||
{ |
||||
this.UpdateState(); |
||||
} |
||||
|
||||
private void TextBoxLostFocus(object sender, RoutedEventArgs e) |
||||
{ |
||||
this.UpdateState(); |
||||
} |
||||
} |
||||
} |
After Width: | Height: | Size: 258 B |
After Width: | Height: | Size: 204 B |
After Width: | Height: | Size: 289 B |
After Width: | Height: | Size: 178 B |
After Width: | Height: | Size: 288 B |
@ -1,296 +1,328 @@
@@ -1,296 +1,328 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Text; |
||||
using System.ComponentModel; |
||||
using System.Collections.ObjectModel; |
||||
using System.Threading; |
||||
using System.Globalization; |
||||
using ICSharpCode.WpfDesign.PropertyGrid; |
||||
using System.Windows.Threading; |
||||
using System.Diagnostics; |
||||
using System.Windows.Media; |
||||
using System.Windows; |
||||
|
||||
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid |
||||
{ |
||||
public class PropertyGrid : INotifyPropertyChanged |
||||
{ |
||||
public PropertyGrid() |
||||
{ |
||||
Categories = new ObservableCollection<Category>(new [] { |
||||
specialCategory, |
||||
popularCategory, |
||||
otherCategory, |
||||
attachedCategory |
||||
}); |
||||
|
||||
Events = new PropertyNodeCollection(); |
||||
} |
||||
|
||||
Category specialCategory = new Category("Special"); |
||||
Category popularCategory = new Category("Popular"); |
||||
Category otherCategory = new Category("Other"); |
||||
Category attachedCategory = new Category("Attached"); |
||||
|
||||
Dictionary<MemberDescriptor, PropertyNode> nodeFromDescriptor = new Dictionary<MemberDescriptor, PropertyNode>(); |
||||
|
||||
public ObservableCollection<Category> Categories { get; private set; } |
||||
public PropertyNodeCollection Events { get; private set; } |
||||
|
||||
PropertyGridTab currentTab; |
||||
|
||||
public PropertyGridTab CurrentTab { |
||||
get { |
||||
return currentTab; |
||||
} |
||||
set { |
||||
currentTab = value; |
||||
RaisePropertyChanged("CurrentTab"); |
||||
RaisePropertyChanged("NameBackground"); |
||||
} |
||||
} |
||||
|
||||
string filter; |
||||
|
||||
public string Filter { |
||||
get { |
||||
return filter; |
||||
} |
||||
set { |
||||
filter = value; |
||||
Reload(); |
||||
RaisePropertyChanged("Filter"); |
||||
} |
||||
} |
||||
|
||||
DesignItem singleItem; |
||||
|
||||
public DesignItem SingleItem { |
||||
get { |
||||
return singleItem; |
||||
} |
||||
private set { |
||||
if (singleItem != null) { |
||||
singleItem.NameChanged -= singleItem_NameChanged; |
||||
} |
||||
singleItem = value; |
||||
if (singleItem != null) { |
||||
singleItem.NameChanged += singleItem_NameChanged; |
||||
} |
||||
RaisePropertyChanged("SingleItem"); |
||||
RaisePropertyChanged("Name"); |
||||
RaisePropertyChanged("IsNameEnabled"); |
||||
IsNameCorrect = true; |
||||
} |
||||
} |
||||
|
||||
void singleItem_NameChanged(object sender, EventArgs e) |
||||
{ |
||||
RaisePropertyChanged("Name"); |
||||
} |
||||
|
||||
public string OldName { |
||||
get; private set; |
||||
} |
||||
|
||||
public string Name { |
||||
get { |
||||
if (SingleItem != null) { |
||||
return SingleItem.Name; |
||||
} |
||||
return null; |
||||
} |
||||
set { |
||||
if (SingleItem != null) { |
||||
try { |
||||
if (string.IsNullOrEmpty(value)) { |
||||
OldName = null; |
||||
SingleItem.Properties["Name"].Reset(); |
||||
} else { |
||||
OldName = SingleItem.Name; |
||||
SingleItem.Name = value; |
||||
} |
||||
IsNameCorrect = true; |
||||
} catch { |
||||
IsNameCorrect = false; |
||||
} |
||||
RaisePropertyChanged("Name"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
bool isNameCorrect = true; |
||||
|
||||
public bool IsNameCorrect { |
||||
get { |
||||
return isNameCorrect; |
||||
} |
||||
set { |
||||
isNameCorrect = value; |
||||
RaisePropertyChanged("IsNameCorrect"); |
||||
} |
||||
} |
||||
|
||||
public bool IsNameEnabled { |
||||
get { |
||||
return SingleItem != null; |
||||
} |
||||
} |
||||
|
||||
IEnumerable<DesignItem> selectedItems; |
||||
|
||||
public IEnumerable<DesignItem> SelectedItems { |
||||
get { |
||||
return selectedItems; |
||||
} |
||||
set { |
||||
selectedItems = value; |
||||
RaisePropertyChanged("SelectedItems"); |
||||
Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, new Action( |
||||
delegate { |
||||
Reload(); |
||||
})); |
||||
} |
||||
} |
||||
|
||||
public void ClearFilter() |
||||
{ |
||||
Filter = null; |
||||
} |
||||
|
||||
void Reload() |
||||
{ |
||||
Clear(); |
||||
|
||||
if (SelectedItems == null || SelectedItems.Count() == 0) return; |
||||
if (SelectedItems.Count() == 1) SingleItem = SelectedItems.First(); |
||||
|
||||
foreach (var md in GetDescriptors()) { |
||||
if (PassesFilter(md.Name)) |
||||
AddNode(md); |
||||
} |
||||
} |
||||
|
||||
void Clear() |
||||
{ |
||||
foreach (var c in Categories) { |
||||
c.IsVisible = false; |
||||
foreach (var p in c.Properties) { |
||||
p.IsVisible = false; |
||||
} |
||||
} |
||||
|
||||
foreach (var e in Events) { |
||||
e.IsVisible = false; |
||||
} |
||||
|
||||
SingleItem = null; |
||||
} |
||||
|
||||
List<MemberDescriptor> GetDescriptors() |
||||
{ |
||||
List<MemberDescriptor> list = new List<MemberDescriptor>(); |
||||
|
||||
if (SelectedItems.Count() == 1) { |
||||
foreach (MemberDescriptor d in TypeHelper.GetAvailableProperties(SingleItem.Component)) { |
||||
list.Add(d); |
||||
} |
||||
foreach (MemberDescriptor d in TypeHelper.GetAvailableEvents(SingleItem.ComponentType)) { |
||||
list.Add(d); |
||||
} |
||||
} else { |
||||
foreach (MemberDescriptor d in TypeHelper.GetCommonAvailableProperties(SelectedItems.Select(t => t.Component))) { |
||||
list.Add(d); |
||||
} |
||||
} |
||||
|
||||
return list; |
||||
} |
||||
|
||||
bool PassesFilter(string name) |
||||
{ |
||||
if (string.IsNullOrEmpty(Filter)) return true; |
||||
for (int i = 0; i < name.Length; i++) { |
||||
if (i == 0 || char.IsUpper(name[i])) { |
||||
if (string.Compare(name, i, Filter, 0, Filter.Length, true) == 0) { |
||||
return true; |
||||
} |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
void AddNode(MemberDescriptor md) |
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Text; |
||||
using System.ComponentModel; |
||||
using System.Collections.ObjectModel; |
||||
using System.Threading; |
||||
using System.Globalization; |
||||
using ICSharpCode.WpfDesign.PropertyGrid; |
||||
using System.Windows.Threading; |
||||
using System.Diagnostics; |
||||
using System.Windows.Media; |
||||
using System.Windows; |
||||
|
||||
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid |
||||
{ |
||||
public class PropertyGrid : INotifyPropertyChanged |
||||
{ |
||||
public PropertyGrid() |
||||
{ |
||||
var designProperties = SelectedItems.Select(item => item.Properties.GetProperty(md)).ToArray(); |
||||
if (!Metadata.IsBrowsable(designProperties[0])) return; |
||||
|
||||
PropertyNode node; |
||||
if (nodeFromDescriptor.TryGetValue(md, out node)) { |
||||
node.Load(designProperties); |
||||
} else { |
||||
node = new PropertyNode(); |
||||
node.Load(designProperties); |
||||
if (node.IsEvent) { |
||||
Events.AddSorted(node); |
||||
} else { |
||||
var cat = PickCategory(node); |
||||
cat.Properties.AddSorted(node); |
||||
node.Category = cat; |
||||
} |
||||
nodeFromDescriptor[md] = node; |
||||
} |
||||
node.IsVisible = true; |
||||
if (node.Category != null) |
||||
node.Category.IsVisible = true; |
||||
} |
||||
|
||||
Category PickCategory(PropertyNode node) |
||||
{ |
||||
if (Metadata.IsPopularProperty(node.FirstProperty)) return popularCategory; |
||||
if (node.FirstProperty.IsAttachedDependencyProperty()) return attachedCategory; |
||||
var typeName = node.FirstProperty.DeclaringType.FullName; |
||||
if (typeName.StartsWith("System.Windows.") || typeName.StartsWith("ICSharpCode.WpfDesign.Designer.Controls.")) |
||||
return otherCategory; |
||||
return specialCategory; |
||||
} |
||||
|
||||
#region INotifyPropertyChanged Members
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged; |
||||
|
||||
void RaisePropertyChanged(string name) |
||||
{ |
||||
if (PropertyChanged != null) { |
||||
PropertyChanged(this, new PropertyChangedEventArgs(name)); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
//class CategoryNameComparer : IComparer<string>
|
||||
//{
|
||||
// public static CategoryNameComparer Instance = new CategoryNameComparer();
|
||||
|
||||
// public int Compare(string x, string y)
|
||||
// {
|
||||
// int i1 = Array.IndexOf(Metadata.CategoryOrder, x);
|
||||
// if (i1 == -1) i1 = int.MaxValue;
|
||||
// int i2 = Array.IndexOf(Metadata.CategoryOrder, y);
|
||||
// if (i2 == -1) i2 = int.MaxValue;
|
||||
// if (i1 == i2) return x.CompareTo(y);
|
||||
// return i1.CompareTo(i2);
|
||||
// }
|
||||
//}
|
||||
} |
||||
|
||||
public enum PropertyGridTab |
||||
{ |
||||
Properties, |
||||
Events |
||||
} |
||||
} |
||||
Categories = new CategoriesCollection(); |
||||
Categories.Add(specialCategory); |
||||
Categories.Add(popularCategory); |
||||
Categories.Add(otherCategory); |
||||
Categories.Add(attachedCategory); |
||||
|
||||
Events = new PropertyNodeCollection(); |
||||
} |
||||
|
||||
Category specialCategory = new Category("Special"); |
||||
Category popularCategory = new Category("Popular"); |
||||
Category otherCategory = new Category("Other"); |
||||
Category attachedCategory = new Category("Attached"); |
||||
|
||||
Dictionary<MemberDescriptor, PropertyNode> nodeFromDescriptor = new Dictionary<MemberDescriptor, PropertyNode>(); |
||||
|
||||
public CategoriesCollection Categories { get; private set; } |
||||
public PropertyNodeCollection Events { get; private set; } |
||||
|
||||
private PropertyGridGroupMode _groupMode; |
||||
|
||||
public PropertyGridGroupMode GroupMode |
||||
{ |
||||
get { return _groupMode; } |
||||
set |
||||
{ |
||||
if (_groupMode != value) |
||||
{ |
||||
_groupMode = value; |
||||
|
||||
RaisePropertyChanged("GroupMode"); |
||||
|
||||
Reload(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
PropertyGridTab currentTab; |
||||
|
||||
public PropertyGridTab CurrentTab { |
||||
get { |
||||
return currentTab; |
||||
} |
||||
set { |
||||
currentTab = value; |
||||
RaisePropertyChanged("CurrentTab"); |
||||
RaisePropertyChanged("NameBackground"); |
||||
} |
||||
} |
||||
|
||||
string filter; |
||||
|
||||
public string Filter { |
||||
get { |
||||
return filter; |
||||
} |
||||
set { |
||||
filter = value; |
||||
Reload(); |
||||
RaisePropertyChanged("Filter"); |
||||
} |
||||
} |
||||
|
||||
DesignItem singleItem; |
||||
|
||||
public DesignItem SingleItem { |
||||
get { |
||||
return singleItem; |
||||
} |
||||
private set { |
||||
if (singleItem != null) { |
||||
singleItem.NameChanged -= singleItem_NameChanged; |
||||
} |
||||
singleItem = value; |
||||
if (singleItem != null) { |
||||
singleItem.NameChanged += singleItem_NameChanged; |
||||
} |
||||
RaisePropertyChanged("SingleItem"); |
||||
RaisePropertyChanged("Name"); |
||||
RaisePropertyChanged("IsNameEnabled"); |
||||
IsNameCorrect = true; |
||||
} |
||||
} |
||||
|
||||
void singleItem_NameChanged(object sender, EventArgs e) |
||||
{ |
||||
RaisePropertyChanged("Name"); |
||||
} |
||||
|
||||
public string OldName { |
||||
get; private set; |
||||
} |
||||
|
||||
public string Name { |
||||
get { |
||||
if (SingleItem != null) { |
||||
return SingleItem.Name; |
||||
} |
||||
return null; |
||||
} |
||||
set { |
||||
if (SingleItem != null) { |
||||
try { |
||||
if (string.IsNullOrEmpty(value)) { |
||||
OldName = null; |
||||
SingleItem.Properties["Name"].Reset(); |
||||
} else { |
||||
OldName = SingleItem.Name; |
||||
SingleItem.Name = value; |
||||
} |
||||
IsNameCorrect = true; |
||||
} catch { |
||||
IsNameCorrect = false; |
||||
} |
||||
RaisePropertyChanged("Name"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
bool isNameCorrect = true; |
||||
|
||||
public bool IsNameCorrect { |
||||
get { |
||||
return isNameCorrect; |
||||
} |
||||
set { |
||||
isNameCorrect = value; |
||||
RaisePropertyChanged("IsNameCorrect"); |
||||
} |
||||
} |
||||
|
||||
public bool IsNameEnabled { |
||||
get { |
||||
return SingleItem != null; |
||||
} |
||||
} |
||||
|
||||
IEnumerable<DesignItem> selectedItems; |
||||
|
||||
public IEnumerable<DesignItem> SelectedItems { |
||||
get { |
||||
return selectedItems; |
||||
} |
||||
set { |
||||
selectedItems = value; |
||||
RaisePropertyChanged("SelectedItems"); |
||||
Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, new Action( |
||||
delegate { |
||||
Reload(); |
||||
})); |
||||
} |
||||
} |
||||
|
||||
public void ClearFilter() |
||||
{ |
||||
Filter = null; |
||||
} |
||||
|
||||
void Reload() |
||||
{ |
||||
Clear(); |
||||
|
||||
if (SelectedItems == null || SelectedItems.Count() == 0) return; |
||||
if (SelectedItems.Count() == 1) SingleItem = SelectedItems.First(); |
||||
|
||||
foreach (var md in GetDescriptors()) { |
||||
if (PassesFilter(md.Name)) |
||||
AddNode(md); |
||||
} |
||||
} |
||||
|
||||
void Clear() |
||||
{ |
||||
foreach (var c in Categories) { |
||||
c.IsVisible = false; |
||||
foreach (var p in c.Properties) { |
||||
p.IsVisible = false; |
||||
} |
||||
} |
||||
|
||||
foreach (var e in Events) { |
||||
e.IsVisible = false; |
||||
} |
||||
|
||||
SingleItem = null; |
||||
} |
||||
|
||||
List<MemberDescriptor> GetDescriptors() |
||||
{ |
||||
List<MemberDescriptor> list = new List<MemberDescriptor>(); |
||||
|
||||
if (SelectedItems.Count() == 1) { |
||||
foreach (MemberDescriptor d in TypeHelper.GetAvailableProperties(SingleItem.Component)) { |
||||
list.Add(d); |
||||
} |
||||
foreach (MemberDescriptor d in TypeHelper.GetAvailableEvents(SingleItem.ComponentType)) { |
||||
list.Add(d); |
||||
} |
||||
} else { |
||||
foreach (MemberDescriptor d in TypeHelper.GetCommonAvailableProperties(SelectedItems.Select(t => t.Component))) { |
||||
list.Add(d); |
||||
} |
||||
} |
||||
|
||||
return list; |
||||
} |
||||
|
||||
bool PassesFilter(string name) |
||||
{ |
||||
if (string.IsNullOrEmpty(Filter)) return true; |
||||
for (int i = 0; i < name.Length; i++) { |
||||
if (i == 0 || char.IsUpper(name[i])) { |
||||
if (string.Compare(name, i, Filter, 0, Filter.Length, true) == 0) { |
||||
return true; |
||||
} |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
void AddNode(MemberDescriptor md) |
||||
{ |
||||
var designProperties = SelectedItems.Select(item => item.Properties.GetProperty(md)).ToArray(); |
||||
if (!Metadata.IsBrowsable(designProperties[0])) return; |
||||
|
||||
PropertyNode node; |
||||
if (nodeFromDescriptor.TryGetValue(md, out node)) { |
||||
node.Load(designProperties); |
||||
} else { |
||||
node = new PropertyNode(); |
||||
node.Load(designProperties); |
||||
if (node.IsEvent) { |
||||
Events.AddSorted(node); |
||||
} else { |
||||
var cat = PickCategory(node); |
||||
cat.Properties.AddSorted(node); |
||||
node.Category = cat; |
||||
} |
||||
nodeFromDescriptor[md] = node; |
||||
} |
||||
node.IsVisible = true; |
||||
if (node.Category != null) |
||||
node.Category.IsVisible = true; |
||||
} |
||||
|
||||
Category PickCategory(PropertyNode node) |
||||
{ |
||||
if (Metadata.IsPopularProperty(node.FirstProperty)) return popularCategory; |
||||
if (node.FirstProperty.IsAttachedDependencyProperty()) return attachedCategory; |
||||
var typeName = node.FirstProperty.DeclaringType.FullName; |
||||
if (typeName.StartsWith("System.Windows.") || typeName.StartsWith("ICSharpCode.WpfDesign.Designer.Controls.")) |
||||
return otherCategory; |
||||
return specialCategory; |
||||
} |
||||
|
||||
#region INotifyPropertyChanged Members
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged; |
||||
|
||||
void RaisePropertyChanged(string name) |
||||
{ |
||||
if (PropertyChanged != null) { |
||||
PropertyChanged(this, new PropertyChangedEventArgs(name)); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
//class CategoryNameComparer : IComparer<string>
|
||||
//{
|
||||
// public static CategoryNameComparer Instance = new CategoryNameComparer();
|
||||
|
||||
// public int Compare(string x, string y)
|
||||
// {
|
||||
// int i1 = Array.IndexOf(Metadata.CategoryOrder, x);
|
||||
// if (i1 == -1) i1 = int.MaxValue;
|
||||
// int i2 = Array.IndexOf(Metadata.CategoryOrder, y);
|
||||
// if (i2 == -1) i2 = int.MaxValue;
|
||||
// if (i1 == i2) return x.CompareTo(y);
|
||||
// return i1.CompareTo(i2);
|
||||
// }
|
||||
//}
|
||||
} |
||||
|
||||
public class CategoriesCollection : SortedObservableCollection<Category, string> |
||||
{ |
||||
public CategoriesCollection() |
||||
: base(n => n.Name) |
||||
{ |
||||
} |
||||
} |
||||
|
||||
public enum PropertyGridGroupMode |
||||
{ |
||||
GroupByPopularCategorys, |
||||
GroupByCategorys, |
||||
Ungrouped, |
||||
} |
||||
|
||||
public enum PropertyGridTab |
||||
{ |
||||
Properties, |
||||
Events |
||||
} |
||||
} |
||||
|
@ -1,354 +1,236 @@
@@ -1,354 +1,236 @@
|
||||
<UserControl x:Class="ICSharpCode.WpfDesign.Designer.PropertyGrid.PropertyGridView" |
||||
x:Name="root" |
||||
xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
xmlns:Converters="clr-namespace:ICSharpCode.WpfDesign.Designer.Converters" |
||||
xmlns:PropertyGrid="clr-namespace:ICSharpCode.WpfDesign.Designer.PropertyGrid" |
||||
xmlns:PropertyGridBase="clr-namespace:ICSharpCode.WpfDesign.PropertyGrid;assembly=ICSharpCode.WpfDesign" |
||||
xmlns:Controls="clr-namespace:ICSharpCode.WpfDesign.Designer.Controls" |
||||
Background="{x:Static SystemColors.ControlLightBrush}" |
||||
SnapsToDevicePixels="True"> |
||||
|
||||
<UserControl.Resources> |
||||
|
||||
<Style x:Key="ExpandButtonStyle" |
||||
TargetType="{x:Type ToggleButton}"> |
||||
<Setter Property="Focusable" |
||||
Value="False" /> |
||||
<Setter Property="Template"> |
||||
<Setter.Value> |
||||
<ControlTemplate TargetType="{x:Type ToggleButton}"> |
||||
<Border Background="Transparent"> |
||||
<Border Width="9" |
||||
Height="9" |
||||
SnapsToDevicePixels="true" |
||||
BorderBrush="#FF7898B5" |
||||
BorderThickness="1" |
||||
CornerRadius="1"> |
||||
<Border.Background> |
||||
<LinearGradientBrush EndPoint="1,1" |
||||
StartPoint="0,0"> |
||||
<GradientStop Color="White" |
||||
Offset=".2" /> |
||||
<GradientStop Color="#FFC0B7A6" |
||||
Offset="1" /> |
||||
</LinearGradientBrush> |
||||
</Border.Background> |
||||
<Path Margin="1,1,1,1" |
||||
x:Name="ExpandPath" |
||||
Fill="Black" |
||||
Data="M 0 2 L 0 3 L 2 3 L 2 5 L 3 5 L 3 3 L 5 3 L 5 2 L 3 2 L 3 0 L 2 0 L 2 2 Z" /> |
||||
</Border> |
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Converters="clr-namespace:ICSharpCode.WpfDesign.Designer.Converters" xmlns:PropertyGrid="clr-namespace:ICSharpCode.WpfDesign.Designer.PropertyGrid" xmlns:PropertyGridBase="clr-namespace:ICSharpCode.WpfDesign.PropertyGrid;assembly=ICSharpCode.WpfDesign" xmlns:Controls="clr-namespace:ICSharpCode.WpfDesign.Designer.Controls" xmlns:propertyGrid="clr-namespace:ICSharpCode.WpfDesign.Designer.PropertyGrid"> |
||||
<Style x:Key="ExpandButtonStyle" TargetType="{x:Type ToggleButton}"> |
||||
<Setter Property="Focusable" Value="False" /> |
||||
<Setter Property="Template"> |
||||
<Setter.Value> |
||||
<ControlTemplate TargetType="{x:Type ToggleButton}"> |
||||
<Border Background="Transparent"> |
||||
<Border Width="9" Height="9" SnapsToDevicePixels="true" BorderBrush="#FF7898B5" BorderThickness="1" CornerRadius="1"> |
||||
<Border.Background> |
||||
<LinearGradientBrush EndPoint="1,1" StartPoint="0,0"> |
||||
<GradientStop Color="White" Offset=".2" /> |
||||
<GradientStop Color="#FFC0B7A6" Offset="1" /> |
||||
</LinearGradientBrush> |
||||
</Border.Background> |
||||
<Path Margin="1,1,1,1" x:Name="ExpandPath" Fill="Black" Data="M 0 2 L 0 3 L 2 3 L 2 5 L 3 5 L 3 3 L 5 3 L 5 2 L 3 2 L 3 0 L 2 0 L 2 2 Z" /> |
||||
</Border> |
||||
<ControlTemplate.Triggers> |
||||
<Trigger Property="IsChecked" |
||||
Value="True"> |
||||
<Setter Property="Data" |
||||
TargetName="ExpandPath" |
||||
Value="M 0 2 L 0 3 L 5 3 L 5 2 Z" /> |
||||
</Trigger> |
||||
</ControlTemplate.Triggers> |
||||
</ControlTemplate> |
||||
</Setter.Value> |
||||
</Setter> |
||||
</Style> |
||||
|
||||
<Style x:Key="MoreButtonStyle" |
||||
TargetType="{x:Type ToggleButton}"> |
||||
<Setter Property="Focusable" |
||||
Value="False" /> |
||||
<Setter Property="Template"> |
||||
<Setter.Value> |
||||
<ControlTemplate TargetType="{x:Type ToggleButton}"> |
||||
<Border Background="#F9F9F4" |
||||
BorderThickness="0 0 0 1" |
||||
BorderBrush="{x:Static SystemColors.ControlBrush}"> |
||||
<!--<TextBlock Text="More..." |
||||
</Border> |
||||
<ControlTemplate.Triggers> |
||||
<Trigger Property="IsChecked" Value="True"> |
||||
<Setter Property="Data" TargetName="ExpandPath" Value="M 0 2 L 0 3 L 5 3 L 5 2 Z" /> |
||||
</Trigger> |
||||
</ControlTemplate.Triggers> |
||||
</ControlTemplate> |
||||
</Setter.Value> |
||||
</Setter> |
||||
</Style> |
||||
<Style x:Key="MoreButtonStyle" TargetType="{x:Type ToggleButton}"> |
||||
<Setter Property="Focusable" Value="False" /> |
||||
<Setter Property="Template"> |
||||
<Setter.Value> |
||||
<ControlTemplate TargetType="{x:Type ToggleButton}"> |
||||
<Border Background="#F9F9F4" BorderThickness="0 0 0 1" BorderBrush="{x:Static SystemColors.ControlBrush}"> |
||||
<!--<TextBlock Text="More..." |
||||
VerticalAlignment="Center" |
||||
HorizontalAlignment="Left" |
||||
Margin="18 0 0 0" |
||||
Foreground="{x:Static SystemColors.ControlDarkBrush}" />--> |
||||
<Path x:Name="arrow" |
||||
Data="M 0 0 L 5 5 L 10 0" |
||||
HorizontalAlignment="Center" |
||||
VerticalAlignment="Center" |
||||
Fill="{x:Static SystemColors.ControlDarkBrush}" /> |
||||
</Border> |
||||
<ControlTemplate.Triggers> |
||||
<Trigger Property="IsChecked" |
||||
Value="True"> |
||||
<Setter TargetName="arrow" |
||||
Property="Data" |
||||
Value="M 0 5 L 5 0 L 10 5" /> |
||||
</Trigger> |
||||
</ControlTemplate.Triggers> |
||||
</ControlTemplate> |
||||
</Setter.Value> |
||||
</Setter> |
||||
</Style> |
||||
|
||||
<Style x:Key="CategoryToggleStyle" |
||||
TargetType="{x:Type ToggleButton}"> |
||||
<Setter Property="Focusable" |
||||
Value="False" /> |
||||
<Setter Property="Template"> |
||||
<Setter.Value> |
||||
<ControlTemplate TargetType="{x:Type ToggleButton}"> |
||||
<Border BorderThickness="0 1 0 0" |
||||
BorderBrush="#ECE9D8"> |
||||
<StackPanel Orientation="Horizontal" |
||||
Background="{x:Static SystemColors.ControlLightBrush}"> |
||||
<ToggleButton Style="{StaticResource ExpandButtonStyle}" |
||||
IsChecked="{Binding IsExpanded}" |
||||
VerticalAlignment="Center" |
||||
Margin="3 0 7 0" /> |
||||
<TextBlock Text="{Binding Name}" |
||||
VerticalAlignment="Center" |
||||
FontWeight="Bold" |
||||
Foreground="{x:Static SystemColors.ControlDarkBrush}" /> |
||||
</StackPanel> |
||||
</Border> |
||||
</ControlTemplate> |
||||
</Setter.Value> |
||||
</Setter> |
||||
</Style> |
||||
|
||||
<Style x:Key="CategoryExpanderStyle" |
||||
TargetType="Expander"> |
||||
<Setter Property="Template"> |
||||
<Setter.Value> |
||||
<ControlTemplate TargetType="Expander"> |
||||
<DockPanel> |
||||
<ToggleButton Height="17" |
||||
IsChecked="{Binding IsExpanded}" |
||||
DockPanel.Dock="Top" |
||||
Style="{StaticResource CategoryToggleStyle}" /> |
||||
<ContentPresenter x:Name="ExpandSite" |
||||
Visibility="Collapsed" /> |
||||
</DockPanel> |
||||
<ControlTemplate.Triggers> |
||||
<Trigger Property="IsExpanded" |
||||
Value="True"> |
||||
<Setter Property="Visibility" |
||||
Value="Visible" |
||||
TargetName="ExpandSite" /> |
||||
</Trigger> |
||||
</ControlTemplate.Triggers> |
||||
</ControlTemplate> |
||||
</Setter.Value> |
||||
</Setter> |
||||
</Style> |
||||
|
||||
<Style x:Key="MoreExpanderStyle" |
||||
TargetType="Expander"> |
||||
<Setter Property="Template"> |
||||
<Setter.Value> |
||||
<ControlTemplate TargetType="Expander"> |
||||
<DockPanel> |
||||
<ToggleButton IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" |
||||
Style="{StaticResource MoreButtonStyle}" |
||||
DockPanel.Dock="Top" |
||||
Height="12" /> |
||||
<ContentPresenter x:Name="ExpandSite" |
||||
Visibility="Collapsed" /> |
||||
</DockPanel> |
||||
<ControlTemplate.Triggers> |
||||
<Trigger Property="IsExpanded" |
||||
Value="True"> |
||||
<Setter Property="Visibility" |
||||
Value="Visible" |
||||
TargetName="ExpandSite" /> |
||||
</Trigger> |
||||
</ControlTemplate.Triggers> |
||||
</ControlTemplate> |
||||
</Setter.Value> |
||||
</Setter> |
||||
</Style> |
||||
|
||||
<DataTemplate DataType="{x:Type PropertyGridBase:Category}"> |
||||
<Expander Header="{Binding Name}" |
||||
Style="{StaticResource CategoryExpanderStyle}" |
||||
IsExpanded="{Binding IsExpanded}" |
||||
Visibility="{Binding IsVisible, Converter={x:Static Converters:CollapsedWhenFalse.Instance}}"> |
||||
<ItemsControl ItemsSource="{Binding Properties}" /> |
||||
<!--<StackPanel> |
||||
<ItemsControl ItemsSource="{Binding Properties}" /> |
||||
<Expander Visibility="{Binding MoreProperties.Count, Converter={x:Static Converters:CollapsedWhenZero.Instance}}" |
||||
Style="{StaticResource MoreExpanderStyle}" |
||||
IsExpanded="{Binding ShowMore}"> |
||||
<ItemsControl ItemsSource="{Binding MoreProperties}" |
||||
Background="#F9F9F4" /> |
||||
</Expander> |
||||
</StackPanel>--> |
||||
</Expander> |
||||
</DataTemplate> |
||||
|
||||
<DataTemplate DataType="{x:Type PropertyGridBase:PropertyNode}"> |
||||
<StackPanel Visibility="{Binding IsVisible, Converter={x:Static Converters:CollapsedWhenFalse.Instance}}"> |
||||
<Border x:Name="uxPropertyNodeRow" |
||||
MinHeight="20" |
||||
BorderThickness="0 0 0 1" |
||||
BorderBrush="{x:Static SystemColors.ControlBrush}" |
||||
DockPanel.Dock="Top"> |
||||
<Path x:Name="arrow" Data="M 0 0 L 5 5 L 10 0" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{x:Static SystemColors.ControlDarkBrush}" /> |
||||
</Border> |
||||
<ControlTemplate.Triggers> |
||||
<Trigger Property="IsChecked" Value="True"> |
||||
<Setter TargetName="arrow" Property="Data" Value="M 0 5 L 5 0 L 10 5" /> |
||||
</Trigger> |
||||
</ControlTemplate.Triggers> |
||||
</ControlTemplate> |
||||
</Setter.Value> |
||||
</Setter> |
||||
</Style> |
||||
<Style x:Key="CategoryToggleStyle" TargetType="{x:Type ToggleButton}"> |
||||
<Setter Property="Focusable" Value="False" /> |
||||
<Setter Property="Template"> |
||||
<Setter.Value> |
||||
<ControlTemplate TargetType="{x:Type ToggleButton}"> |
||||
<Border BorderThickness="0 1 0 0" BorderBrush="#ECE9D8"> |
||||
<StackPanel Orientation="Horizontal" Background="{x:Static SystemColors.ControlLightBrush}"> |
||||
<ToggleButton Style="{StaticResource ExpandButtonStyle}" IsChecked="{Binding IsExpanded}" VerticalAlignment="Center" Margin="3 0 7 0" /> |
||||
<TextBlock Text="{Binding Name}" VerticalAlignment="Center" FontWeight="Bold" Foreground="{x:Static SystemColors.ControlDarkBrush}" /> |
||||
</StackPanel> |
||||
</Border> |
||||
</ControlTemplate> |
||||
</Setter.Value> |
||||
</Setter> |
||||
</Style> |
||||
<Style x:Key="CategoryExpanderStyle" TargetType="Expander"> |
||||
<Setter Property="Template"> |
||||
<Setter.Value> |
||||
<ControlTemplate TargetType="Expander"> |
||||
<DockPanel> |
||||
<DockPanel Width="{Binding FirstColumnWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type PropertyGrid:PropertyGridView}}}" |
||||
DockPanel.Dock="Left"> |
||||
<ToggleButton x:Name="expandButton" |
||||
DockPanel.Dock="Left" |
||||
Margin="{Binding Level, Converter={x:Static Converters:LevelConverter.Instance}}" |
||||
Style="{StaticResource ExpandButtonStyle}" |
||||
IsChecked="{Binding IsExpanded}" |
||||
Visibility="{Binding HasChildren, Converter={x:Static Converters:HiddenWhenFalse.Instance}}" /> |
||||
<Rectangle Width="8" Height="8" Stroke="Black" Fill="{Binding IsSet, Converter={x:Static Converters:BlackWhenTrue.Instance}}" StrokeThickness="1" DockPanel.Dock="Right" Margin="4,0,4,0" VerticalAlignment="Center"/> |
||||
<TextBlock Text="{Binding Name}" |
||||
TextTrimming="CharacterEllipsis" |
||||
VerticalAlignment="Center" |
||||
Margin="7 0 0 0" |
||||
ToolTip="{Binding Description}" |
||||
FontWeight="{Binding IsSet, Converter={x:Static Converters:BoldWhenTrue.Instance}}" |
||||
Foreground="{Binding NameForeground}" /> |
||||
</DockPanel> |
||||
<Border BorderThickness="1 0 0 0" |
||||
BorderBrush="{x:Static SystemColors.ControlBrush}"> |
||||
<ContentPresenter x:Name="editorContainer" |
||||
Content="{Binding Editor}" |
||||
VerticalAlignment="Center" |
||||
Margin="3 0" /> |
||||
</Border> |
||||
<ToggleButton Height="17" IsChecked="{Binding IsExpanded}" DockPanel.Dock="Top" Style="{StaticResource CategoryToggleStyle}" /> |
||||
<ContentPresenter x:Name="ExpandSite" Visibility="Collapsed" /> |
||||
</DockPanel> |
||||
<ControlTemplate.Triggers> |
||||
<Trigger Property="IsExpanded" Value="True"> |
||||
<Setter Property="Visibility" Value="Visible" TargetName="ExpandSite" /> |
||||
</Trigger> |
||||
</ControlTemplate.Triggers> |
||||
</ControlTemplate> |
||||
</Setter.Value> |
||||
</Setter> |
||||
</Style> |
||||
<Style x:Key="MoreExpanderStyle" TargetType="Expander"> |
||||
<Setter Property="Template"> |
||||
<Setter.Value> |
||||
<ControlTemplate TargetType="Expander"> |
||||
<DockPanel> |
||||
<ToggleButton IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource MoreButtonStyle}" DockPanel.Dock="Top" Height="12" /> |
||||
<ContentPresenter x:Name="ExpandSite" Visibility="Collapsed" /> |
||||
</DockPanel> |
||||
<ControlTemplate.Triggers> |
||||
<Trigger Property="IsExpanded" Value="True"> |
||||
<Setter Property="Visibility" Value="Visible" TargetName="ExpandSite" /> |
||||
</Trigger> |
||||
</ControlTemplate.Triggers> |
||||
</ControlTemplate> |
||||
</Setter.Value> |
||||
</Setter> |
||||
</Style> |
||||
<Style x:Key="SelectedImageButton" TargetType="{x:Type RadioButton}" BasedOn="{StaticResource {x:Type ToggleButton}}"> |
||||
<Setter Property="BorderBrush" Value="Transparent" /> |
||||
<Style.Triggers> |
||||
<Trigger Property="IsChecked" Value="True"> |
||||
<Setter Property="BorderBrush" Value="Blue" /> |
||||
</Trigger> |
||||
<Trigger Property="IsMouseOver" Value="True"> |
||||
<Setter Property="BorderBrush" Value="Black" /> |
||||
<Setter Property="BorderBrush" Value="DeepSkyBlue" /> |
||||
</Trigger> |
||||
</Style.Triggers> |
||||
</Style> |
||||
<Style TargetType="{x:Type PropertyGrid:PropertyGridView}"> |
||||
<Setter Property="Background" Value="{x:Static SystemColors.ControlLightBrush}" /> |
||||
<Setter Property="Template"> |
||||
<Setter.Value> |
||||
<ControlTemplate TargetType="{x:Type PropertyGrid:PropertyGridView}"> |
||||
<DockPanel LastChildFill="True" Background="{TemplateBinding Background}"> |
||||
<DockPanel.Resources> |
||||
<DataTemplate DataType="{x:Type PropertyGridBase:Category}"> |
||||
<Expander Header="{Binding Name}" Style="{StaticResource CategoryExpanderStyle}" IsExpanded="{Binding IsExpanded}" Visibility="{Binding IsVisible, Converter={x:Static Converters:CollapsedWhenFalse.Instance}}"> |
||||
<ItemsControl ItemsSource="{Binding Properties}" /> |
||||
</Expander> |
||||
</DataTemplate> |
||||
<DataTemplate DataType="{x:Type PropertyGridBase:PropertyNode}"> |
||||
<StackPanel Visibility="{Binding IsVisible, Converter={x:Static Converters:CollapsedWhenFalse.Instance}}"> |
||||
<Border x:Name="uxPropertyNodeRow" MinHeight="20" BorderThickness="0 0 0 1" BorderBrush="{x:Static SystemColors.ControlBrush}" DockPanel.Dock="Top"> |
||||
<DockPanel> |
||||
<DockPanel Width="{Binding FirstColumnWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type PropertyGrid:PropertyGridView}}}" DockPanel.Dock="Left"> |
||||
<ToggleButton x:Name="expandButton" DockPanel.Dock="Left" Margin="{Binding Level, Converter={x:Static Converters:LevelConverter.Instance}}" Style="{StaticResource ExpandButtonStyle}" IsChecked="{Binding IsExpanded}" Visibility="{Binding HasChildren, Converter={x:Static Converters:HiddenWhenFalse.Instance}}" /> |
||||
<Rectangle Width="8" Height="8" Stroke="Black" Fill="{Binding IsSet, Converter={x:Static Converters:BlackWhenTrue.Instance}}" StrokeThickness="1" DockPanel.Dock="Right" Margin="4,0,4,0" VerticalAlignment="Center" /> |
||||
<TextBlock Text="{Binding Name}" TextTrimming="CharacterEllipsis" VerticalAlignment="Center" Margin="7 0 0 0" ToolTip="{Binding Description}" FontWeight="{Binding IsSet, Converter={x:Static Converters:BoldWhenTrue.Instance}}" Foreground="{Binding NameForeground}" /> |
||||
</DockPanel> |
||||
<Border BorderThickness="1 0 0 0" BorderBrush="{x:Static SystemColors.ControlBrush}"> |
||||
<ContentPresenter x:Name="editorContainer" Content="{Binding Editor}" VerticalAlignment="Center" Margin="3 0" /> |
||||
</Border> |
||||
</DockPanel> |
||||
</Border> |
||||
<StackPanel Visibility="{Binding IsExpanded, Converter={x:Static Converters:CollapsedWhenFalse.Instance}}"> |
||||
<ItemsControl ItemsSource="{Binding Children}" Visibility="{Binding Children.Count, Converter={x:Static Converters:CollapsedWhenZero.Instance}}" /> |
||||
<Expander Visibility="{Binding MoreChildren.Count, Converter={x:Static Converters:CollapsedWhenZero.Instance}}" Style="{StaticResource MoreExpanderStyle}"> |
||||
<ItemsControl ItemsSource="{Binding MoreChildren}" Background="#F9F9F4" /> |
||||
</Expander> |
||||
</StackPanel> |
||||
</StackPanel> |
||||
<DataTemplate.Triggers> |
||||
<DataTrigger Binding="{Binding IsEnabled}" Value="False"> |
||||
<Setter TargetName="editorContainer" Property="Opacity" Value="0.5" /> |
||||
</DataTrigger> |
||||
</DataTemplate.Triggers> |
||||
</DataTemplate> |
||||
<DataTemplate DataType="{x:Type FontFamily}"> |
||||
<TextBlock Text="{Binding}" Height="15" FontFamily="{Binding}" FontSize="12" /> |
||||
</DataTemplate> |
||||
</DockPanel.Resources> |
||||
<Grid DockPanel.Dock="Top" Height="78"> |
||||
<Grid.ColumnDefinitions> |
||||
<ColumnDefinition Width="50" /> |
||||
<ColumnDefinition Width="*" /> |
||||
</Grid.ColumnDefinitions> |
||||
<Border Background="White" Grid.Column="0" BorderBrush="Black" BorderThickness="1" Width="44" Height="44" HorizontalAlignment="Left" Padding="2" Margin="6,0,0,0"> |
||||
<Rectangle> |
||||
<Rectangle.Fill> |
||||
<VisualBrush Stretch="Uniform" Visual="{Binding SingleItem.Component}" /> |
||||
</Rectangle.Fill> |
||||
</Rectangle> |
||||
</Border> |
||||
<TextBlock Grid.Column="1" Text="Name:" Margin="6,30,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" /> |
||||
<TextBlock Grid.Column="1" Text="Type:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="6,8,0,0" /> |
||||
<TextBlock Grid.Column="1" Text="Filter:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="6,54,0,0" /> |
||||
<Controls:EnterTextBox Grid.Column="1" x:Name="NameTextBox" Text="{Binding Name}" IsEnabled="{Binding IsNameEnabled}" Margin="44,28,6,0" Height="19.277" VerticalAlignment="Top"> |
||||
<Controls:EnterTextBox.Style> |
||||
<Style TargetType="{x:Type TextBox}"> |
||||
<Style.Triggers> |
||||
<DataTrigger Binding="{Binding IsNameCorrect}" Value="False"> |
||||
<Setter Property="BorderBrush" Value="Red" /> |
||||
</DataTrigger> |
||||
<MultiDataTrigger> |
||||
<MultiDataTrigger.Conditions> |
||||
<Condition Binding="{Binding IsNameEnabled}" Value="True" /> |
||||
<Condition Binding="{Binding CurrentTab}" Value="Events" /> |
||||
<Condition Binding="{Binding Text, RelativeSource={RelativeSource Self}}" Value="" /> |
||||
</MultiDataTrigger.Conditions> |
||||
<Setter Property="BorderBrush" Value="Red" /> |
||||
</MultiDataTrigger> |
||||
</Style.Triggers> |
||||
</Style> |
||||
</Controls:EnterTextBox.Style> |
||||
</Controls:EnterTextBox> |
||||
<TextBlock Grid.Column="1" Text="{Binding SingleItem.ComponentType.Name}" ToolTip="{Binding SingleItem.ComponentType}" Margin="44,8,6,0" Height="13.277" VerticalAlignment="Top" /> |
||||
<Controls:ClearableTextBox Grid.Column="1" Text="{Binding Filter, UpdateSourceTrigger=PropertyChanged}" Margin="44,52,6,0" VerticalAlignment="Top" Height="19" /> |
||||
</Grid> |
||||
<Grid DockPanel.Dock="Top" Height="30"> |
||||
<StackPanel Orientation="Horizontal"> |
||||
<StackPanel Margin="3" HorizontalAlignment="Left" Orientation="Horizontal"> |
||||
<RadioButton Style="{StaticResource SelectedImageButton}" GroupName="SortMode" IsChecked="{Binding GroupMode, Converter={x:Static Converters:EnumBoolean.Instance}, ConverterParameter=GroupByPopularCategorys}" Margin="3,0,0,0" Width="20" Height="20"> |
||||
<Image Source="/ICSharpCode.WpfDesign.Designer;component/Images/group.png" Stretch="None" /> |
||||
</RadioButton> |
||||
<!--<RadioButton Style="{StaticResource SelectedImageButton}" GroupName="SortMode" IsChecked="{Binding GroupMode, Converter={x:Static Converters:EnumBoolean.Instance}, ConverterParameter=GroupByCategorys}" Margin="3,0,0,0" Width="20" Height="20"> |
||||
<Image Source="/ICSharpCode.WpfDesign.Designer;component/Images/group2.png" Stretch="None" /> |
||||
</RadioButton> |
||||
<RadioButton Style="{StaticResource SelectedImageButton}" GroupName="SortMode" IsChecked="{Binding GroupMode, Converter={x:Static Converters:EnumBoolean.Instance}, ConverterParameter=Ungrouped}" Margin="3,0,0,0" Width="20" Height="20"> |
||||
<Image Source="/ICSharpCode.WpfDesign.Designer;component/Images/sort.png" Stretch="None" /> |
||||
</RadioButton>--> |
||||
</StackPanel> |
||||
<StackPanel Margin="3" HorizontalAlignment="Left" Orientation="Horizontal" Visibility="{Binding ShowPropertiesEventsSelector, Converter={x:Static Converters:CollapsedWhenFalse.Instance}, ElementName=root}"> |
||||
<RadioButton Style="{StaticResource SelectedImageButton}" GroupName="ShowType" IsChecked="{Binding CurrentTab, Converter={x:Static Converters:EnumBoolean.Instance}, ConverterParameter=Properties}" Margin="3,0,0,0" Width="20" Height="20"> |
||||
<Image Source="/ICSharpCode.WpfDesign.Designer;component/Images/properties.png" Stretch="None" /> |
||||
</RadioButton> |
||||
<RadioButton Style="{StaticResource SelectedImageButton}" GroupName="ShowType" IsChecked="{Binding CurrentTab, Converter={x:Static Converters:EnumBoolean.Instance}, ConverterParameter=Events}" Margin="3,0,0,0" Width="20" Height="20"> |
||||
<Image Source="/ICSharpCode.WpfDesign.Designer;component/Images/events.png" Stretch="None" /> |
||||
</RadioButton> |
||||
</StackPanel> |
||||
</StackPanel> |
||||
</Grid> |
||||
<Grid x:Name="c1" Background="White"> |
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" Visibility="{Binding CurrentTab, Converter={x:Static Converters:EnumVisibility.Instance}, ConverterParameter=Properties}"> |
||||
<ItemsControl ItemsSource="{Binding Categories}" /> |
||||
</ScrollViewer> |
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" Visibility="{Binding CurrentTab, Converter={x:Static Converters:EnumVisibility.Instance}, ConverterParameter=Events}"> |
||||
<ItemsControl ItemsSource="{Binding Events}" /> |
||||
</ScrollViewer> |
||||
<Thumb x:Name="PART_Thumb" HorizontalAlignment="Left" Width="4" Margin="-2 0 0 0" Cursor="SizeWE"> |
||||
<Thumb.RenderTransform> |
||||
<TranslateTransform X="{Binding FirstColumnWidth, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" /> |
||||
</Thumb.RenderTransform> |
||||
<Thumb.Template> |
||||
<ControlTemplate> |
||||
<Border Background="Transparent" /> |
||||
</ControlTemplate> |
||||
</Thumb.Template> |
||||
</Thumb> |
||||
</Grid> |
||||
</DockPanel> |
||||
</Border> |
||||
<StackPanel Visibility="{Binding IsExpanded, Converter={x:Static Converters:CollapsedWhenFalse.Instance}}"> |
||||
<ItemsControl ItemsSource="{Binding Children}" |
||||
Visibility="{Binding Children.Count, Converter={x:Static Converters:CollapsedWhenZero.Instance}}" /> |
||||
<Expander Visibility="{Binding MoreChildren.Count, Converter={x:Static Converters:CollapsedWhenZero.Instance}}" |
||||
Style="{StaticResource MoreExpanderStyle}"> |
||||
<ItemsControl ItemsSource="{Binding MoreChildren}" |
||||
Background="#F9F9F4" /> |
||||
</Expander> |
||||
</StackPanel> |
||||
</StackPanel> |
||||
<DataTemplate.Triggers> |
||||
<DataTrigger Binding="{Binding IsEnabled}" |
||||
Value="False"> |
||||
<Setter TargetName="editorContainer" |
||||
Property="Opacity" |
||||
Value="0.5" /> |
||||
</DataTrigger> |
||||
</DataTemplate.Triggers> |
||||
</DataTemplate> |
||||
|
||||
<!--<DataTemplate DataType="{x:Type FontFamily}"> |
||||
<TextBlock Text="{Binding}" |
||||
FontFamily="{Binding}" |
||||
FontSize="16"/> |
||||
</DataTemplate>--> |
||||
|
||||
</UserControl.Resources> |
||||
|
||||
<DockPanel> |
||||
<Grid DockPanel.Dock="Top" |
||||
Height="78"> |
||||
<TextBlock Text="Name:" |
||||
Margin="6,30.275,0,33.948" |
||||
HorizontalAlignment="Left" |
||||
Width="32.033" /> |
||||
<TextBlock Text="Type:" |
||||
VerticalAlignment="Top" |
||||
Margin="6.424,7.998,0,0" |
||||
Height="13.277" /> |
||||
<TextBlock Text="Filter:" |
||||
HorizontalAlignment="Left" |
||||
Margin="6,53.553,0,0" |
||||
VerticalAlignment="Top" /> |
||||
|
||||
<Controls:EnterTextBox x:Name="NameTextBox" |
||||
x:FieldModifier="public" |
||||
Text="{Binding Name}" |
||||
IsEnabled="{Binding IsNameEnabled}" |
||||
Margin="44.033,27.275,6,0" |
||||
Height="19.277" |
||||
VerticalAlignment="Top"> |
||||
<Control.Style> |
||||
<Style TargetType="TextBox"> |
||||
<Style.Triggers> |
||||
<DataTrigger Binding="{Binding IsNameCorrect}" |
||||
Value="False"> |
||||
<Setter Property="BorderBrush" |
||||
Value="Red" /> |
||||
</DataTrigger> |
||||
<MultiDataTrigger> |
||||
<MultiDataTrigger.Conditions> |
||||
<Condition Binding="{Binding IsNameEnabled}" |
||||
Value="True" /> |
||||
<Condition Binding="{Binding CurrentTab}" |
||||
Value="Events" /> |
||||
<Condition Binding="{Binding Text, RelativeSource={RelativeSource Self}}" |
||||
Value="" /> |
||||
</MultiDataTrigger.Conditions> |
||||
<Setter Property="BorderBrush" |
||||
Value="Red" /> |
||||
</MultiDataTrigger> |
||||
</Style.Triggers> |
||||
</Style> |
||||
</Control.Style> |
||||
</Controls:EnterTextBox> |
||||
|
||||
<TextBlock Text="{Binding SingleItem.ComponentType.Name}" |
||||
ToolTip="{Binding SingleItem.ComponentType}" |
||||
Margin="44.033,7.998,6,0" |
||||
Height="13.277" |
||||
VerticalAlignment="Top" /> |
||||
<Controls:EnterTextBox Text="{Binding Filter, UpdateSourceTrigger=PropertyChanged}" |
||||
Margin="44.033,50.553,52,0" |
||||
VerticalAlignment="Top" |
||||
Height="19.277" /> |
||||
|
||||
<Button x:Name="clearButton" |
||||
Content="Clear" |
||||
Click="clearButton_Click" |
||||
HorizontalAlignment="Right" |
||||
VerticalAlignment="Top" |
||||
Margin="0,49.552,6,0" |
||||
Height="21.277" |
||||
Width="40" /> |
||||
</Grid> |
||||
|
||||
<Controls:EnumBar Value="{Binding CurrentTab}" |
||||
Container="{Binding ElementName=c1}" |
||||
Margin="5 0 0 5" |
||||
DockPanel.Dock="Top"> |
||||
<Controls:EnumBar.ButtonStyle> |
||||
<Style TargetType="ToggleButton"> |
||||
<Setter Property="Width" |
||||
Value="70" /> |
||||
</Style> |
||||
</Controls:EnumBar.ButtonStyle> |
||||
</Controls:EnumBar> |
||||
|
||||
<Grid x:Name="c1" |
||||
Background="White"> |
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled"> |
||||
<ItemsControl ItemsSource="{Binding Categories}" /> |
||||
</ScrollViewer> |
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled"> |
||||
<ItemsControl ItemsSource="{Binding Events}" /> |
||||
</ScrollViewer> |
||||
<Thumb x:Name="thumb" |
||||
HorizontalAlignment="Left" |
||||
Width="4" |
||||
Margin="-2 0 0 0" |
||||
Cursor="SizeWE"> |
||||
<Thumb.RenderTransform> |
||||
<TranslateTransform X="{Binding FirstColumnWidth, ElementName=root}" /> |
||||
</Thumb.RenderTransform> |
||||
<Thumb.Template> |
||||
<ControlTemplate> |
||||
<Border Background="Transparent" /> |
||||
</ControlTemplate> |
||||
</Thumb.Template> |
||||
</Thumb> |
||||
</Grid> |
||||
|
||||
</DockPanel> |
||||
|
||||
</UserControl> |
||||
</ControlTemplate> |
||||
</Setter.Value> |
||||
</Setter> |
||||
</Style> |
||||
</ResourceDictionary> |
Loading…
Reference in new issue