|
|
|
@ -30,55 +30,55 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions.Initializers
@@ -30,55 +30,55 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions.Initializers
|
|
|
|
|
{ |
|
|
|
|
public override void InitializeDefaults(DesignItem item) |
|
|
|
|
{ |
|
|
|
|
//Not every Content Control can have a text as Content (e.g. ZoomBox of WPF Toolkit)
|
|
|
|
|
if (item.Component is Button) |
|
|
|
|
{ |
|
|
|
|
//Not every Content Control can have a text as Content (e.g. ZoomBox of WPF Toolkit)
|
|
|
|
|
if (item.Component is Button) |
|
|
|
|
{ |
|
|
|
|
DesignItemProperty contentProperty = item.Properties["Content"]; |
|
|
|
|
if (contentProperty.ValueOnInstance == null) |
|
|
|
|
{ |
|
|
|
|
if (contentProperty.ValueOnInstance == null) |
|
|
|
|
{ |
|
|
|
|
contentProperty.SetValue(item.ComponentType.Name); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
DesignItemProperty verticalAlignmentProperty = item.Properties["VerticalAlignment"]; |
|
|
|
|
if (verticalAlignmentProperty.ValueOnInstance == null) |
|
|
|
|
{ |
|
|
|
|
verticalAlignmentProperty.SetValue(VerticalAlignment.Center); |
|
|
|
|
} |
|
|
|
|
DesignItemProperty verticalAlignmentProperty = item.Properties["VerticalAlignment"]; |
|
|
|
|
if (verticalAlignmentProperty.ValueOnInstance == null) |
|
|
|
|
{ |
|
|
|
|
verticalAlignmentProperty.SetValue(VerticalAlignment.Center); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
DesignItemProperty horizontalAlignmentProperty = item.Properties["HorizontalAlignment"]; |
|
|
|
|
if (horizontalAlignmentProperty.ValueOnInstance == null) |
|
|
|
|
{ |
|
|
|
|
horizontalAlignmentProperty.SetValue(HorizontalAlignment.Center); |
|
|
|
|
} |
|
|
|
|
DesignItemProperty horizontalAlignmentProperty = item.Properties["HorizontalAlignment"]; |
|
|
|
|
if (horizontalAlignmentProperty.ValueOnInstance == null) |
|
|
|
|
{ |
|
|
|
|
horizontalAlignmentProperty.SetValue(HorizontalAlignment.Center); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[ExtensionFor(typeof(TextBlock))] |
|
|
|
|
public class TextBlockInitializer : DefaultInitializer |
|
|
|
|
{ |
|
|
|
|
public override void InitializeDefaults(DesignItem item) |
|
|
|
|
{ |
|
|
|
|
DesignItemProperty textProperty = item.Properties["Text"]; |
|
|
|
|
if (textProperty.ValueOnInstance == null || textProperty.ValueOnInstance.ToString() == "") |
|
|
|
|
{ |
|
|
|
|
textProperty.SetValue(item.ComponentType.Name); |
|
|
|
|
} |
|
|
|
|
public class TextBlockInitializer : DefaultInitializer |
|
|
|
|
{ |
|
|
|
|
public override void InitializeDefaults(DesignItem item) |
|
|
|
|
{ |
|
|
|
|
DesignItemProperty textProperty = item.Properties["Text"]; |
|
|
|
|
if (textProperty.ValueOnInstance == null || textProperty.ValueOnInstance.ToString() == "") |
|
|
|
|
{ |
|
|
|
|
textProperty.SetValue(item.ComponentType.Name); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
DesignItemProperty verticalAlignmentProperty = item.Properties["VerticalAlignment"]; |
|
|
|
|
if (verticalAlignmentProperty.ValueOnInstance == null) |
|
|
|
|
{ |
|
|
|
|
verticalAlignmentProperty.SetValue(VerticalAlignment.Center); |
|
|
|
|
} |
|
|
|
|
DesignItemProperty verticalAlignmentProperty = item.Properties["VerticalAlignment"]; |
|
|
|
|
if (verticalAlignmentProperty.ValueOnInstance == null) |
|
|
|
|
{ |
|
|
|
|
verticalAlignmentProperty.SetValue(VerticalAlignment.Center); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
DesignItemProperty horizontalAlignmentProperty = item.Properties["HorizontalAlignment"]; |
|
|
|
|
if (horizontalAlignmentProperty.ValueOnInstance == null) |
|
|
|
|
{ |
|
|
|
|
horizontalAlignmentProperty.SetValue(HorizontalAlignment.Center); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
DesignItemProperty horizontalAlignmentProperty = item.Properties["HorizontalAlignment"]; |
|
|
|
|
if (horizontalAlignmentProperty.ValueOnInstance == null) |
|
|
|
|
{ |
|
|
|
|
horizontalAlignmentProperty.SetValue(HorizontalAlignment.Center); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[ExtensionFor(typeof(HeaderedContentControl), OverrideExtension = typeof(ContentControlInitializer))] |
|
|
|
|
public class HeaderedContentControlInitializer : DefaultInitializer |
|
|
|
|
{ |
|
|
|
@ -96,7 +96,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions.Initializers
@@ -96,7 +96,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions.Initializers
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[ExtensionFor(typeof(Shape))] |
|
|
|
|
[ExtensionFor(typeof(Shape))] |
|
|
|
|
public class ShapeInitializer : DefaultInitializer |
|
|
|
|
{ |
|
|
|
|
public override void InitializeDefaults(DesignItem item) |
|
|
|
|