Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
wieslawsoltes committed Dec 21, 2021
1 parent ac7a6eb commit a4ad896
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 21 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="0.10.11-rc.2" />
<PackageReference Include="Avalonia.Controls.Skia" Version="0.10.11" />
</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="0.10.11-rc.2" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.11" />
</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="0.10.11-rc.2" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.11" />
</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="0.10.11-rc.2" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="0.10.11" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/Avalonia.ReactiveUI.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.ReactiveUI" Version="0.10.11-rc.2" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.11" />
</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="0.10.11-rc.2" />
<PackageReference Include="Avalonia.Skia" Version="0.10.11" />
</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="0.10.11.1-rc.2" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.11.5" />
</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="0.10.11-rc.2" />
<PackageReference Include="Avalonia" Version="0.10.11" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/Base.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VersionPrefix>0.10.11</VersionPrefix>
<VersionSuffix>rc.2</VersionSuffix>
<VersionSuffix></VersionSuffix>
<Authors>Wiesław Šoltés</Authors>
<Company>Wiesław Šoltés</Company>
<Copyright>Copyright © Wiesław Šoltés 2021</Copyright>
Expand Down
2 changes: 1 addition & 1 deletion build/SkiaSharp.Linux.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="SkiaSharp.NativeAssets.Linux" Version="2.88.0-preview.171" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.0-preview.178" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/SkiaSharp.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="SkiaSharp" Version="2.88.0-preview.171" />
<PackageReference Include="SkiaSharp" Version="2.88.0-preview.178" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/Svg.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="Svg.Skia" Version="0.5.11-rc.2" />
<PackageReference Include="Svg.Skia" Version="0.5.11" />
</ItemGroup>
</Project>
28 changes: 19 additions & 9 deletions src/SvgToXaml/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private void Clear()

private async Task Open()
{
var window = (Application.Current.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.MainWindow;
var window = (Application.Current?.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.MainWindow;
if (window is null)
{
return;
Expand Down Expand Up @@ -163,7 +163,7 @@ await Task.Run(() =>

private async Task Save()
{
var window = (Application.Current.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.MainWindow;
var window = (Application.Current?.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.MainWindow;
if (window is null)
{
return;
Expand Down Expand Up @@ -192,7 +192,7 @@ await Task.Run(() =>

private async Task Add()
{
var window = (Application.Current.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.MainWindow;
var window = (Application.Current?.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.MainWindow;
if (window is null)
{
return;
Expand Down Expand Up @@ -245,7 +245,7 @@ private async Task ExportSelected(string format)
return;
}

var window = (Application.Current.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.MainWindow;
var window = (Application.Current?.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.MainWindow;
if (window is null)
{
return;
Expand Down Expand Up @@ -279,7 +279,7 @@ private async Task ExportAll(string format)
return;
}

var window = (Application.Current.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.MainWindow;
var window = (Application.Current?.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.MainWindow;
if (window is null)
{
return;
Expand Down Expand Up @@ -320,7 +320,10 @@ private async Task Clipboard(string format)
{
try
{
return await Application.Current.Clipboard.GetTextAsync();
if (Application.Current?.Clipboard is { } clipboard)
{
return await clipboard.GetTextAsync();
}
}
catch
{
Expand Down Expand Up @@ -385,7 +388,10 @@ await Dispatcher.UIThread.InvokeAsync(async () =>
{
try
{
await Application.Current.Clipboard.SetTextAsync(xaml);
if (Application.Current?.Clipboard is { } clipboard)
{
await clipboard.SetTextAsync(xaml);
}
}
catch
{
Expand Down Expand Up @@ -549,7 +555,11 @@ await Dispatcher.UIThread.InvokeAsync(async () =>
Height = 600
};
await window.ShowDialog((Application.Current.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.MainWindow);
var owner = (Application.Current?.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.MainWindow;
if (owner is { })
{
await window.ShowDialog(owner);
}
}
catch
{
Expand Down Expand Up @@ -579,4 +589,4 @@ public void Add(IEnumerable<string> paths)
Project.Items.Add(item);
}
}
}
}

0 comments on commit a4ad896

Please sign in to comment.