5 changed files with 42 additions and 0 deletions
@ -1,4 +1,21 @@ |
|||
<Application x:Class="XamlTestApplicationPcl.XamlTestApp" |
|||
xmlns="https://github.com/perspex" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Application.Styles> |
|||
<Style Selector="Button"> |
|||
<Setter Property="Button.Background" Value="#ffaaaaaa"/> |
|||
<Setter Property="Button.BorderBrush" Value="#ffaaaaaa"/> |
|||
<Setter Property="Button.BorderThickness" Value="2"/> |
|||
<Setter Property="Button.Foreground" Value="Black"/> |
|||
<Setter Property="Button.HorizontalContentAlignment" Value="Center"/> |
|||
<Setter Property="Button.VerticalContentAlignment" Value="Center"/> |
|||
<Setter Property="Button.Template"> |
|||
<ControlTemplate TargetType="Button"> |
|||
<Border Padding="3"> |
|||
<ContentPresenter Content="Content Here"/> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
</Application.Styles> |
|||
</Application> |
|||
@ -0,0 +1,21 @@ |
|||
// Copyright (c) The Perspex Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
using System; |
|||
using Perspex.Controls; |
|||
using Perspex.Controls.Templates; |
|||
using Perspex.Styling; |
|||
|
|||
namespace Perspex.Markup.Xaml.Templates |
|||
{ |
|||
public class ControlTemplate : IControlTemplate |
|||
{ |
|||
public Type TargetType { get; set; } |
|||
public TemplateContent Content { get; set; } |
|||
|
|||
public IControl Build(ITemplatedControl control) |
|||
{ |
|||
return Content.Load(); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue