Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting Avalonia 11 #92

Open
wants to merge 70 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
bfab9d7
Going to NET8 (many fixes will be later)
SwiftExtender May 24, 2024
334ceaf
Another load of stupid fixes
SwiftExtender May 24, 2024
0c77ba5
Little go back
SwiftExtender May 24, 2024
d9791ed
Another load for changes
SwiftExtender May 25, 2024
0004152
Trying to fix ImageExtensions
SwiftExtender May 25, 2024
f375315
Next stage fixes
SwiftExtender May 25, 2024
83c7ae6
Load of fixes
SwiftExtender May 25, 2024
a43c7b1
Another batch of fixes
SwiftExtender May 25, 2024
edad0cf
Digging rabbit hole
SwiftExtender May 26, 2024
cf02de5
Cut many things, its awful
SwiftExtender May 26, 2024
4a40190
Now it is working, but exampleApp is empty. Long road to home begins
SwiftExtender May 26, 2024
b67a118
Merge pull request #1 from Wowhere/dangerous
SwiftExtender May 26, 2024
a083919
Update README.md
SwiftExtender May 26, 2024
6bd4ed4
Update README.md
SwiftExtender May 26, 2024
7d4eb04
Fixing mess
SwiftExtender Jun 2, 2024
9999b94
Small fixes of Notification and BreadcrumbBar
SwiftExtender Jun 2, 2024
92b1a90
View layer fixes
SwiftExtender Jun 2, 2024
cff77a7
PropertyGrid view fix
SwiftExtender Jun 2, 2024
8fb9899
Wizard fix and mess cleaning
SwiftExtender Jun 2, 2024
5b27ddb
ExampleApp fix
SwiftExtender Jun 2, 2024
a93aabd
fix DatePicker
SwiftExtender Jun 2, 2024
2c61be3
Update TagControl.axaml
SwiftExtender Jun 2, 2024
b41462a
Delete debug-attach-log-20240602.txt
SwiftExtender Jun 3, 2024
c2176bc
FixTagControl button size and remove garbage
SwiftExtender Jun 3, 2024
48621c0
TagControl with suggested fill, pt 1
SwiftExtender Jun 8, 2024
001d0b5
update deps
SwiftExtender Jul 6, 2024
587425d
Update deps
SwiftExtender Aug 4, 2024
03299e2
Fix shit
SwiftExtender Aug 4, 2024
2d51d1b
Fix load pt 1
SwiftExtender Aug 4, 2024
8f76eb2
Fix DatePicker
SwiftExtender Aug 4, 2024
35f6315
Merge pull request #2 from Wowhere/avalonia11
SwiftExtender Aug 4, 2024
1335e13
Multibinding in Wizard is broken. Write converter for it (later)
SwiftExtender Aug 4, 2024
e06aa35
DatePicker fixed but working bad (later)
SwiftExtender Aug 4, 2024
942f532
Merge pull request #3 from Wowhere/avalonia11
SwiftExtender Aug 4, 2024
9d3bb4a
Merge branch 'master' into TagControl
SwiftExtender Aug 4, 2024
e794d13
Merge pull request #4 from Wowhere/TagControl
SwiftExtender Aug 4, 2024
0e19954
Fix explorer bar
SwiftExtender Aug 4, 2024
139c737
TabControl view fix
SwiftExtender Aug 5, 2024
a736f45
Update deps
SwiftExtender Sep 29, 2024
2d3f338
Fixing StepBar, pt 1
SwiftExtender Sep 30, 2024
81aae20
Fix reiplemented ContextMenuExt and TriggerAction
SwiftExtender Oct 1, 2024
4dd8c15
FlyoutsControl remake property
SwiftExtender Oct 1, 2024
458f01a
Remake TabbedLayout property in OnClosePropertyTabCommand
SwiftExtender Oct 1, 2024
e8e53ab
Mark the reasoning for custom IFontManagerImpl
SwiftExtender Oct 1, 2024
35c33d1
Return ImageExtensions and CroppingControls funcs
SwiftExtender Oct 1, 2024
ff653be
Mark f*ing Styled Properties in BreadcrumbBar
SwiftExtender Oct 1, 2024
6115efe
Fix prev mistake
SwiftExtender Oct 1, 2024
9c9c25f
Uncommenting and fixing ResizeControl`s function ResizeThumb_DragDelta
SwiftExtender Oct 10, 2024
6637331
BreadcrumbBar, BreadcrumbButton fix
SwiftExtender Oct 10, 2024
2c756eb
Dangerous reviving of UseAvaloniaExtended in AppBuilderExtensions
SwiftExtender Oct 10, 2024
23e93d1
Dangerous change of adding classes
SwiftExtender Oct 10, 2024
b3ef9ee
Update README.md
SwiftExtender Oct 10, 2024
f76d373
Update README.md
SwiftExtender Oct 10, 2024
98b5876
Update deps
SwiftExtender Oct 13, 2024
a9bc00d
Merge branch 'master' of https://github.com/Wowhere/Avalonia.Extended…
SwiftExtender Oct 13, 2024
9fcb188
Removing bunch of "bad view'
SwiftExtender Oct 13, 2024
0cf9e2c
Fix previous commit
SwiftExtender Oct 13, 2024
80d0c03
small fix of OutlookBar
SwiftExtender Oct 13, 2024
dffbdc1
Helper Extensions, uncomment SetClasses
SwiftExtender Oct 14, 2024
cbf1502
Fix AvaloniaLocator to AssetLoader in FolderItem
SwiftExtender Oct 14, 2024
b06e807
Convert GeometryFillBrushProperty from styled to DirectProperty
SwiftExtender Oct 14, 2024
6ca3626
Fix <t>
SwiftExtender Oct 14, 2024
0370ebb
Comment for MetroWindow to implement BeginMoveDragLater
SwiftExtender Oct 15, 2024
d83eb13
Revert "Fix <t>"
SwiftExtender Oct 15, 2024
90f565a
Revert "Convert GeometryFillBrushProperty from styled to DirectPrope…
SwiftExtender Oct 15, 2024
13285f8
Revert "small fix of OutlookBar"
SwiftExtender Oct 15, 2024
b6ecf8e
OutlookBar, comment as obsolete RaisePropertyChanged
SwiftExtender Oct 15, 2024
747cccc
Grab system fonts in FontManager
SwiftExtender Oct 15, 2024
e2ee0c8
TagControl directProperty fix
SwiftExtender Oct 19, 2024
aa1a416
Obsolete RaisePropertyChanged for styled Properties
SwiftExtender Oct 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 24 additions & 19 deletions Avalonia.Controlz/Avalonia.Controlz.csproj
Original file line number Diff line number Diff line change
@@ -1,38 +1,47 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Directory.build.props" />

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<IsPackable>true</IsPackable>
<Platforms>AnyCPU;x64;x86</Platforms>
</PropertyGroup>

<PropertyGroup>
<PackageId>mameolan.Avalonia.Controlz</PackageId>
<Description>Standard controls which are not available in Avalonia.</Description>
<PackageTags>gui;avalonia;avaloniaui;xaml</PackageTags>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\Avalonia.Controlz.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
<DocumentationFile>bin\Debug\Avalonia.Controlz.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DocumentationFile>bin\Debug\Avalonia.Controlz.xml</DocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\Avalonia.Controlz.xml</DocumentationFile>
</PropertyGroup>



<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<DocumentationFile>bin\Release\Avalonia.Controlz.xml</DocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<DocumentationFile>bin\Release\Avalonia.Controlz.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.13" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.13" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.13" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.13" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.13.3" />
<PackageReference Include="Avalonia.Xaml.Interactions" Version="0.10.13.3" />
<PackageReference Include="Avalonia.Xaml.Interactivity" Version="0.10.13.3" />
<PackageReference Include="Avalonia" Version="11.1.4" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.1.4" />
<PackageReference Include="Avalonia.Desktop" Version="11.1.4" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.1.4" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.1.0.4" />
<PackageReference Include="Avalonia.Xaml.Interactions" Version="11.1.0.4" />
<PackageReference Include="Avalonia.Xaml.Interactivity" Version="11.1.0.4" />
<PackageReference Include="GridExtra.Avalonia" Version="0.9.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup>
Expand All @@ -44,8 +53,4 @@
</AvaloniaResource>
<AvaloniaResource Include="Assets\*" />
</ItemGroup>




</Project>
14 changes: 7 additions & 7 deletions Avalonia.Controlz/Controls/Slider/SliderEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,10 @@ static SliderEx()
Thumb.DragDeltaEvent.AddClassHandler<SliderEx>((o, e) => OnThumbDragDelta(o, e), RoutingStrategies.Bubble);
Thumb.DragCompletedEvent.AddClassHandler<SliderEx>((o, e) => OnThumbDragCompleted(o, e), RoutingStrategies.Bubble);

SelectionStartProperty.Changed.AddClassHandler((Action<SliderEx, AvaloniaPropertyChangedEventArgs>)((o, e) => OnSelectionStartChanged(o, e)));
SelectionEndProperty.Changed.AddClassHandler((Action<SliderEx, AvaloniaPropertyChangedEventArgs>)((o, e) => OnSelectionEndChanged(o, e)));
ValueProperty.Changed.AddClassHandler((Action<SliderEx, AvaloniaPropertyChangedEventArgs>)((o, e) => OnValueChanged(o, e)));
TickPlacementProperty.Changed.AddClassHandler((Action<SliderEx, AvaloniaPropertyChangedEventArgs>)((o, e) => OnTickPlacementChanged(o, e)));
SelectionStartProperty.Changed.AddClassHandler<SliderEx>((Action<SliderEx, AvaloniaPropertyChangedEventArgs>)((o, e) => OnSelectionStartChanged(o, e)));
SelectionEndProperty.Changed.AddClassHandler<SliderEx>((Action<SliderEx, AvaloniaPropertyChangedEventArgs>)((o, e) => OnSelectionEndChanged(o, e)));
ValueProperty.Changed.AddClassHandler<SliderEx>((Action<SliderEx, AvaloniaPropertyChangedEventArgs>)((o, e) => OnValueChanged(o, e)));
TickPlacementProperty.Changed.AddClassHandler<SliderEx>((Action<SliderEx, AvaloniaPropertyChangedEventArgs>)((o, e) => OnTickPlacementChanged(o, e)));
}


Expand Down Expand Up @@ -486,7 +486,7 @@ private void OnIncreaseLargeCommand(object x)
/// updates the pseudo classes
/// </summary>
/// <param name="e"></param>
protected override void OnPropertyChanged<T>(AvaloniaPropertyChangedEventArgs<T> e)
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs e)
{
base.OnPropertyChanged(e);
if(e.Property == OrientationProperty && e.NewValue is Orientation newValue)
Expand Down Expand Up @@ -915,8 +915,8 @@ protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
//{
// _autoToolTip.PlacementTarget = Track != null ? Track.Thumb : null;
//}

RaisePropertyChanged(TickPlacementProperty, TickPlacement.None, TickPlacement);
//.orig
//RaisePropertyChanged(TickPlacementProperty, TickPlacement.None, TickPlacement);
base.OnApplyTemplate(e);
}

Expand Down
21 changes: 11 additions & 10 deletions Avalonia.Controlz/Controls/StatusBar/StatusBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public class StatusBar : ItemsControl
{

#warning finish implementation
private static readonly FuncTemplate<IPanel> DefaultPanel =
new FuncTemplate<IPanel>(() => new DockPanel());
private static readonly FuncTemplate<Panel> DefaultPanel =
new FuncTemplate<Panel>(() => new DockPanel());

static StatusBar()
{
Expand All @@ -32,14 +32,15 @@ static StatusBar()
/// creates an item container of an <see cref="StatusBarItem"/>
/// </summary>
/// <returns></returns>
protected override IItemContainerGenerator CreateItemContainerGenerator()
{
var itemContainer = new ItemContainerGenerator<StatusBarItem>(
this,
StatusBarItem.ContentProperty,
StatusBarItem.ContentTemplateProperty);
//.orig
//protected override ItemContainerGenerator CreateItemContainerGenerator()
//{
// var itemContainer = new ItemContainerGenerator<StatusBarItem>(
// this,
// StatusBarItem.ContentProperty,
// StatusBarItem.ContentTemplateProperty);

return itemContainer;
}
// return itemContainer;
//}
}
}
16 changes: 8 additions & 8 deletions Avalonia.Controlz/Controls/TabPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected override Size MeasureOverride(Size constraint)
int numInCurrentRow = 0;
double currentRowWidth = 0;
double maxRowWidth = 0;
foreach (IControl child in Children)
foreach (Control child in Children)
{
if (child.IsVisible == false)
continue;
Expand Down Expand Up @@ -107,7 +107,7 @@ protected override Size MeasureOverride(Size constraint)
}
else if (tabAlignment == Dock.Left || tabAlignment == Dock.Right)
{
foreach (IControl child in Children)
foreach (Control child in Children)
{
if (child.IsVisible == false)
continue;
Expand All @@ -131,7 +131,7 @@ protected override Size MeasureOverride(Size constraint)
return contentSize;
}

private Size GetDesiredSizeWithoutMargin(IControl element)
private Size GetDesiredSizeWithoutMargin(Control element)
{
Thickness margin = (Thickness)element.GetValue(MarginProperty);
Size desiredSizeWithoutMargin = new Size(
Expand All @@ -145,7 +145,7 @@ private double[] GetHeadersSize()
{
double[] headerSize = new double[_numHeaders];
int childIndex = 0;
foreach (IControl child in Children)
foreach (Control child in Children)
{
if (child.IsVisible == false)
continue;
Expand Down Expand Up @@ -183,7 +183,7 @@ private void ArrangeHorizontal(Size arrangeSize)

int childIndex = 0;
int separatorIndex = 0;
foreach (IControl child in Children)
foreach (Control child in Children)
{
if (child.IsVisible == false)
continue;
Expand Down Expand Up @@ -235,7 +235,7 @@ private void ArrangeHorizontal(Size arrangeSize)
private void ArrangeVertical(Size arrangeSize)
{
double childOffsetY = 0d;
foreach (IControl child in Children)
foreach (Control child in Children)
{
if (child.IsVisible)
{
Expand All @@ -255,7 +255,7 @@ private int GetActiveRow(int[] solution)
int childIndex = 0;
if (solution.Length > 0)
{
foreach (IControl child in Children)
foreach (Control child in Children)
{
if (child.IsVisible)
continue;
Expand Down Expand Up @@ -452,4 +452,4 @@ private int[] CalculateHeaderDistribution(double rowWidthLimit, double[] headerW
return bestSolution;
}
}
}
}
45 changes: 23 additions & 22 deletions Avalonia.Controlz/Controls/TickBar/TickBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Avalonia.Controlz.Helper;
using Avalonia.Data;
using Avalonia.Media;
using Avalonia.ReactiveUI;
using System;
using System.Diagnostics;

Expand Down Expand Up @@ -609,28 +610,28 @@ public override void Render(DrawingContext dc)
return;
}

private void BindToTemplatedParent(AvaloniaProperty target, AvaloniaProperty source)
{
//if (!HasNonDefaultValue(target))
{
//Binding binding = new Binding();
//binding.RelativeSource = new RelativeSource(RelativeSourceMode.TemplatedParent);
//binding.Path = source.p//new PropertyPath(source);
//SetBinding(target, binding);
try
{
var sourceBinding = this.GetSubject(source);

InstancedBinding instancedBinding = new InstancedBinding(sourceBinding, BindingMode.TwoWay, BindingPriority.TemplatedParent);
BindingOperations.Apply(this, target, instancedBinding, TemplatedParent);
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
}
//Bind(target, ObservableEx.SingleValue(source));
}
}
//private void BindToTemplatedParent(AvaloniaProperty target, AvaloniaProperty source)
//{
// //if (!HasNonDefaultValue(target))
// {
// //Binding binding = new Binding();
// //binding.RelativeSource = new RelativeSource(RelativeSourceMode.TemplatedParent);
// //binding.Path = source.p//new PropertyPath(source);
// //SetBinding(target, binding);
// try
// {
// var sourceBinding = this.GetSubject(source);

// InstancedBinding instancedBinding = new InstancedBinding(sourceBinding, BindingMode.TwoWay, BindingPriority.TemplatedParent, true);
// BindingOperations.Apply(this, target, instancedBinding, TemplatedParent);
// }
// catch (Exception ex)
// {
// Debug.WriteLine(ex.Message);
// }
// //Bind(target, ObservableEx.SingleValue(source));
// }
//}

/// <summary>
/// gets the parent <see cref="SliderEx"/>
Expand Down
8 changes: 5 additions & 3 deletions Avalonia.Controlz/Helper/DoubleUtil.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
using System.Windows;
using System.Drawing;
using System.Runtime.InteropServices;

namespace Avalonia.Controlz
Expand Down Expand Up @@ -209,15 +211,15 @@ public static bool AreClose(Vector vector1, Vector vector2)
public static bool AreClose(Rect rect1, Rect rect2)
{
// If they're both empty, don't bother with the double logic.
if (rect1.IsEmpty)
if (rect1.Height == 0 && rect1.Width == 0)
{
return rect2.IsEmpty;
return !(rect2.Height != 0 || rect2.Width != 0);
}

// At this point, rect1 isn't empty, so the first thing we can test is
// rect2.IsEmpty, followed by property-wise compares.

return (!rect2.IsEmpty) &&
return (rect2.Height != 0 || rect2.Width != 0) &&
DoubleUtil.AreClose(rect1.X, rect2.X) &&
DoubleUtil.AreClose(rect1.Y, rect2.Y) &&
DoubleUtil.AreClose(rect1.Height, rect2.Height) &&
Expand Down
Loading
Loading