Skip to content

Commit

Permalink
Update to rc1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
wieslawsoltes committed Jun 6, 2023
1 parent 5b35d96 commit db510af
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 86 deletions.
14 changes: 7 additions & 7 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>
<PropertyGroup>
<VersionPrefix>11.0.0</VersionPrefix>
<VersionSuffix>preview8.1</VersionSuffix>
<VersionSuffix>rc1.1</VersionSuffix>
<Authors>Wiesław Šoltés</Authors>
<Company>Wiesław Šoltés</Company>
<Description>A multi-platform data driven 2D diagram editor.</Description>
Expand All @@ -32,11 +32,11 @@
<XUnitAbstractionsVersion>2.0.3</XUnitAbstractionsVersion>
<MicrosoftNETTestSdkVersion>16.2.0</MicrosoftNETTestSdkVersion>
<SkiaSharpVersion>2.88.3</SkiaSharpVersion>
<SvgSkiaVersion>0.6.0-preview8.2</SvgSkiaVersion>
<AvaloniaVersion>11.0.0-preview8</AvaloniaVersion>
<AvaloniaXamlBehaviorsVersion>11.0.0-preview8</AvaloniaXamlBehaviorsVersion>
<AvaloniaControlsPanAndZoomVersion>11.0.0-preview8</AvaloniaControlsPanAndZoomVersion>
<ThemeEditorControlsColorPickerVersion>11.0.0-preview8</ThemeEditorControlsColorPickerVersion>
<DockAvaloniaVersion>11.0.0-preview8.1</DockAvaloniaVersion>
<SvgSkiaVersion>0.6.0-rc1.1</SvgSkiaVersion>
<AvaloniaVersion>11.0.0-rc1.1</AvaloniaVersion>
<AvaloniaXamlBehaviorsVersion>11.0.0-rc1.1</AvaloniaXamlBehaviorsVersion>
<AvaloniaControlsPanAndZoomVersion>11.0.0-rc1.1</AvaloniaControlsPanAndZoomVersion>
<ThemeEditorControlsColorPickerVersion>11.0.0-rc1.1</ThemeEditorControlsColorPickerVersion>
<DockAvaloniaVersion>11.0.0-rc1.1</DockAvaloniaVersion>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions samples/Demo.Base/Themes/Themes.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<SolidColorBrush x:Key="SystemControlBackgroundChromeMediumLowBrush" Color="{StaticResource SystemChromeMediumLowColor}" />
<Color x:Key="SystemAltMediumLowColor">Transparent</Color>
<SolidColorBrush x:Key="SystemControlBackgroundAltMediumLowBrush" Color="{StaticResource SystemAltMediumLowColor}" />
<StaticResource x:Key="TextControlBackground" ResourceKey="SystemControlBackgroundAltMediumLowBrush" />
<SolidColorBrush x:Key="TextControlBackground" Color="{StaticResource SystemAltMediumLowColor}" />
<SolidColorBrush x:Key="AcrylicFallbackColor">#E2E2E2</SolidColorBrush>
<GridLength x:Key="SliderPreContentMargin">3</GridLength>
<GridLength x:Key="SliderPostContentMargin">3</GridLength>
Expand All @@ -32,7 +32,7 @@
<SolidColorBrush x:Key="SystemControlBackgroundChromeMediumLowBrush" Color="{StaticResource SystemChromeMediumLowColor}" />
<Color x:Key="SystemAltMediumLowColor">Transparent</Color>
<SolidColorBrush x:Key="SystemControlBackgroundAltMediumLowBrush" Color="{StaticResource SystemAltMediumLowColor}" />
<StaticResource x:Key="TextControlBackground" ResourceKey="SystemControlBackgroundAltMediumLowBrush" />
<SolidColorBrush x:Key="TextControlBackground" Color="{StaticResource SystemAltMediumLowColor}" />
<SolidColorBrush x:Key="AcrylicFallbackColor">#1F1F1F</SolidColorBrush>
<GridLength x:Key="SliderPreContentMargin">3</GridLength>
<GridLength x:Key="SliderPostContentMargin">3</GridLength>
Expand Down
6 changes: 3 additions & 3 deletions samples/Demo.Base/ViewModels/ViewModelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Demo.ViewModels;

[ObservableObject]
public partial class ViewModelBase
public partial class ViewModelBase : ObservableObject

{
}
}
20 changes: 2 additions & 18 deletions src/Core2D/AppState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
using System.Linq;
using System.Reflection;
using Autofac;
using Avalonia;
using Avalonia.Platform;
using Core2D.Configuration.Windows;
using Core2D.Json;
using Core2D.Model;
Expand Down Expand Up @@ -123,21 +121,11 @@ private void InitializeEditor()
Editor.CurrentPathTool = Editor.PathTools.FirstOrDefault(t => t.Title == "Line");
Editor.IsToolIdle = true;

