Skip to content

Commit

Permalink
apply api from v11
Browse files Browse the repository at this point in the history
  • Loading branch information
PieroCastillo committed Jan 27, 2024
1 parent 71e02b8 commit 4040363
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 56 deletions.
5 changes: 3 additions & 2 deletions src/Aura.UI.FluentTheme/AppBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Avalonia.Controls;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml.Styling;
using Avalonia.Styling;
using System;
Expand All @@ -8,7 +9,7 @@ namespace Aura.UI.FluentTheme
{
public static class AppBuilderExtensions
{
public static TAppBuilder UseAuraUIFluentTheme<TAppBuilder>(this TAppBuilder appBuilder) where TAppBuilder : AppBuilderBase<TAppBuilder>, new()
public static AppBuilder UseAuraUIFluentTheme(this AppBuilder appBuilder)
{
appBuilder.AfterSetup(x =>
{
Expand Down
48 changes: 1 addition & 47 deletions src/Aura.UI/Controls/Navigation/NavigationView/NavigationView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace Aura.UI.Controls.Navigation
{
[PseudoClasses(":normal", ":compact")]
public partial class NavigationView : TreeView, IItemsPresenterHost, IContentPresenterHost, IHeadered
public partial class NavigationView : TreeView
{
private Button _headeritem;
private SplitView _splitVw;
Expand Down Expand Up @@ -95,16 +95,6 @@ internal void SelectSingleItemCore(object item)
SelectedItems.Clear();
SelectedItems.Add(item);

//var item_parents = (item as ILogical).GetLogicalAncestors().OfType<NavigationViewItem>();

//if (this.IsOpen)
//{
// foreach (NavigationViewItem n in item_parents)
// {
// n.IsExpanded = true;
// }
//}

SelectedItem = item;
}
internal void SelectSingleItem(object item)
Expand Down Expand Up @@ -160,42 +150,6 @@ protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e
SelectSingleItem(s);
}


///<inheritdoc/>
IAvaloniaList<ILogical> IContentPresenterHost.LogicalChildren => LogicalChildren;

private IContentPresenter ContentPart { get; set; }

bool IContentPresenterHost.RegisterContentPresenter(IContentPresenter presenter)
{
return RegisterContentPresenter(presenter);
}

///<inheritdoc/>
protected virtual bool RegisterContentPresenter(IContentPresenter presenter)
{
if (presenter.Name == "PART_SelectedContentPresenter")
{
ContentPart = presenter;
return true;
}
return false;
}

///<inheritdoc/>
protected override void OnContainersMaterialized(ItemContainerEventArgs e)
{
base.OnContainersMaterialized(e);
UpdateTitleAndSelectedContent();
}

///<inheritdoc/>
protected override void OnContainersDematerialized(ItemContainerEventArgs e)
{
base.OnContainersDematerialized(e);
UpdateTitleAndSelectedContent();
}

protected virtual void OnIsOpenChanged(object sender, AvaloniaPropertyChangedEventArgs e)
{
UpdateHeaderVisibility();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace Aura.UI.Controls.Navigation
{
[PseudoClasses(":opened", ":closed", ":selected", ":compact")]
public partial class NavigationViewItemBase : TreeViewItem, IHeadered
public partial class NavigationViewItemBase : TreeViewItem
{
private object _content = "Content";
static NavigationViewItemBase()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ protected override void OnPointerPressed(PointerPressedEventArgs e)
PseudoClasses.Add(":pressed");
}

/// <inheritdoc/>
protected override void OnPointerLeave(PointerEventArgs e)
protected override void OnPointerExited(PointerEventArgs e)
{
base.OnPointerLeave(e);
base.OnPointerExited(e);
_pointerOver = false;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Aura.UI/Controls/Sliders/RadialSlider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ static RadialSlider()
StrokeWidthProperty.Changed.Subscribe(UpdateRadius);


MaximumProperty.OverrideMetadata<RadialSlider>(new DirectPropertyMetadata<double>(100));
MinimumProperty.OverrideMetadata<RadialSlider>(new DirectPropertyMetadata<double>(0));
ValueProperty.OverrideMetadata<RadialSlider>(new DirectPropertyMetadata<double>(25));
MaximumProperty.OverrideMetadata<RadialSlider>(new StyledPropertyMetadata<double>(100));
MinimumProperty.OverrideMetadata<RadialSlider>(new StyledPropertyMetadata<double>(0));
ValueProperty.OverrideMetadata<RadialSlider>(new StyledPropertyMetadata<double>(25));

AffectsRender<RadialSlider>(XAngleProperty, YAngleProperty);
}
Expand Down

0 comments on commit 4040363

Please sign in to comment.