diff --git a/src/Avalonia.Controls/AutoCompleteBox.cs b/src/Avalonia.Controls/AutoCompleteBox.cs
index 0e946126ea..0f6bfd7b2f 100644
--- a/src/Avalonia.Controls/AutoCompleteBox.cs
+++ b/src/Avalonia.Controls/AutoCompleteBox.cs
@@ -252,6 +252,10 @@ namespace Avalonia.Controls
/// drop-down that contains possible matches based on the input in the text
/// box.
///
+ [TemplatePart(ElementPopup, typeof(Popup))]
+ [TemplatePart(ElementSelector, typeof(SelectingItemsControl))]
+ [TemplatePart(ElementSelectionAdapter, typeof(ISelectionAdapter))]
+ [TemplatePart(ElementTextBox, typeof(TextBox))]
[PseudoClasses(":dropdownopen")]
public class AutoCompleteBox : TemplatedControl
{
diff --git a/src/Avalonia.Controls/ButtonSpinner.cs b/src/Avalonia.Controls/ButtonSpinner.cs
index f1c1a55a17..7854dd4f93 100644
--- a/src/Avalonia.Controls/ButtonSpinner.cs
+++ b/src/Avalonia.Controls/ButtonSpinner.cs
@@ -16,6 +16,8 @@ namespace Avalonia.Controls
///
/// Represents a spinner control that includes two Buttons.
///
+ [TemplatePart("PART_DecreaseButton", typeof(Button))]
+ [TemplatePart("PART_IncreaseButton", typeof(Button))]
[PseudoClasses(":left", ":right")]
public class ButtonSpinner : Spinner
{
diff --git a/src/Avalonia.Controls/Calendar/Calendar.cs b/src/Avalonia.Controls/Calendar/Calendar.cs
index 2c8a7c0831..85e37c4a47 100644
--- a/src/Avalonia.Controls/Calendar/Calendar.cs
+++ b/src/Avalonia.Controls/Calendar/Calendar.cs
@@ -6,6 +6,7 @@
using System;
using System.Collections.ObjectModel;
using System.Diagnostics;
+using Avalonia.Controls.Metadata;
using Avalonia.Controls.Primitives;
using Avalonia.Data;
using Avalonia.Input;
@@ -222,6 +223,8 @@ namespace Avalonia.Controls
/// element in XAML.
///
///
+ [TemplatePart(PART_ElementMonth, typeof(CalendarItem))]
+ [TemplatePart(PART_ElementRoot, typeof(Panel))]
public class Calendar : TemplatedControl
{
internal const int RowsPerMonth = 7;
@@ -261,6 +264,7 @@ namespace Avalonia.Controls
AvaloniaProperty.Register(
nameof(FirstDayOfWeek),
defaultValue: DateTimeHelper.GetCurrentDateFormat().FirstDayOfWeek);
+
///
/// Gets or sets the day that is considered the beginning of the week.
///
@@ -273,6 +277,7 @@ namespace Avalonia.Controls
get { return GetValue(FirstDayOfWeekProperty); }
set { SetValue(FirstDayOfWeekProperty, value); }
}
+
///
/// FirstDayOfWeekProperty property changed handler.
///
@@ -289,6 +294,7 @@ namespace Avalonia.Controls
throw new ArgumentOutOfRangeException("d", "Invalid DayOfWeek");
}
}
+
///
/// Inherited code: Requires comment.
///
@@ -311,6 +317,7 @@ namespace Avalonia.Controls
AvaloniaProperty.Register(
nameof(IsTodayHighlighted),
defaultValue: true);
+
///
/// Gets or sets a value indicating whether the current date is
/// highlighted.
@@ -324,6 +331,7 @@ namespace Avalonia.Controls
get { return GetValue(IsTodayHighlightedProperty); }
set { SetValue(IsTodayHighlightedProperty, value); }
}
+
///
/// IsTodayHighlightedProperty property changed handler.
///
@@ -343,6 +351,7 @@ namespace Avalonia.Controls
public static readonly StyledProperty HeaderBackgroundProperty =
AvaloniaProperty.Register(nameof(HeaderBackground));
+
public IBrush HeaderBackground
{
get { return GetValue(HeaderBackgroundProperty); }
@@ -367,6 +376,7 @@ namespace Avalonia.Controls
get { return GetValue(DisplayModeProperty); }
set { SetValue(DisplayModeProperty, value); }
}
+
///
/// DisplayModeProperty property changed handler.
///
@@ -424,6 +434,7 @@ namespace Avalonia.Controls
|| mode == CalendarMode.Year
|| mode == CalendarMode.Decade;
}
+
private void OnDisplayModeChanged(CalendarModeChangedEventArgs args)
{
DisplayModeChanged?.Invoke(this, args);
@@ -433,6 +444,7 @@ namespace Avalonia.Controls
AvaloniaProperty.Register(
nameof(SelectionMode),
defaultValue: CalendarSelectionMode.SingleDate);
+
///
/// Gets or sets a value that indicates what kind of selections are
/// allowed.
@@ -457,6 +469,7 @@ namespace Avalonia.Controls
get { return GetValue(SelectionModeProperty); }
set { SetValue(SelectionModeProperty, value); }
}
+
private void OnSelectionModeChanged(AvaloniaPropertyChangedEventArgs e)
{
if (IsValidSelectionMode(e.NewValue))
@@ -471,6 +484,7 @@ namespace Avalonia.Controls
throw new ArgumentOutOfRangeException("d", "Invalid SelectionMode");
}
}
+
///
/// Inherited code: Requires comment.
///
@@ -492,6 +506,7 @@ namespace Avalonia.Controls
o => o.SelectedDate,
(o, v) => o.SelectedDate = v,
defaultBindingMode: BindingMode.TwoWay);
+
///
/// Gets or sets the currently selected date.
///
@@ -720,6 +735,7 @@ namespace Avalonia.Controls
o => o.DisplayDate,
(o, v) => o.DisplayDate = v,
defaultBindingMode: BindingMode.TwoWay);
+
///
/// Gets or sets the date to display.
///
@@ -1959,6 +1975,7 @@ namespace Avalonia.Controls
}
}
}
+
private void Calendar_KeyUp(KeyEventArgs e)
{
if (!e.Handled && (e.Key == Key.LeftShift || e.Key == Key.RightShift))
@@ -1966,6 +1983,7 @@ namespace Avalonia.Controls
ProcessShiftKeyUp();
}
}
+
internal void ProcessShiftKeyUp()
{
if (_isShiftPressed && (SelectionMode == CalendarSelectionMode.SingleRange || SelectionMode == CalendarSelectionMode.MultipleRange))
@@ -2014,6 +2032,7 @@ namespace Avalonia.Controls
}
}
}
+
protected override void OnLostFocus(RoutedEventArgs e)
{
base.OnLostFocus(e);
@@ -2040,6 +2059,7 @@ namespace Avalonia.Controls
}
}
}
+
///
/// Called when the IsEnabled property changes.
///
@@ -2084,6 +2104,7 @@ namespace Avalonia.Controls
private const string PART_ElementRoot = "Root";
private const string PART_ElementMonth = "CalendarItem";
+
///
/// Builds the visual tree for the
/// when a new
diff --git a/src/Avalonia.Controls/Calendar/CalendarDatePicker.cs b/src/Avalonia.Controls/Calendar/CalendarDatePicker.cs
index 1d19393c77..01ec0572ca 100644
--- a/src/Avalonia.Controls/Calendar/CalendarDatePicker.cs
+++ b/src/Avalonia.Controls/Calendar/CalendarDatePicker.cs
@@ -7,6 +7,7 @@ using System;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Globalization;
+using Avalonia.Controls.Metadata;
using Avalonia.Controls.Primitives;
using Avalonia.Data;
using Avalonia.Input;
@@ -116,6 +117,10 @@ namespace Avalonia.Controls
Custom = 2
}
+ [TemplatePart(ElementButton, typeof(Button))]
+ [TemplatePart(ElementCalendar, typeof(Calendar))]
+ [TemplatePart(ElementPopup, typeof(Popup))]
+ [TemplatePart(ElementTextBox, typeof(TextBox))]
public class CalendarDatePicker : TemplatedControl
{
private const string ElementTextBox = "PART_TextBox";
diff --git a/src/Avalonia.Controls/Calendar/CalendarItem.cs b/src/Avalonia.Controls/Calendar/CalendarItem.cs
index e830717b95..3bbba5f590 100644
--- a/src/Avalonia.Controls/Calendar/CalendarItem.cs
+++ b/src/Avalonia.Controls/Calendar/CalendarItem.cs
@@ -19,6 +19,11 @@ namespace Avalonia.Controls.Primitives
/// Represents the currently displayed month or year on a
/// .
///
+ [TemplatePart(PART_ElementHeaderButton, typeof(Button))]
+ [TemplatePart(PART_ElementMonthView, typeof(Grid))]
+ [TemplatePart(PART_ElementNextButton, typeof(Button))]
+ [TemplatePart(PART_ElementPreviousButton, typeof(Button))]
+ [TemplatePart(PART_ElementYearView, typeof(Grid))]
[PseudoClasses(":calendardisabled")]
public sealed class CalendarItem : TemplatedControl
{
diff --git a/src/Avalonia.Controls/Chrome/CaptionButtons.cs b/src/Avalonia.Controls/Chrome/CaptionButtons.cs
index be15d3d444..ab35863d17 100644
--- a/src/Avalonia.Controls/Chrome/CaptionButtons.cs
+++ b/src/Avalonia.Controls/Chrome/CaptionButtons.cs
@@ -10,6 +10,10 @@ namespace Avalonia.Controls.Chrome
///
/// Draws window minimize / maximize / close buttons in a when managed client decorations are enabled.
///
+ [TemplatePart("PART_CloseButton", typeof(Panel))]
+ [TemplatePart("PART_RestoreButton", typeof(Panel))]
+ [TemplatePart("PART_MinimiseButton", typeof(Panel))]
+ [TemplatePart("PART_FullScreenButton", typeof(Panel))]
[PseudoClasses(":minimized", ":normal", ":maximized", ":fullscreen")]
public class CaptionButtons : TemplatedControl
{
diff --git a/src/Avalonia.Controls/Chrome/TitleBar.cs b/src/Avalonia.Controls/Chrome/TitleBar.cs
index fbddb06952..fff52e4f21 100644
--- a/src/Avalonia.Controls/Chrome/TitleBar.cs
+++ b/src/Avalonia.Controls/Chrome/TitleBar.cs
@@ -10,6 +10,7 @@ namespace Avalonia.Controls.Chrome
///
/// Draws a titlebar when managed client decorations are enabled.
///
+ [TemplatePart("PART_CaptionButtons", typeof(CaptionButtons))]
[PseudoClasses(":minimized", ":normal", ":maximized", ":fullscreen")]
public class TitleBar : TemplatedControl
{
diff --git a/src/Avalonia.Controls/ComboBox.cs b/src/Avalonia.Controls/ComboBox.cs
index 274696d501..b15f2abb8d 100644
--- a/src/Avalonia.Controls/ComboBox.cs
+++ b/src/Avalonia.Controls/ComboBox.cs
@@ -14,12 +14,14 @@ using Avalonia.LogicalTree;
using Avalonia.Media;
using Avalonia.Threading;
using Avalonia.VisualTree;
+using Avalonia.Controls.Metadata;
namespace Avalonia.Controls
{
///
/// A drop-down list control.
///
+ [TemplatePart("PART_Popup", typeof(Popup))]
public class ComboBox : SelectingItemsControl
{
///
diff --git a/src/Avalonia.Controls/ContentControl.cs b/src/Avalonia.Controls/ContentControl.cs
index 1329bd91c7..a23de17ef8 100644
--- a/src/Avalonia.Controls/ContentControl.cs
+++ b/src/Avalonia.Controls/ContentControl.cs
@@ -1,4 +1,5 @@
using Avalonia.Collections;
+using Avalonia.Controls.Metadata;
using Avalonia.Controls.Mixins;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
@@ -12,6 +13,7 @@ namespace Avalonia.Controls
///
/// Displays according to a .
///
+ [TemplatePart("PART_ContentPresenter", typeof(IContentPresenter))]
public class ContentControl : TemplatedControl, IContentControl, IContentPresenterHost
{
///
diff --git a/src/Avalonia.Controls/DateTimePickers/DatePicker.cs b/src/Avalonia.Controls/DateTimePickers/DatePicker.cs
index 771f8a176b..68549177b1 100644
--- a/src/Avalonia.Controls/DateTimePickers/DatePicker.cs
+++ b/src/Avalonia.Controls/DateTimePickers/DatePicker.cs
@@ -14,6 +14,15 @@ namespace Avalonia.Controls
///
/// A control to allow the user to select a date
///
+ [TemplatePart("ButtonContentGrid", typeof(Grid))]
+ [TemplatePart("DayText", typeof(TextBlock))]
+ [TemplatePart("FirstSpacer", typeof(Rectangle))]
+ [TemplatePart("FlyoutButton", typeof(Button))]
+ [TemplatePart("MonthText", typeof(TextBlock))]
+ [TemplatePart("PickerPresenter", typeof(DatePickerPresenter))]
+ [TemplatePart("Popup", typeof(Popup))]
+ [TemplatePart("SecondSpacer", typeof(Rectangle))]
+ [TemplatePart("YearText", typeof(TextBlock))]
[PseudoClasses(":hasnodate")]
public class DatePicker : TemplatedControl
{
diff --git a/src/Avalonia.Controls/DateTimePickers/DatePickerPresenter.cs b/src/Avalonia.Controls/DateTimePickers/DatePickerPresenter.cs
index 91375e4eaf..50fceda160 100644
--- a/src/Avalonia.Controls/DateTimePickers/DatePickerPresenter.cs
+++ b/src/Avalonia.Controls/DateTimePickers/DatePickerPresenter.cs
@@ -1,4 +1,5 @@
-using Avalonia.Controls.Primitives;
+using Avalonia.Controls.Metadata;
+using Avalonia.Controls.Primitives;
using Avalonia.Controls.Shapes;
using Avalonia.Input;
using Avalonia.Interactivity;
@@ -12,6 +13,23 @@ namespace Avalonia.Controls
/// Defines the presenter used for selecting a date for a
///
///
+ [TemplatePart("AcceptButton", typeof(Button))]
+ [TemplatePart("DayDownButton", typeof(RepeatButton))]
+ [TemplatePart("DayHost", typeof(Panel))]
+ [TemplatePart("DaySelector", typeof(DateTimePickerPanel))]
+ [TemplatePart("DayUpButton", typeof(RepeatButton))]
+ [TemplatePart("DismissButton", typeof(Button))]
+ [TemplatePart("FirstSpacer", typeof(Rectangle))]
+ [TemplatePart("MonthDownButton", typeof(RepeatButton))]
+ [TemplatePart("MonthHost", typeof(Panel))]
+ [TemplatePart("MonthSelector", typeof(DateTimePickerPanel))]
+ [TemplatePart("MonthUpButton", typeof(RepeatButton))]
+ [TemplatePart("PickerContainer", typeof(Grid))]
+ [TemplatePart("SecondSpacer", typeof(Rectangle))]
+ [TemplatePart("YearDownButton", typeof(RepeatButton))]
+ [TemplatePart("YearHost", typeof(Panel))]
+ [TemplatePart("YearSelector", typeof(DateTimePickerPanel))]
+ [TemplatePart("YearUpButton", typeof(RepeatButton))]
public class DatePickerPresenter : PickerPresenterBase
{
///
diff --git a/src/Avalonia.Controls/DateTimePickers/TimePicker.cs b/src/Avalonia.Controls/DateTimePickers/TimePicker.cs
index 2921984f08..8c78662b95 100644
--- a/src/Avalonia.Controls/DateTimePickers/TimePicker.cs
+++ b/src/Avalonia.Controls/DateTimePickers/TimePicker.cs
@@ -12,6 +12,18 @@ namespace Avalonia.Controls
///
/// A control to allow the user to select a time.
///
+ [TemplatePart("FirstColumnDivider", typeof(Rectangle))]
+ [TemplatePart("FirstPickerHost", typeof(Border))]
+ [TemplatePart("FlyoutButton", typeof(Button))]
+ [TemplatePart("FlyoutButtonContentGrid", typeof(Grid))]
+ [TemplatePart("HourTextBlock", typeof(TextBlock))]
+ [TemplatePart("MinuteTextBlock", typeof(TextBlock))]
+ [TemplatePart("PeriodTextBlock", typeof(TextBlock))]
+ [TemplatePart("PickerPresenter", typeof(TimePickerPresenter))]
+ [TemplatePart("Popup", typeof(Popup))]
+ [TemplatePart("SecondColumnDivider", typeof(Rectangle))]
+ [TemplatePart("SecondPickerHost", typeof(Border))]
+ [TemplatePart("ThirdPickerHost", typeof(Border))]
[PseudoClasses(":hasnotime")]
public class TimePicker : TemplatedControl
{
diff --git a/src/Avalonia.Controls/DateTimePickers/TimePickerPresenter.cs b/src/Avalonia.Controls/DateTimePickers/TimePickerPresenter.cs
index ab9393ed4e..56f8875739 100644
--- a/src/Avalonia.Controls/DateTimePickers/TimePickerPresenter.cs
+++ b/src/Avalonia.Controls/DateTimePickers/TimePickerPresenter.cs
@@ -1,4 +1,5 @@
-using Avalonia.Controls.Primitives;
+using Avalonia.Controls.Metadata;
+using Avalonia.Controls.Primitives;
using Avalonia.Controls.Shapes;
using Avalonia.Input;
using Avalonia.Interactivity;
@@ -10,6 +11,20 @@ namespace Avalonia.Controls
/// Defines the presenter used for selecting a time. Intended for use with
/// but can be used independently
///
+ [TemplatePart("AcceptButton", typeof(Button))]
+ [TemplatePart("DismissButton", typeof(Button))]
+ [TemplatePart("HourDownButton", typeof(RepeatButton))]
+ [TemplatePart("HourSelector", typeof(DateTimePickerPanel))]
+ [TemplatePart("HourUpButton", typeof(RepeatButton))]
+ [TemplatePart("MinuteDownButton", typeof(RepeatButton))]
+ [TemplatePart("MinuteSelector", typeof(DateTimePickerPanel))]
+ [TemplatePart("MinuteUpButton", typeof(RepeatButton))]
+ [TemplatePart("PeriodDownButton", typeof(RepeatButton))]
+ [TemplatePart("PeriodHost", typeof(Panel))]
+ [TemplatePart("PeriodSelector", typeof(DateTimePickerPanel))]
+ [TemplatePart("PeriodUpButton", typeof(RepeatButton))]
+ [TemplatePart("PickerContainer", typeof(Grid))]
+ [TemplatePart("SecondSpacer", typeof(Rectangle))]
public class TimePickerPresenter : PickerPresenterBase
{
///
diff --git a/src/Avalonia.Controls/ListBox.cs b/src/Avalonia.Controls/ListBox.cs
index 43b4908482..08676655f6 100644
--- a/src/Avalonia.Controls/ListBox.cs
+++ b/src/Avalonia.Controls/ListBox.cs
@@ -1,5 +1,6 @@
using System.Collections;
using Avalonia.Controls.Generators;
+using Avalonia.Controls.Metadata;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
using Avalonia.Controls.Selection;
@@ -12,6 +13,7 @@ namespace Avalonia.Controls
///
/// An in which individual items can be selected.
///
+ [TemplatePart("PART_ScrollViewer", typeof(IScrollable))]
public class ListBox : SelectingItemsControl
{
///
diff --git a/src/Avalonia.Controls/MenuItem.cs b/src/Avalonia.Controls/MenuItem.cs
index 5e8fb46eb0..2df0dab535 100644
--- a/src/Avalonia.Controls/MenuItem.cs
+++ b/src/Avalonia.Controls/MenuItem.cs
@@ -21,6 +21,7 @@ namespace Avalonia.Controls
///
/// A menu item control.
///
+ [TemplatePart("PART_Popup", typeof(Popup))]
[PseudoClasses(":separator", ":icon", ":open", ":pressed", ":selected")]
public class MenuItem : HeaderedSelectingItemsControl, IMenuItem, ISelectable, ICommandSource
{
diff --git a/src/Avalonia.Controls/Notifications/WindowNotificationManager.cs b/src/Avalonia.Controls/Notifications/WindowNotificationManager.cs
index 8f5c6faf40..a5263940f4 100644
--- a/src/Avalonia.Controls/Notifications/WindowNotificationManager.cs
+++ b/src/Avalonia.Controls/Notifications/WindowNotificationManager.cs
@@ -14,6 +14,7 @@ namespace Avalonia.Controls.Notifications
///
/// An that displays notifications in a .
///
+ [TemplatePart("PART_Items", typeof(Panel))]
[PseudoClasses(":topleft", ":topright", ":bottomleft", ":bottomright")]
public class WindowNotificationManager : TemplatedControl, IManagedNotificationManager, ICustomSimpleHitTest
{
diff --git a/src/Avalonia.Controls/NumericUpDown/NumericUpDown.cs b/src/Avalonia.Controls/NumericUpDown/NumericUpDown.cs
index abfbc038eb..9f610710c9 100644
--- a/src/Avalonia.Controls/NumericUpDown/NumericUpDown.cs
+++ b/src/Avalonia.Controls/NumericUpDown/NumericUpDown.cs
@@ -2,6 +2,7 @@
using System.Globalization;
using System.IO;
using System.Linq;
+using Avalonia.Controls.Metadata;
using Avalonia.Controls.Primitives;
using Avalonia.Data;
using Avalonia.Input;
@@ -15,6 +16,8 @@ namespace Avalonia.Controls
///
/// Control that represents a TextBox with button spinners that allow incrementing and decrementing numeric values.
///
+ [TemplatePart("PART_Spinner", typeof(Spinner))]
+ [TemplatePart("PART_TextBox", typeof(TextBox))]
public class NumericUpDown : TemplatedControl
{
///
diff --git a/src/Avalonia.Controls/Primitives/ScrollBar.cs b/src/Avalonia.Controls/Primitives/ScrollBar.cs
index d5d6af8bfa..ff1c344f32 100644
--- a/src/Avalonia.Controls/Primitives/ScrollBar.cs
+++ b/src/Avalonia.Controls/Primitives/ScrollBar.cs
@@ -22,6 +22,10 @@ namespace Avalonia.Controls.Primitives
///
/// A scrollbar control.
///
+ [TemplatePart("PART_LineDownButton", typeof(Button))]
+ [TemplatePart("PART_LineUpButton", typeof(Button))]
+ [TemplatePart("PART_PageDownButton", typeof(Button))]
+ [TemplatePart("PART_PageUpButton", typeof(Button))]
[PseudoClasses(":vertical", ":horizontal")]
public class ScrollBar : RangeBase
{
diff --git a/src/Avalonia.Controls/ProgressBar.cs b/src/Avalonia.Controls/ProgressBar.cs
index 9ab5a73af0..10a3fddbce 100644
--- a/src/Avalonia.Controls/ProgressBar.cs
+++ b/src/Avalonia.Controls/ProgressBar.cs
@@ -9,6 +9,7 @@ namespace Avalonia.Controls
///
/// A control used to indicate the progress of an operation.
///
+ [TemplatePart("PART_Indicator", typeof(Border))]
[PseudoClasses(":vertical", ":horizontal", ":indeterminate")]
public class ProgressBar : RangeBase
{
diff --git a/src/Avalonia.Controls/ScrollViewer.cs b/src/Avalonia.Controls/ScrollViewer.cs
index 963f6ac4c5..14e1d39084 100644
--- a/src/Avalonia.Controls/ScrollViewer.cs
+++ b/src/Avalonia.Controls/ScrollViewer.cs
@@ -1,5 +1,6 @@
using System;
using System.Reactive.Linq;
+using Avalonia.Controls.Metadata;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
@@ -10,6 +11,8 @@ namespace Avalonia.Controls
///
/// A control scrolls its content if the content is bigger than the space available.
///
+ [TemplatePart("PART_HorizontalScrollBar", typeof(ScrollBar))]
+ [TemplatePart("PART_VerticalScrollBar", typeof(ScrollBar))]
public class ScrollViewer : ContentControl, IScrollable, IScrollAnchorProvider
{
///
diff --git a/src/Avalonia.Controls/Slider.cs b/src/Avalonia.Controls/Slider.cs
index 6af40b0281..bb374f097f 100644
--- a/src/Avalonia.Controls/Slider.cs
+++ b/src/Avalonia.Controls/Slider.cs
@@ -40,6 +40,9 @@ namespace Avalonia.Controls
///
/// A control that lets the user select from a range of values by moving a Thumb control along a Track.
///
+ [TemplatePart("PART_DecreaseButton", typeof(Button))]
+ [TemplatePart("PART_IncreaseButton", typeof(Button))]
+ [TemplatePart("PART_Track", typeof(Track))]
[PseudoClasses(":vertical", ":horizontal", ":pressed")]
public class Slider : RangeBase
{
diff --git a/src/Avalonia.Controls/SplitView.cs b/src/Avalonia.Controls/SplitView.cs
index 2ea58e6b0d..ddcda67915 100644
--- a/src/Avalonia.Controls/SplitView.cs
+++ b/src/Avalonia.Controls/SplitView.cs
@@ -77,6 +77,7 @@ namespace Avalonia.Controls
///
/// A control with two views: A collapsible pane and an area for content
///
+ [TemplatePart("PART_PaneRoot", typeof(Panel))]
[PseudoClasses(":open", ":closed")]
[PseudoClasses(":compactoverlay", ":compactinline", ":overlay", ":inline")]
[PseudoClasses(":left", ":right")]
diff --git a/src/Avalonia.Controls/TabControl.cs b/src/Avalonia.Controls/TabControl.cs
index 306a9d3e6a..af329e6035 100644
--- a/src/Avalonia.Controls/TabControl.cs
+++ b/src/Avalonia.Controls/TabControl.cs
@@ -9,12 +9,14 @@ using Avalonia.Input;
using Avalonia.Layout;
using Avalonia.LogicalTree;
using Avalonia.VisualTree;
+using Avalonia.Controls.Metadata;
namespace Avalonia.Controls
{
///
/// A tab control that displays a tab strip along with the content of the selected tab.
///
+ [TemplatePart("PART_ItemsPresenter", typeof(ItemsPresenter))]
public class TabControl : SelectingItemsControl, IContentPresenterHost
{
///
diff --git a/src/Avalonia.Controls/TextBox.cs b/src/Avalonia.Controls/TextBox.cs
index 51fa367936..a42c2d19a2 100644
--- a/src/Avalonia.Controls/TextBox.cs
+++ b/src/Avalonia.Controls/TextBox.cs
@@ -20,6 +20,7 @@ namespace Avalonia.Controls
///
/// Represents a control that can be used to display or edit unformatted text.
///
+ [TemplatePart("PART_TextPresenter", typeof(TextPresenter))]
[PseudoClasses(":empty")]
public class TextBox : TemplatedControl, UndoRedoHelper.IUndoRedoHost
{
diff --git a/src/Avalonia.Controls/ToggleSwitch.cs b/src/Avalonia.Controls/ToggleSwitch.cs
index 662a355dac..e45bce71c7 100644
--- a/src/Avalonia.Controls/ToggleSwitch.cs
+++ b/src/Avalonia.Controls/ToggleSwitch.cs
@@ -9,6 +9,8 @@ namespace Avalonia.Controls
///
/// A Toggle Switch control.
///
+ [TemplatePart("MovingKnobs", typeof(Panel))]
+ [TemplatePart("SwitchKnob", typeof(Panel))]
[PseudoClasses(":dragging")]
public class ToggleSwitch : ToggleButton
{
diff --git a/src/Avalonia.Controls/TopLevel.cs b/src/Avalonia.Controls/TopLevel.cs
index eaee5bdb50..2bc3b10328 100644
--- a/src/Avalonia.Controls/TopLevel.cs
+++ b/src/Avalonia.Controls/TopLevel.cs
@@ -1,5 +1,6 @@
using System;
using System.Reactive.Linq;
+using Avalonia.Controls.Metadata;
using Avalonia.Controls.Platform;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
@@ -26,6 +27,7 @@ namespace Avalonia.Controls
/// It handles scheduling layout, styling and rendering as well as
/// tracking the widget's .
///
+ [TemplatePart("PART_TransparencyFallback", typeof(Border))]
public abstract class TopLevel : ContentControl,
IInputRoot,
ILayoutRoot,
diff --git a/src/Avalonia.Controls/TreeViewItem.cs b/src/Avalonia.Controls/TreeViewItem.cs
index 88fb3cd9f1..11ae825b56 100644
--- a/src/Avalonia.Controls/TreeViewItem.cs
+++ b/src/Avalonia.Controls/TreeViewItem.cs
@@ -12,6 +12,7 @@ namespace Avalonia.Controls
///
/// An item in a .
///
+ [TemplatePart("PART_Header", typeof(IControl))]
[PseudoClasses(":pressed", ":selected")]
public class TreeViewItem : HeaderedItemsControl, ISelectable
{