var runtimePlatform = AvaloniaLocator.Current.GetService<IRuntimePlatform>();
var windowingPlatform = AvaloniaLocator.Current.GetService<IWindowingPlatform>();
var platformRenderInterface = AvaloniaLocator.Current.GetService<IPlatformRenderInterface>();
if (windowingPlatform is { } && platformRenderInterface is { } && runtimePlatform is { })
{
var windowingSubsystemName = windowingPlatform.GetType().Assembly.GetName().Name;
var renderingSubsystemName = platformRenderInterface.GetType().Assembly.GetName().Name;
var runtimeInfo = runtimePlatform.GetRuntimeInfo();
var aboutInfo = CreateAboutInfo(ServiceProvider, runtimeInfo, windowingSubsystemName, renderingSubsystemName);
Editor.AboutInfo = CreateAboutInfo(ServiceProvider);

Editor.AboutInfo = aboutInfo;
}
}

private AboutInfoViewModel CreateAboutInfo(IServiceProvider? serviceProvider, RuntimePlatformInfo runtimeInfo, string? windowingSubsystem, string? renderingSubsystem)
private AboutInfoViewModel CreateAboutInfo(IServiceProvider? serviceProvider)
{
return new AboutInfoViewModel(serviceProvider)
{
Expand All @@ -146,10 +134,6 @@ private AboutInfoViewModel CreateAboutInfo(IServiceProvider? serviceProvider, Ru
Description = "A multi-platform data driven 2D diagram editor.",
Copyright = "Copyright (c) Wiesław Šoltés. All rights reserved.",
License = "Licensed under the MIT License. See LICENSE file in the project root for full license information.",
IsDesktop = runtimeInfo.IsDesktop,
IsMobile = runtimeInfo.IsMobile,
WindowingSubsystemName = windowingSubsystem,
RenderingSubsystemName = renderingSubsystem
};
}

Expand Down
6 changes: 3 additions & 3 deletions src/Core2D/Behaviors/CancelContextMenuBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected override void OnAttached()

if ((ContextMenu ?? AssociatedObject?.ContextMenu) is { } contextMenu)
{
contextMenu.ContextMenuOpening += ContextMenu_ContextMenuOpening;
contextMenu.Opening += ContextMenu_ContextMenuOpening;
}
}

Expand All @@ -42,12 +42,12 @@ protected override void OnDetaching()

if ((ContextMenu ?? AssociatedObject?.ContextMenu) is { } contextMenu)
{
contextMenu.ContextMenuOpening -= ContextMenu_ContextMenuOpening;
contextMenu.Opening -= ContextMenu_ContextMenuOpening;
}
}

private void ContextMenu_ContextMenuOpening(object? sender, CancelEventArgs e)
{
e.Cancel = !IsEnabled;
}
}
}
29 changes: 0 additions & 29 deletions src/Core2D/Modules/Renderer/Avalonia/PathGeometryConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ namespace Core2D.Modules.Renderer.Avalonia;

