Browse Source

Documented Perspex.Themes.Default.

pull/83/head
Steven Kirk 11 years ago
parent
commit
0d700c9233
  1. 19
      src/Perspex.Themes.Default/ButtonStyle.cs
  2. 15
      src/Perspex.Themes.Default/CheckBoxStyle.cs
  3. 15
      src/Perspex.Themes.Default/ContentControlStyle.cs
  4. 15
      src/Perspex.Themes.Default/DeckStyle.cs
  5. 6
      src/Perspex.Themes.Default/DefaultTheme.cs
  6. 19
      src/Perspex.Themes.Default/DropDownStyle.cs
  7. 14
      src/Perspex.Themes.Default/FocusAdornerStyle.cs
  8. 15
      src/Perspex.Themes.Default/GridSplitterStyle.cs
  9. 15
      src/Perspex.Themes.Default/ItemsControlStyle.cs
  10. 15
      src/Perspex.Themes.Default/ListBoxItemStyle.cs
  11. 15
      src/Perspex.Themes.Default/ListBoxStyle.cs
  12. 24
      src/Perspex.Themes.Default/MenuItemStyle.cs
  13. 15
      src/Perspex.Themes.Default/MenuStyle.cs
  14. 15
      src/Perspex.Themes.Default/PopupRootStyle.cs
  15. 15
      src/Perspex.Themes.Default/ProgressBarStyle.cs
  16. 15
      src/Perspex.Themes.Default/RadioButtonStyle.cs
  17. 26
      src/Perspex.Themes.Default/ScrollBarStyle.cs
  18. 15
      src/Perspex.Themes.Default/ScrollViewerStyle.cs
  19. 15
      src/Perspex.Themes.Default/TabControlStyle.cs
  20. 15
      src/Perspex.Themes.Default/TabItemStyle.cs
  21. 15
      src/Perspex.Themes.Default/TabStripStyle.cs
  22. 15
      src/Perspex.Themes.Default/TextBoxStyle.cs
  23. 15
      src/Perspex.Themes.Default/ToggleButtonStyle.cs
  24. 15
      src/Perspex.Themes.Default/ToolTipStyle.cs
  25. 15
      src/Perspex.Themes.Default/TreeViewItemStyle.cs
  26. 15
      src/Perspex.Themes.Default/TreeViewStyle.cs
  27. 15
      src/Perspex.Themes.Default/WindowStyle.cs

19
src/Perspex.Themes.Default/ButtonStyle.cs

@ -16,8 +16,14 @@ namespace Perspex.Themes.Default
using Perspex.Media;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="Button"/> control.
/// </summary>
public class ButtonStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="ButtonStyle"/> class.
/// </summary>
public ButtonStyle()
{
this.AddRange(new[]
@ -27,7 +33,7 @@ namespace Perspex.Themes.Default
Setters = new[]
{
new Setter(Button.FocusAdornerProperty, new FuncTemplate<IControl>(FocusAdornerTemplate)),
new Setter(Button.TemplateProperty, new ControlTemplate<Button>(this.Template)),
new Setter(Button.TemplateProperty, new ControlTemplate<Button>(Template)),
new Setter(Button.HorizontalContentAlignmentProperty, HorizontalAlignment.Center),
new Setter(Button.VerticalContentAlignmentProperty, VerticalAlignment.Center),
},
@ -74,6 +80,10 @@ namespace Perspex.Themes.Default
});
}
/// <summary>
/// The default template for the <see cref="Button"/> control's focus adorner.
/// </summary>
/// <returns>The root of the instantiated template.</returns>
public static Control FocusAdornerTemplate()
{
return new Rectangle
@ -85,7 +95,12 @@ namespace Perspex.Themes.Default
};
}
private Control Template(Button control)
/// <summary>
/// The default template for the <see cref="Button"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(Button control)
{
Border border = new Border
{

15
src/Perspex.Themes.Default/CheckBoxStyle.cs

@ -15,8 +15,14 @@ namespace Perspex.Themes.Default
using Perspex.Media;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="CheckBox"/> control.
/// </summary>
public class CheckBoxStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="CheckBoxStyle"/> class.
/// </summary>
public CheckBoxStyle()
{
this.AddRange(new[]
@ -25,7 +31,7 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(Button.TemplateProperty, new ControlTemplate<CheckBox>(this.Template)),
new Setter(Button.TemplateProperty, new ControlTemplate<CheckBox>(Template)),
},
},
new Style(x => x.OfType<CheckBox>().Template().Name("checkMark"))
@ -45,7 +51,12 @@ namespace Perspex.Themes.Default
});
}
private Control Template(CheckBox control)
/// <summary>
/// The default template for a <see cref="CheckBox"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(CheckBox control)
{
Border result = new Border
{

15
src/Perspex.Themes.Default/ContentControlStyle.cs

@ -12,8 +12,14 @@ namespace Perspex.Themes.Default
using Perspex.Controls.Templates;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="ContentControl"/> control.
/// </summary>
public class ContentControlStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="ContentControlStyle"/> class.
/// </summary>
public ContentControlStyle()
{
this.AddRange(new[]
@ -22,13 +28,18 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(ContentControl.TemplateProperty, new ControlTemplate<ContentControl>(this.Template)),
new Setter(ContentControl.TemplateProperty, new ControlTemplate<ContentControl>(Template)),
},
},
});
}
private Control Template(ContentControl control)
/// <summary>
/// The default template for a <see cref="ContentControl"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(ContentControl control)
{
return new ContentPresenter
{

15
src/Perspex.Themes.Default/DeckStyle.cs

@ -12,8 +12,14 @@ namespace Perspex.Themes.Default
using Perspex.Controls.Templates;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="Deck"/> control.
/// </summary>
public class DeckStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="DeckStyle"/> class.
/// </summary>
public DeckStyle()
{
this.AddRange(new[]
@ -22,13 +28,18 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(Deck.TemplateProperty, new ControlTemplate<Deck>(this.Template)),
new Setter(Deck.TemplateProperty, new ControlTemplate<Deck>(Template)),
},
},
});
}
private Control Template(Deck control)
/// <summary>
/// The default template for the <see cref="Deck"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(Deck control)
{
return new DeckPresenter
{

6
src/Perspex.Themes.Default/DefaultTheme.cs

@ -8,8 +8,14 @@ namespace Perspex.Themes.Default
{
using Perspex.Styling;
/// <summary>
/// The default Perspex theme.
/// </summary>
public class DefaultTheme : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="DefaultTheme"/> class.
/// </summary>
public DefaultTheme()
{
this.Add(new FocusAdornerStyle());

19
src/Perspex.Themes.Default/DropDownStyle.cs

@ -18,8 +18,14 @@ namespace Perspex.Themes.Default
using Perspex.Media;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="DropDown"/> control.
/// </summary>
public class DropDownStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="DropDownStyle"/> class.
/// </summary>
public DropDownStyle()
{
this.AddRange(new[]
@ -28,7 +34,7 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(DropDown.TemplateProperty, new ControlTemplate<DropDown>(this.Template)),
new Setter(DropDown.TemplateProperty, new ControlTemplate<DropDown>(Template)),
new Setter(DropDown.BorderBrushProperty, new SolidColorBrush(0xff707070)),
new Setter(DropDown.BorderThicknessProperty, 2.0),
new Setter(DropDown.FocusAdornerProperty, new FuncTemplate<IControl>(FocusAdornerTemplate)),
@ -46,6 +52,10 @@ namespace Perspex.Themes.Default
});
}
/// <summary>
/// The default template for a <see cref="DropDown"/> control's focus adorner.
/// </summary>
/// <returns>The root of the instantiated template.</returns>
public static Control FocusAdornerTemplate()
{
return new Rectangle
@ -57,7 +67,12 @@ namespace Perspex.Themes.Default
};
}
private Control Template(DropDown control)
/// <summary>
/// The default template for a <see cref="DropDown"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(DropDown control)
{
Border result = new Border
{

14
src/Perspex.Themes.Default/FocusAdornerStyle.cs

@ -13,8 +13,14 @@ namespace Perspex.Themes.Default
using Perspex.Media;
using Perspex.Styling;
/// <summary>
/// The default style for a focus adorner.
/// </summary>
public class FocusAdornerStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="FocusAdornerStyle"/> class.
/// </summary>
public FocusAdornerStyle()
{
this.AddRange(new[]
@ -23,13 +29,17 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(Control.FocusAdornerProperty, new FuncTemplate<IControl>(this.Template)),
new Setter(Control.FocusAdornerProperty, new FuncTemplate<IControl>(Template)),
},
},
});
}
private Control Template()
/// <summary>
/// The default template for focus adorner.
/// </summary>
/// <returns>The root of the instantiated template.</returns>
public static Control Template()
{
return new Rectangle
{

15
src/Perspex.Themes.Default/GridSplitterStyle.cs

@ -11,8 +11,14 @@ namespace Perspex.Themes.Default
using Perspex.Controls.Templates;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="GridSplitter"/> control.
/// </summary>
public class GridSplitterStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="GridSplitterStyle"/> class.
/// </summary>
public GridSplitterStyle()
{
this.AddRange(new[]
@ -21,14 +27,19 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(GridSplitter.TemplateProperty, new ControlTemplate<GridSplitter>(this.Template)),
new Setter(GridSplitter.TemplateProperty, new ControlTemplate<GridSplitter>(Template)),
new Setter(GridSplitter.WidthProperty, 4.0),
},
},
});
}
private Control Template(GridSplitter control)
/// <summary>
/// The default template for a <see cref="GridSplitter"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(GridSplitter control)
{
Border border = new Border
{

15
src/Perspex.Themes.Default/ItemsControlStyle.cs

@ -12,8 +12,14 @@ namespace Perspex.Themes.Default
using Perspex.Controls.Templates;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="ItemsControl"/> control.
/// </summary>
public class ItemsControlStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="ItemsControlStyle"/> class.
/// </summary>
public ItemsControlStyle()
{
this.AddRange(new[]
@ -22,13 +28,18 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(Button.TemplateProperty, new ControlTemplate<ItemsControl>(this.Template)),
new Setter(Button.TemplateProperty, new ControlTemplate<ItemsControl>(Template)),
},
},
});
}
private Control Template(ItemsControl control)
/// <summary>
/// The default template for an <see cref="ItemsControl"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(ItemsControl control)
{
return new ItemsPresenter
{

15
src/Perspex.Themes.Default/ListBoxItemStyle.cs

@ -13,8 +13,14 @@ namespace Perspex.Themes.Default
using Perspex.Media;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="ListBoxItem"/> control.
/// </summary>
public class ListBoxItemStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="ListBoxItemStyle"/> class.
/// </summary>
public ListBoxItemStyle()
{
this.AddRange(new[]
@ -23,7 +29,7 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(ListBoxItem.TemplateProperty, new ControlTemplate<ListBoxItem>(this.Template)),
new Setter(ListBoxItem.TemplateProperty, new ControlTemplate<ListBoxItem>(Template)),
},
},
new Style(x => x.OfType<ListBoxItem>().Class("selected").Template().Name("border"))
@ -44,7 +50,12 @@ namespace Perspex.Themes.Default
});
}
private Control Template(ListBoxItem control)
/// <summary>
/// The default template for a <see cref="ListBoxItem"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(ListBoxItem control)
{
return new Border
{

15
src/Perspex.Themes.Default/ListBoxStyle.cs

@ -13,8 +13,14 @@ namespace Perspex.Themes.Default
using Perspex.Media;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="ListBox"/> control.
/// </summary>
public class ListBoxStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="ListBoxStyle"/> class.
/// </summary>
public ListBoxStyle()
{
this.AddRange(new[]
@ -23,7 +29,7 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(ListBox.TemplateProperty, new ControlTemplate<ListBox>(this.Template)),
new Setter(ListBox.TemplateProperty, new ControlTemplate<ListBox>(Template)),
new Setter(ListBox.BorderBrushProperty, Brushes.Black),
new Setter(ListBox.BorderThicknessProperty, 1.0),
},
@ -31,7 +37,12 @@ namespace Perspex.Themes.Default
});
}
private Control Template(ListBox control)
/// <summary>
/// The default template for a <see cref="ListBox"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(ListBox control)
{
return new Border
{

24
src/Perspex.Themes.Default/MenuItemStyle.cs

@ -17,11 +17,17 @@ namespace Perspex.Themes.Default
using Perspex.Media;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="MenuItem"/> control.
/// </summary>
public class MenuItemStyle : Styles
{
private static readonly DataTemplate AccessKeyDataTemplate =
new DataTemplate<string>(x => new AccessText { Text = x });
/// <summary>
/// Initializes a new instance of the <see cref="MenuItemStyle"/> class.
/// </summary>
public MenuItemStyle()
{
this.AddRange(new[]
@ -32,14 +38,14 @@ namespace Perspex.Themes.Default
{
new Setter(MenuItem.BorderThicknessProperty, 1.0),
new Setter(MenuItem.PaddingProperty, new Thickness(6, 0)),
new Setter(MenuItem.TemplateProperty, new ControlTemplate<MenuItem>(this.PopupTemplate)),
new Setter(MenuItem.TemplateProperty, new ControlTemplate<MenuItem>(PopupTemplate)),
},
},
new Style(x => x.OfType<Menu>().Child().OfType<MenuItem>())
{
Setters = new[]
{
new Setter(MenuItem.TemplateProperty, new ControlTemplate<MenuItem>(this.TopLevelTemplate)),
new Setter(MenuItem.TemplateProperty, new ControlTemplate<MenuItem>(TopLevelTemplate)),
},
},
new Style(x => x.OfType<MenuItem>().Class("selected").Template().Name("root"))
@ -68,7 +74,12 @@ namespace Perspex.Themes.Default
});
}
private Control TopLevelTemplate(MenuItem control)
/// <summary>
/// The default template for a top-level <see cref="MenuItem"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control TopLevelTemplate(MenuItem control)
{
Popup popup;
@ -139,7 +150,12 @@ namespace Perspex.Themes.Default
return result;
}
private Control PopupTemplate(MenuItem control)
/// <summary>
/// The default template for a popup <see cref="MenuItem"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control PopupTemplate(MenuItem control)
{
Popup popup;

15
src/Perspex.Themes.Default/MenuStyle.cs

@ -13,8 +13,14 @@ namespace Perspex.Themes.Default
using Perspex.Input;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="Menu"/> control.
/// </summary>
public class MenuStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="MenuStyle"/> class.
/// </summary>
public MenuStyle()
{
this.AddRange(new[]
@ -23,13 +29,18 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(Menu.TemplateProperty, new ControlTemplate<Menu>(this.Template)),
new Setter(Menu.TemplateProperty, new ControlTemplate<Menu>(Template)),
},
},
});
}
private Control Template(Menu control)
/// <summary>
/// The default template for the <see cref="Menu"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(Menu control)
{
return new Border
{

15
src/Perspex.Themes.Default/PopupRootStyle.cs

@ -13,8 +13,14 @@ namespace Perspex.Themes.Default
using Perspex.Controls.Templates;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="PopupRoot"/> control.
/// </summary>
public class PopupRootStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="PopupRootStyle"/> class.
/// </summary>
public PopupRootStyle()
{
this.AddRange(new[]
@ -23,7 +29,7 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(PopupRoot.TemplateProperty, new ControlTemplate<PopupRoot>(this.Template)),
new Setter(PopupRoot.TemplateProperty, new ControlTemplate<PopupRoot>(Template)),
new Setter(PopupRoot.FontFamilyProperty, "Segoe UI"),
new Setter(PopupRoot.FontSizeProperty, 12.0),
},
@ -31,7 +37,12 @@ namespace Perspex.Themes.Default
});
}
private Control Template(PopupRoot control)
/// <summary>
/// The default template for the <see cref="PopupRoot"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(PopupRoot control)
{
return new Border
{

15
src/Perspex.Themes.Default/ProgressBarStyle.cs

@ -17,8 +17,14 @@ namespace Perspex.Themes.Default
using Perspex.Media;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="ProgressBar"/> control.
/// </summary>
public class ProgressBarStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="ProgressBarStyle"/> class.
/// </summary>
public ProgressBarStyle()
{
this.AddRange(new[]
@ -27,7 +33,7 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(ProgressBar.TemplateProperty, new ControlTemplate<ProgressBar>(this.Template)),
new Setter(ProgressBar.TemplateProperty, new ControlTemplate<ProgressBar>(Template)),
new Setter(ProgressBar.BackgroundProperty, new SolidColorBrush(0xffdddddd)),
new Setter(ProgressBar.ForegroundProperty, new SolidColorBrush(0xffbee6fd)),
},
@ -35,7 +41,12 @@ namespace Perspex.Themes.Default
});
}
private Control Template(ProgressBar control)
/// <summary>
/// The default template for the <see cref="ProgressBar"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(ProgressBar control)
{
Border container = new Border
{

15
src/Perspex.Themes.Default/RadioButtonStyle.cs

@ -15,8 +15,14 @@ namespace Perspex.Themes.Default
using Perspex.Media;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="RadioButton"/> control.
/// </summary>
public class RadioButtonStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="RadioButtonStyle"/> class.
/// </summary>
public RadioButtonStyle()
{
this.AddRange(new[]
@ -25,7 +31,7 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(Button.TemplateProperty, new ControlTemplate<RadioButton>(this.Template)),
new Setter(Button.TemplateProperty, new ControlTemplate<RadioButton>(Template)),
},
},
new Style(x => x.OfType<RadioButton>().Template().Name("checkMark"))
@ -45,7 +51,12 @@ namespace Perspex.Themes.Default
});
}
private Control Template(RadioButton control)
/// <summary>
/// The default template for the <see cref="RadioButton"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(RadioButton control)
{
Border result = new Border
{

26
src/Perspex.Themes.Default/ScrollBarStyle.cs

@ -14,8 +14,14 @@ namespace Perspex.Themes.Default
using Perspex.Media;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="ScrollBar"/> control.
/// </summary>
public class ScrollBarStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="ScrollBarStyle"/> class.
/// </summary>
public ScrollBarStyle()
{
this.AddRange(new[]
@ -24,14 +30,13 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(ScrollBar.TemplateProperty, new ControlTemplate<ScrollBar>(this.Template)),
new Setter(ScrollBar.TemplateProperty, new ControlTemplate<ScrollBar>(Template)),
},
},
new Style(x => x.OfType<ScrollBar>().PropertyEquals(ScrollBar.OrientationProperty, Orientation.Horizontal))
{
Setters = new[]
{
new Setter(ScrollBar.TemplateProperty, new ControlTemplate<ScrollBar>(this.Template)),
new Setter(ScrollBar.HeightProperty, 10.0),
},
},
@ -46,7 +51,6 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(ScrollBar.TemplateProperty, new ControlTemplate<ScrollBar>(this.Template)),
new Setter(ScrollBar.WidthProperty, 10.0),
},
},
@ -60,7 +64,12 @@ namespace Perspex.Themes.Default
});
}
private Control Template(ScrollBar control)
/// <summary>
/// The default template for the <see cref="ScrollBar"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(ScrollBar control)
{
return new Border
{
@ -76,13 +85,18 @@ namespace Perspex.Themes.Default
Thumb = new Thumb
{
Name = "thumb",
Template = new ControlTemplate<Thumb>(this.ThumbTemplate),
Template = new ControlTemplate<Thumb>(ThumbTemplate),
},
},
};
}
private Control ThumbTemplate(Thumb control)
/// <summary>
/// The default template for the <see cref="ScrollBar"/>'s <see cref="Thumb"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control ThumbTemplate(Thumb control)
{
return new Border
{

15
src/Perspex.Themes.Default/ScrollViewerStyle.cs

@ -13,8 +13,14 @@ namespace Perspex.Themes.Default
using Perspex.Controls.Templates;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="ScrollViewer"/> control.
/// </summary>
public class ScrollViewerStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="ScrollViewerStyle"/> class.
/// </summary>
public ScrollViewerStyle()
{
this.AddRange(new[]
@ -23,13 +29,18 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(ScrollViewer.TemplateProperty, new ControlTemplate<ScrollViewer>(this.Template)),
new Setter(ScrollViewer.TemplateProperty, new ControlTemplate<ScrollViewer>(Template)),
},
},
});
}
private Control Template(ScrollViewer control)
/// <summary>
/// The default template for the <see cref="ScrollViewer"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(ScrollViewer control)
{
var result = new Grid
{

15
src/Perspex.Themes.Default/TabControlStyle.cs

@ -13,8 +13,14 @@ namespace Perspex.Themes.Default
using Perspex.Controls.Templates;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="TabControl"/> control.
/// </summary>
public class TabControlStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="TabControlStyle"/> class.
/// </summary>
public TabControlStyle()
{
this.AddRange(new[]
@ -23,13 +29,18 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(TabControl.TemplateProperty, new ControlTemplate<TabControl>(this.Template)),
new Setter(TabControl.TemplateProperty, new ControlTemplate<TabControl>(Template)),
},
},
});
}
private Control Template(TabControl control)
/// <summary>
/// The default template for the <see cref="TabControl"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(TabControl control)
{
return new Grid
{

15
src/Perspex.Themes.Default/TabItemStyle.cs

@ -13,8 +13,14 @@ namespace Perspex.Themes.Default
using Perspex.Media;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="TabItem"/> control.
/// </summary>
public class TabItemStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="TabItemStyle"/> class.
/// </summary>
public TabItemStyle()
{
this.AddRange(new[]
@ -25,7 +31,7 @@ namespace Perspex.Themes.Default
{
new Setter(TabItem.FontSizeProperty, 28.7),
new Setter(TabItem.ForegroundProperty, Brushes.Gray),
new Setter(TabItem.TemplateProperty, new ControlTemplate<TabItem>(this.Template)),
new Setter(TabItem.TemplateProperty, new ControlTemplate<TabItem>(Template)),
},
},
new Style(x => x.OfType<TabItem>().Class("selected"))
@ -38,7 +44,12 @@ namespace Perspex.Themes.Default
});
}
private Control Template(TabItem control)
/// <summary>
/// The default template for the <see cref="TabItem"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(TabItem control)
{
return new ContentPresenter
{

15
src/Perspex.Themes.Default/TabStripStyle.cs

@ -13,8 +13,14 @@ namespace Perspex.Themes.Default
using Perspex.Controls.Templates;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="TabStrip"/> control.
/// </summary>
public class TabStripStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="TabStripStyle"/> class.
/// </summary>
public TabStripStyle()
{
this.AddRange(new[]
@ -23,7 +29,7 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(TabStrip.TemplateProperty, new ControlTemplate<TabStrip>(this.Template)),
new Setter(TabStrip.TemplateProperty, new ControlTemplate<TabStrip>(Template)),
},
},
new Style(x => x.OfType<TabStrip>().Template().OfType<StackPanel>())
@ -37,7 +43,12 @@ namespace Perspex.Themes.Default
});
}
private Control Template(TabStrip control)
/// <summary>
/// The default template for the <see cref="TabStrip"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(TabStrip control)
{
return new ItemsPresenter
{

15
src/Perspex.Themes.Default/TextBoxStyle.cs

@ -13,8 +13,14 @@ namespace Perspex.Themes.Default
using Perspex.Media;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="TextBox"/> control.
/// </summary>
public class TextBoxStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="TextBoxStyle"/> class.
/// </summary>
public TextBoxStyle()
{
this.AddRange(new[]
@ -23,7 +29,7 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(TextBox.TemplateProperty, new ControlTemplate<TextBox>(this.Template)),
new Setter(TextBox.TemplateProperty, new ControlTemplate<TextBox>(Template)),
new Setter(TextBox.BorderBrushProperty, new SolidColorBrush(0xff707070)),
new Setter(TextBox.BorderThicknessProperty, 2.0),
new Setter(TextBox.FocusAdornerProperty, null),
@ -39,7 +45,12 @@ namespace Perspex.Themes.Default
});
}
private Control Template(TextBox control)
/// <summary>
/// The default template for the <see cref="TextBox"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(TextBox control)
{
Border result = new Border
{

15
src/Perspex.Themes.Default/ToggleButtonStyle.cs

@ -15,8 +15,14 @@ namespace Perspex.Themes.Default
using Perspex.Media;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="ToggleButton"/> control.
/// </summary>
public class ToggleButtonStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="ToggleButtonStyle"/> class.
/// </summary>
public ToggleButtonStyle()
{
this.AddRange(new[]
@ -25,7 +31,7 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(ToggleButton.TemplateProperty, new ControlTemplate<ToggleButton>(this.Template)),
new Setter(ToggleButton.TemplateProperty, new ControlTemplate<ToggleButton>(Template)),
new Setter(ToggleButton.BackgroundProperty, new SolidColorBrush(0xffdddddd)),
new Setter(ToggleButton.BorderBrushProperty, new SolidColorBrush(0xff707070)),
new Setter(ToggleButton.BorderThicknessProperty, 2.0),
@ -81,7 +87,12 @@ namespace Perspex.Themes.Default
});
}
private Control Template(ToggleButton control)
/// <summary>
/// The default template for the <see cref="ToggleButton"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(ToggleButton control)
{
Border border = new Border
{

15
src/Perspex.Themes.Default/ToolTipStyle.cs

@ -13,8 +13,14 @@ namespace Perspex.Themes.Default
using Perspex.Media;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="ToolTip"/> control.
/// </summary>
public class ToolTipStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="ToolTipStyle"/> class.
/// </summary>
public ToolTipStyle()
{
this.AddRange(new[]
@ -23,7 +29,7 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(ToolTip.TemplateProperty, new ControlTemplate<ToolTip>(this.Template)),
new Setter(ToolTip.TemplateProperty, new ControlTemplate<ToolTip>(Template)),
new Setter(ToolTip.BackgroundProperty, new SolidColorBrush(0xffffffe1)),
new Setter(ToolTip.BorderBrushProperty, Brushes.Gray),
new Setter(ToolTip.BorderThicknessProperty, 1.0),
@ -33,7 +39,12 @@ namespace Perspex.Themes.Default
});
}
private Control Template(ToolTip control)
/// <summary>
/// The default template for the <see cref="ToolTip"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(ToolTip control)
{
return new Border
{

15
src/Perspex.Themes.Default/TreeViewItemStyle.cs

@ -16,8 +16,14 @@ namespace Perspex.Themes.Default
using Perspex.Media;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="TreeViewItem"/> control.
/// </summary>
public class TreeViewItemStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="TreeViewItemStyle"/> class.
/// </summary>
public TreeViewItemStyle()
{
this.AddRange(new[]
@ -26,7 +32,7 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(TreeViewItem.TemplateProperty, new ControlTemplate<TreeViewItem>(this.Template)),
new Setter(TreeViewItem.TemplateProperty, new ControlTemplate<TreeViewItem>(Template)),
new Setter(TreeViewItem.FocusAdornerProperty, null),
},
},
@ -76,7 +82,12 @@ namespace Perspex.Themes.Default
});
}
private Control Template(TreeViewItem control)
/// <summary>
/// The default template for the <see cref="TreeViewItem"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(TreeViewItem control)
{
return new StackPanel
{

15
src/Perspex.Themes.Default/TreeViewStyle.cs

@ -13,8 +13,14 @@ namespace Perspex.Themes.Default
using Perspex.Media;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="TreeView"/> control.
/// </summary>
public class TreeViewStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="TreeViewStyle"/> class.
/// </summary>
public TreeViewStyle()
{
this.AddRange(new[]
@ -23,7 +29,7 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(TreeView.TemplateProperty, new ControlTemplate<TreeView>(this.Template)),
new Setter(TreeView.TemplateProperty, new ControlTemplate<TreeView>(Template)),
new Setter(TreeView.BorderBrushProperty, Brushes.Black),
new Setter(TreeView.BorderThicknessProperty, 1.0),
},
@ -31,7 +37,12 @@ namespace Perspex.Themes.Default
});
}
private Control Template(TreeView control)
/// <summary>
/// The default template for the <see cref="TreeView"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(TreeView control)
{
return new Border
{

15
src/Perspex.Themes.Default/WindowStyle.cs

@ -13,8 +13,14 @@ namespace Perspex.Themes.Default
using Perspex.Controls.Templates;
using Perspex.Styling;
/// <summary>
/// The default style for the <see cref="Window"/> control.
/// </summary>
public class WindowStyle : Styles
{
/// <summary>
/// Initializes a new instance of the <see cref="WindowStyle"/> class.
/// </summary>
public WindowStyle()
{
this.AddRange(new[]
@ -23,7 +29,7 @@ namespace Perspex.Themes.Default
{
Setters = new[]
{
new Setter(Window.TemplateProperty, new ControlTemplate<Window>(this.Template)),
new Setter(Window.TemplateProperty, new ControlTemplate<Window>(Template)),
new Setter(Window.FontFamilyProperty, "Segoe UI"),
new Setter(Window.FontSizeProperty, 12.0),
},
@ -31,7 +37,12 @@ namespace Perspex.Themes.Default
});
}
private Control Template(Window control)
/// <summary>
/// The default template for the <see cref="Window"/> control.
/// </summary>
/// <param name="control">The control being styled.</param>
/// <returns>The root of the instantiated template.</returns>
public static Control Template(Window control)
{
return new Border
{

Loading…
Cancel
Save