Browse Source

Fix some template parts and template part names

pull/8793/head
robloo 4 years ago
parent
commit
337bba495b
  1. 10
      src/Avalonia.Controls/ToggleSwitch.cs
  2. 4
      src/Avalonia.Dialogs/ManagedFileChooser.cs

10
src/Avalonia.Controls/ToggleSwitch.cs

@ -9,8 +9,10 @@ namespace Avalonia.Controls
/// <summary>
/// A Toggle Switch control.
/// </summary>
[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<Panel>("SwitchKnob");
_knobsPanel = e.NameScope.Get<Panel>("MovingKnobs");
_switchKnob = e.NameScope.Find<Panel>("PART_SwitchKnob");
_knobsPanel = e.NameScope.Get<Panel>("PART_MovingKnobs");
_knobsPanel.PointerPressed += KnobsPanel_PointerPressed;
_knobsPanel.PointerReleased += KnobsPanel_PointerReleased;

4
src/Avalonia.Dialogs/ManagedFileChooser.cs

@ -90,8 +90,8 @@ namespace Avalonia.Dialogs
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
_quickLinksRoot = e.NameScope.Get<Control>("QuickLinks");
_filesView = e.NameScope.Get<ListBox>("Files");
_quickLinksRoot = e.NameScope.Get<Control>("PART_QuickLinks");
_filesView = e.NameScope.Get<ListBox>("PART_Files");
}
}
}

Loading…
Cancel
Save