9 changed files with 87 additions and 29 deletions
@ -0,0 +1,15 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="IStyle.cs" company="Steven Kirk">
|
|||
// Copyright 2014 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex |
|||
{ |
|||
using Perspex.Controls; |
|||
|
|||
public interface IStyle |
|||
{ |
|||
void Attach(Control control); |
|||
} |
|||
} |
|||
@ -0,0 +1,38 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Perspex.Controls; |
|||
using Perspex.Media; |
|||
|
|||
namespace Perspex.Themes.Default |
|||
{ |
|||
public class ButtonStyle : Styles |
|||
{ |
|||
public ButtonStyle() |
|||
{ |
|||
this.AddRange(new[] |
|||
{ |
|||
new Style(x => x.Select<Button>()) |
|||
{ |
|||
Setters = new[] |
|||
{ |
|||
new Setter(Button.BackgroundProperty, new SolidColorBrush(0xffdddddd)), |
|||
new Setter(Button.BorderBrushProperty, new SolidColorBrush(0xff707070)), |
|||
new Setter(Button.BorderThicknessProperty, 2.0), |
|||
new Setter(Button.ForegroundProperty, new SolidColorBrush(0xff000000)), |
|||
}, |
|||
}, |
|||
new Style(x => x.Select<Button>().Class(":mouseover")) |
|||
{ |
|||
Setters = new[] |
|||
{ |
|||
new Setter (Button.BackgroundProperty, new SolidColorBrush(0xffbee6fd)), |
|||
new Setter (Button.BorderBrushProperty, new SolidColorBrush(0xff3c7fb1)), |
|||
}, |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Perspex.Themes.Default |
|||
{ |
|||
public class DefaultTheme : Styles |
|||
{ |
|||
public DefaultTheme() |
|||
{ |
|||
this.Add(new ButtonStyle()); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue