22 changed files with 159 additions and 86 deletions
@ -1,12 +0,0 @@ |
|||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
|
|
||||
namespace Perspex.Controls |
|
||||
{ |
|
||||
public class Tab : ContentControl |
|
||||
{ |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,15 @@ |
|||||
|
// -----------------------------------------------------------------------
|
||||
|
// <copyright file="TabItem.cs" company="Steven Kirk">
|
||||
|
// Copyright 2013 MIT Licence. See licence.md for more information.
|
||||
|
// </copyright>
|
||||
|
// -----------------------------------------------------------------------
|
||||
|
|
||||
|
namespace Perspex.Controls |
||||
|
{ |
||||
|
public class TabItem : HeaderedContentControl |
||||
|
{ |
||||
|
public TabItem() |
||||
|
{ |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,48 @@ |
|||||
|
// -----------------------------------------------------------------------
|
||||
|
// <copyright file="TabItemStyle.cs" company="Steven Kirk">
|
||||
|
// Copyright 2014 MIT Licence. See licence.md for more information.
|
||||
|
// </copyright>
|
||||
|
// -----------------------------------------------------------------------
|
||||
|
|
||||
|
namespace Perspex.Themes.Default |
||||
|
{ |
||||
|
using System.Linq; |
||||
|
using Perspex.Controls; |
||||
|
using Perspex.Media; |
||||
|
using Perspex.Styling; |
||||
|
|
||||
|
public class TabItemStyle : Styles |
||||
|
{ |
||||
|
public TabItemStyle() |
||||
|
{ |
||||
|
this.AddRange(new[] |
||||
|
{ |
||||
|
new Style(x => x.OfType<TabItem>()) |
||||
|
{ |
||||
|
Setters = new[] |
||||
|
{ |
||||
|
new Setter(TextBox.FontSizeProperty, 28.7), |
||||
|
new Setter(Control.ForegroundProperty, Brushes.Gray), |
||||
|
new Setter(Control.MarginProperty, new Thickness(8, 0)), |
||||
|
new Setter(TabItem.TemplateProperty, ControlTemplate.Create<TabItem>(this.Template)), |
||||
|
}, |
||||
|
}, |
||||
|
new Style(x => x.OfType<TabItem>().Class(":selected")) |
||||
|
{ |
||||
|
Setters = new[] |
||||
|
{ |
||||
|
new Setter(Control.ForegroundProperty, Brushes.Black), |
||||
|
}, |
||||
|
}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
private Control Template(TabItem control) |
||||
|
{ |
||||
|
return new ContentPresenter |
||||
|
{ |
||||
|
[~ContentPresenter.ContentProperty] = control[~TabItem.HeaderProperty], |
||||
|
}; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,42 +0,0 @@ |
|||||
// -----------------------------------------------------------------------
|
|
||||
// <copyright file="TabStyle.cs" company="Steven Kirk">
|
|
||||
// Copyright 2014 MIT Licence. See licence.md for more information.
|
|
||||
// </copyright>
|
|
||||
// -----------------------------------------------------------------------
|
|
||||
|
|
||||
namespace Perspex.Themes.Default |
|
||||
{ |
|
||||
using System.Linq; |
|
||||
using Perspex.Controls; |
|
||||
using Perspex.Media; |
|
||||
using Perspex.Styling; |
|
||||
|
|
||||
public class TabStyle : Styles |
|
||||
{ |
|
||||
public TabStyle() |
|
||||
{ |
|
||||
this.AddRange(new[] |
|
||||
{ |
|
||||
new Style(x => x.OfType<Tab>()) |
|
||||
{ |
|
||||
Setters = new[] |
|
||||
{ |
|
||||
new Setter(Button.TemplateProperty, ControlTemplate.Create<Tab>(this.Template)), |
|
||||
}, |
|
||||
}, |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
private Control Template(Tab control) |
|
||||
{ |
|
||||
return new Border |
|
||||
{ |
|
||||
Background = Brushes.Red, |
|
||||
Content = new ContentPresenter |
|
||||
{ |
|
||||
[~ContentPresenter.ContentProperty] = control[~Tab.ContentProperty], |
|
||||
} |
|
||||
}; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
Loading…
Reference in new issue