diff --git a/src/Avalonia.Controls/ToggleSwitch.cs b/src/Avalonia.Controls/ToggleSwitch.cs
index 7f9130c63a..a28e9791f6 100644
--- a/src/Avalonia.Controls/ToggleSwitch.cs
+++ b/src/Avalonia.Controls/ToggleSwitch.cs
@@ -9,8 +9,10 @@ namespace Avalonia.Controls
///
/// A Toggle Switch control.
///
- [TemplatePart("PART_MovingKnobs", typeof(Panel))]
- [TemplatePart("PART_SwitchKnob", typeof(Panel))]
+ [TemplatePart("PART_MovingKnobs", typeof(Panel))]
+ [TemplatePart("PART_OffContentPresenter", typeof(ContentPresenter))]
+ [TemplatePart("PART_OnContentPresenter", typeof(ContentPresenter))]
+ [TemplatePart("PART_SwitchKnob", typeof(Panel))]
[PseudoClasses(":dragging")]
public class ToggleSwitch : ToggleButton
{
@@ -163,8 +165,8 @@ namespace Avalonia.Controls
{
base.OnApplyTemplate(e);
- _switchKnob = e.NameScope.Find("SwitchKnob");
- _knobsPanel = e.NameScope.Get("MovingKnobs");
+ _switchKnob = e.NameScope.Find("PART_SwitchKnob");
+ _knobsPanel = e.NameScope.Get("PART_MovingKnobs");
_knobsPanel.PointerPressed += KnobsPanel_PointerPressed;
_knobsPanel.PointerReleased += KnobsPanel_PointerReleased;
diff --git a/src/Avalonia.Dialogs/ManagedFileChooser.cs b/src/Avalonia.Dialogs/ManagedFileChooser.cs
index 83a84eed33..12436680b3 100644
--- a/src/Avalonia.Dialogs/ManagedFileChooser.cs
+++ b/src/Avalonia.Dialogs/ManagedFileChooser.cs
@@ -90,8 +90,8 @@ namespace Avalonia.Dialogs
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
- _quickLinksRoot = e.NameScope.Get("QuickLinks");
- _filesView = e.NameScope.Get("Files");
+ _quickLinksRoot = e.NameScope.Get("PART_QuickLinks");
+ _filesView = e.NameScope.Get("PART_Files");
}
}
}