public static class PathGeometryConverter
{
private static T? GetService<T>(this A.IAvaloniaDependencyResolver resolver) => (T?) resolver.GetService(typeof (T));

private static AP.IPlatformRenderInterface? Factory => A.AvaloniaLocator.Current.GetService<AP.IPlatformRenderInterface>();

private static A.Point ToPoint(this PointShapeViewModel point) => new(point.X, point.Y);

private static A.Size ToSize(this PathSizeViewModel size) => new( size.Width, size.Height);
Expand All @@ -26,11 +22,6 @@ public static class PathGeometryConverter

public static AM.Geometry? ToGeometryImpl(PathShapeViewModel pathShape, bool isFilled)
{
var factory = Factory;
if (factory is null)
{
return null;
}
var geometry = new AM.StreamGeometry();
using var context = geometry.Open();

Expand Down Expand Up @@ -110,11 +101,6 @@ public static class PathGeometryConverter
}
public static AM.Geometry? ToGeometryImpl(EllipseShapeViewModel ellipse)
{
var factory = Factory;
if (factory is null)
{
return null;
}
if (ellipse.TopLeft is null || ellipse.BottomRight is null)
{
return null;
Expand All @@ -130,11 +116,6 @@ public static class PathGeometryConverter

public static AM.Geometry? ToGeometryImpl(ArcShapeViewModel arc)
{
var factory = Factory;
if (factory is null)
{
return null;
}
if (arc.Point1 is null || arc.Point2 is null || arc.Point3 is null || arc.Point4 is null)
{
return null;
Expand All @@ -161,11 +142,6 @@ public static class PathGeometryConverter

public static AM.Geometry? ToGeometryImpl(CubicBezierShapeViewModel cubicBezier)
{
var factory = Factory;
if (factory is null)
{
return null;
}
if (cubicBezier.Point1 is null || cubicBezier.Point2 is null || cubicBezier.Point3 is null || cubicBezier.Point4 is null)
{
return null;
Expand All @@ -185,11 +161,6 @@ public static class PathGeometryConverter

public static AM.Geometry? ToGeometryImpl(QuadraticBezierShapeViewModel quadraticBezier)
{
var factory = Factory;
if (factory is null)
{
return null;
}
if (quadraticBezier.Point1 is null || quadraticBezier.Point2 is null || quadraticBezier.Point3 is null)
{
return null;
Expand Down
4 changes: 2 additions & 2 deletions src/Core2D/Themes/Themes.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<SolidColorBrush x:Key="SystemControlBackgroundChromeMediumLowBrush" Color="{StaticResource SystemChromeMediumLowColor}" />
<Color x:Key="SystemAltMediumLowColor">Transparent</Color>
<SolidColorBrush x:Key="SystemControlBackgroundAltMediumLowBrush" Color="{StaticResource SystemAltMediumLowColor}" />
<StaticResource x:Key="TextControlBackground" ResourceKey="SystemControlBackgroundAltMediumLowBrush" />
<SolidColorBrush x:Key="TextControlBackground" Color="{StaticResource SystemAltMediumLowColor}" />
<SolidColorBrush x:Key="AcrylicFallbackColor">#E2E2E2</SolidColorBrush>
<GridLength x:Key="SliderPreContentMargin">3</GridLength>
<GridLength x:Key="SliderPostContentMargin">3</GridLength>
Expand All @@ -32,7 +32,7 @@
<SolidColorBrush x:Key="SystemControlBackgroundChromeMediumLowBrush" Color="{StaticResource SystemChromeMediumLowColor}" />
<Color x:Key="SystemAltMediumLowColor">Transparent</Color>
<SolidColorBrush x:Key="SystemControlBackgroundAltMediumLowBrush" Color="{StaticResource SystemAltMediumLowColor}" />
<StaticResource x:Key="TextControlBackground" ResourceKey="SystemControlBackgroundAltMediumLowBrush" />
<SolidColorBrush x:Key="TextControlBackground" Color="{StaticResource SystemAltMediumLowColor}" />
<SolidColorBrush x:Key="AcrylicFallbackColor">#1F1F1F</SolidColorBrush>
<GridLength x:Key="SliderPreContentMargin">3</GridLength>
<GridLength x:Key="SliderPostContentMargin">3</GridLength>
Expand Down
14 changes: 1 addition & 13 deletions src/Core2D/ViewModels/Editor/AboutInfoViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ public class AboutInfoViewModel : ViewModelBase

public string? License { get; set; }

public bool IsDesktop { get; set; }

public bool IsMobile { get; set; }

public string? WindowingSubsystemName { get; set; }

public string? RenderingSubsystemName { get; set; }

public AboutInfoViewModel(IServiceProvider? serviceProvider) : base(serviceProvider)
{
}
Expand All @@ -38,9 +30,5 @@ public override string ToString() =>
$"{nameof(Version)}: {Version}{Environment.NewLine}" +
$"{nameof(Description)}: {Description}{Environment.NewLine}" +
$"{nameof(Copyright)}: {Copyright}{Environment.NewLine}" +
$"{nameof(License)}: {License}{Environment.NewLine}" +
$"{nameof(IsDesktop)}: {IsDesktop}{Environment.NewLine}" +
$"{nameof(IsMobile)}: {IsMobile}{Environment.NewLine}" +
$"{nameof(WindowingSubsystemName)}: {WindowingSubsystemName}{Environment.NewLine}" +
$"{nameof(RenderingSubsystemName)}: {RenderingSubsystemName}{Environment.NewLine}";
$"{nameof(License)}: {License}{Environment.NewLine}";
}
10 changes: 1 addition & 9 deletions src/Core2D/Views/Editor/AboutInfoView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</Style>
</UserControl.Styles>
<Grid ColumnDefinitions="Auto,4,*"
RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto"
RowDefinitions="Auto,Auto,Auto,Auto,Auto"
Margin="10">
<Label Content="{Binding Title}"
FontSize="18"
Expand All @@ -23,17 +23,9 @@
<Label Content="Description" Grid.Column="0" Grid.Row="2" />
<Label Content="Copyright" Grid.Column="0" Grid.Row="3" />
<Label Content="License" Grid.Column="0" Grid.Row="4" />
<Label Content="IsDesktop" Grid.Column="0" Grid.Row="6" />
<Label Content="IsMobile" Grid.Column="0" Grid.Row="7" />
<Label Content="WindowingSubsystem" Grid.Column="0" Grid.Row="12" />
<Label Content="RenderingSubsystem" Grid.Column="0" Grid.Row="13" />
<Label Content="{Binding Version}" Grid.Column="2" Grid.Row="1" />
<Label Content="{Binding Description}" Grid.Column="2" Grid.Row="2" />
<Label Content="{Binding Copyright}" Grid.Column="2" Grid.Row="3" />
<Label Content="{Binding License}" Grid.Column="2" Grid.Row="4" />
<Label Content="{Binding IsDesktop}" Grid.Column="2" Grid.Row="6" />
<Label Content="{Binding IsMobile}" Grid.Column="2" Grid.Row="7" />
<Label Content="{Binding WindowingSubsystemName}" Grid.Column="2" Grid.Row="12" />
<Label Content="{Binding RenderingSubsystemName}" Grid.Column="2" Grid.Row="13" />
</Grid>
</UserControl>

0 comments on commit db510af

Please sign in to comment.