Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3518 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
6 changed files with 99 additions and 31 deletions
@ -1,28 +0,0 @@
@@ -1,28 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
|
||||
// <version>$Revision: 2667$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Windows.Controls; |
||||
using ICSharpCode.WpfDesign.Extensions; |
||||
|
||||
namespace ICSharpCode.WpfDesign.Designer.Extensions |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ContentControlDefaultInitializer.
|
||||
/// </summary>
|
||||
[ExtensionFor(typeof(ContentControl))] |
||||
public sealed class ContentControlDefaultInitializer : DefaultInitializer |
||||
{ |
||||
public override void InitializeDefaults(DesignItem item) |
||||
{ |
||||
DesignItemProperty contentProperty = item.Properties["Content"]; |
||||
if (contentProperty.ValueOnInstance == null) { |
||||
contentProperty.SetValue(item.ComponentType.Name); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,52 @@
@@ -0,0 +1,52 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
|
||||
// <version>$Revision: 2667$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Windows.Controls; |
||||
using ICSharpCode.WpfDesign.Extensions; |
||||
using System.Windows; |
||||
using System.Windows.Shapes; |
||||
using System.Windows.Media; |
||||
|
||||
namespace ICSharpCode.WpfDesign.Designer.Extensions.Initializers |
||||
{ |
||||
[ExtensionFor(typeof(ContentControl))] |
||||
public class ContentControlInitializer : DefaultInitializer |
||||
{ |
||||
public override void InitializeDefaults(DesignItem item) |
||||
{ |
||||
DesignItemProperty contentProperty = item.Properties["Content"]; |
||||
if (contentProperty.ValueOnInstance == null) { |
||||
contentProperty.SetValue(item.ComponentType.Name); |
||||
} |
||||
} |
||||
} |
||||
|
||||
[ExtensionFor(typeof(HeaderedContentControl))] |
||||
public class HeaderedContentControlInitializer : DefaultInitializer |
||||
{ |
||||
public override void InitializeDefaults(DesignItem item) |
||||
{ |
||||
DesignItemProperty headerProperty = item.Properties["Header"]; |
||||
if (headerProperty.ValueOnInstance == null) { |
||||
headerProperty.SetValue(item.ComponentType.Name); |
||||
} |
||||
} |
||||
} |
||||
|
||||
[ExtensionFor(typeof(Shape))] |
||||
public class ShapeInitializer : DefaultInitializer |
||||
{ |
||||
public override void InitializeDefaults(DesignItem item) |
||||
{ |
||||
DesignItemProperty fillProperty = item.Properties["Fill"]; |
||||
if (fillProperty.ValueOnInstance == null) { |
||||
fillProperty.SetValue(Brushes.YellowGreen); |
||||
} |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue