Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
wieslawsoltes committed Mar 22, 2023
1 parent f8f29e7 commit c85ff8d
Show file tree
Hide file tree
Showing 27 changed files with 32 additions and 107 deletions.
2 changes: 1 addition & 1 deletion build/Avalonia.Controls.Skia.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Controls.Skia" Version="11.0.0-preview5" />
<PackageReference Include="Avalonia.Controls.Skia" Version="11.0.0-preview6" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/Avalonia.Desktop.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview5" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview6" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/Avalonia.Diagnostics.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Diagnostics" Version="11.0.0-preview5" />
<PackageReference Include="Avalonia.Diagnostics" Version="11.0.0-preview6" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/Avalonia.Markup.Xaml.Loader.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="11.0.0-preview5" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="11.0.0-preview6" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/Avalonia.Skia.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Skia" Version="11.0.0-preview5" />
<PackageReference Include="Avalonia.Skia" Version="11.0.0-preview6" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/Avalonia.ThemeManager.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.ThemeManager" Version="11.0.0-preview5" />
<PackageReference Include="Avalonia.ThemeManager" Version="11.0.0-preview6" />
</ItemGroup>
</Project>
3 changes: 2 additions & 1 deletion build/Avalonia.Themes.Fluent.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.0-preview5" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.0-preview6" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.0-preview6" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/Avalonia.Web.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Browser" Version="11.0.0-preview5" />
<PackageReference Include="Avalonia.Browser" Version="11.0.0-preview6" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/Avalonia.Xaml.Behaviors.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.0-preview5" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.0-preview6" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/Avalonia.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.0-preview5" />
<PackageReference Include="Avalonia" Version="11.0.0-preview6" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions build/Base.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VersionPrefix>11.0.0</VersionPrefix>
<VersionSuffix>preview5</VersionSuffix>
<VersionSuffix>preview6</VersionSuffix>
<Authors>Wiesław Šoltés</Authors>
<Company>Wiesław Šoltés</Company>
<Copyright>Copyright © Wiesław Šoltés 2022</Copyright>
<Copyright>Copyright © Wiesław Šoltés 2023</Copyright>
<PackageProjectUrl>https://github.com/wieslawsoltes/SvgToXaml</PackageProjectUrl>
</PropertyGroup>
<PropertyGroup>
Expand Down
13 changes: 4 additions & 9 deletions src/SvgToXaml.Base/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ private async Task Open()

var file = result.FirstOrDefault();

if (file is not null && file.CanOpenRead)
if (file is not null)
{
try
{
Expand Down Expand Up @@ -232,7 +232,7 @@ private async Task Save()
ShowOverwritePrompt = true
});

if (file is not null && file.CanOpenWrite)
if (file is not null)
{
try
{
Expand Down Expand Up @@ -285,11 +285,6 @@ private async Task Add()

foreach (var file in result)
{
if (!file.CanOpenRead)
{
continue;
}

try
{
await using var stream = await file.OpenReadAsync();
Expand Down Expand Up @@ -350,7 +345,7 @@ private async Task ExportSelected(string? format)
ShowOverwritePrompt = true
});

if (file is not null && file.CanOpenWrite)
if (file is not null)
{
try
{
Expand Down Expand Up @@ -389,7 +384,7 @@ private async Task ExportAll(string? format)
ShowOverwritePrompt = true
});

if (file is not null && file.CanOpenWrite)
if (file is not null)
{
try
{
Expand Down
6 changes: 0 additions & 6 deletions src/SvgToXaml.Base/Views/ActionsView.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

namespace SvgToXaml.Views;

Expand All @@ -11,11 +10,6 @@ public ActionsView()
InitializeThemes();
}

private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}

private void InitializeThemes()
{
var dark = true;
Expand Down
6 changes: 0 additions & 6 deletions src/SvgToXaml.Base/Views/ItemsView.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

namespace SvgToXaml.Views;

Expand All @@ -9,9 +8,4 @@ public ItemsView()
{
InitializeComponent();
}

private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
6 changes: 0 additions & 6 deletions src/SvgToXaml.Base/Views/LeftPaneView.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

namespace SvgToXaml.Views;

Expand All @@ -9,9 +8,4 @@ public LeftPane()
{
InitializeComponent();
}

private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
2 changes: 1 addition & 1 deletion src/SvgToXaml.Base/Views/MainView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="480"
x:DataType="vm:MainWindowViewModel" x:CompileBindings="True"
x:Class="SvgToXaml.Views.MainView"
FontFamily="avares://Avalonia.Themes.Fluent/Assets#Inter">
FontFamily="avares://Avalonia.Fonts.Inter/Assets#Inter">

<Design.DataContext>
<vm:MainWindowViewModel />
Expand Down
8 changes: 1 addition & 7 deletions src/SvgToXaml.Base/Views/MainView.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

namespace SvgToXaml.Views;

public class MainView : UserControl
public partial class MainView : UserControl
{
public MainView()
{
InitializeComponent();
}

private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
4 changes: 2 additions & 2 deletions src/SvgToXaml.Base/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:views="clr-namespace:SvgToXaml.Views"
mc:Ignorable="d" d:DesignWidth="900" d:DesignHeight="480"
x:Class="SvgToXaml.Views.MainWindow"
x:Name="MainWindow"
x:Name="MainWindowView"
MinWidth="900"
MinHeight="480"
WindowStartupLocation="CenterScreen"
Expand All @@ -17,7 +17,7 @@
Icon="/Assets/Icon.ico"
Title="SvgToXaml"
DragDrop.AllowDrop="True">
<Panel Margin="{Binding #MainWindow.OffScreenMargin}">
<Panel Margin="{Binding #MainWindowView.OffScreenMargin}">
<views:MainView/>
<!-- <views:SandBox Margin="0,36,0,0"/> -->
</Panel>
Expand Down
12 changes: 3 additions & 9 deletions src/SvgToXaml.Base/Views/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Markup.Xaml;
using SvgToXaml.ViewModels;

namespace SvgToXaml.Views;
Expand All @@ -19,24 +18,19 @@ public MainWindow()
AddHandler(DragDrop.DragOverEvent, DragOver);
}

private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}

private void DragOver(object? sender, DragEventArgs e)
{
e.DragEffects = e.DragEffects & (DragDropEffects.Copy | DragDropEffects.Link);

if (!e.Data.Contains(DataFormats.FileNames))
if (!e.Data.Contains(DataFormats.Files))
{
e.DragEffects = DragDropEffects.None;
}
}

private void Drop(object? sender, DragEventArgs e)
{
if (e.Data.Contains(DataFormats.FileNames))
if (e.Data.Contains(DataFormats.Files))
{
var paths = e.Data.GetFileNames();
if (paths is { })
Expand All @@ -55,4 +49,4 @@ private void Drop(object? sender, DragEventArgs e)
}
}
}
}
}
6 changes: 0 additions & 6 deletions src/SvgToXaml.Base/Views/PictureView.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

namespace SvgToXaml.Views;

Expand All @@ -9,9 +8,4 @@ public PictureView()
{
InitializeComponent();
}

private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
5 changes: 0 additions & 5 deletions src/SvgToXaml.Base/Views/PreviewView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ public PreviewView()
InitializeComponent();
}

private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}

protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
{
base.OnAttachedToVisualTree(e);
Expand Down
10 changes: 2 additions & 8 deletions src/SvgToXaml.Base/Views/PreviewWindow.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

namespace SvgToXaml.Views;

public class PreviewWindow : Window
public partial class PreviewWindow : Window
{
public PreviewWindow()
{
Expand All @@ -13,9 +12,4 @@ public PreviewWindow()
this.AttachDevTools();
#endif
}

private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
}
6 changes: 0 additions & 6 deletions src/SvgToXaml.Base/Views/ProjectActionsView.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

namespace SvgToXaml.Views;

Expand All @@ -9,9 +8,4 @@ public ProjectActionsView()
{
InitializeComponent();
}

private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
6 changes: 0 additions & 6 deletions src/SvgToXaml.Base/Views/RightPaneView.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

namespace SvgToXaml.Views;

Expand All @@ -9,9 +8,4 @@ public RightPaneView()
{
InitializeComponent();
}

private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
13 changes: 3 additions & 10 deletions src/SvgToXaml.Base/Views/SandBox.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.Controls;

namespace SvgToXaml.Views;

public class SandBox : UserControl
public partial class SandBox : UserControl
{
public SandBox()
{
InitializeComponent();
}

private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
}
Loading

0 comments on commit c85ff8d

Please sign in to comment.