Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 0 additions & 21 deletions TriasDev.Templify.Gui/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
// Licensed under the MIT License. See LICENSE file in the project root for full license information.

using System;
using System.Linq;
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Data.Core;
using Avalonia.Data.Core.Plugins;
using Avalonia.Markup.Xaml;
using Microsoft.Extensions.DependencyInjection;
using TriasDev.Templify.Gui.Services;
Expand All @@ -28,11 +25,6 @@ public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
// Avoid duplicate validations from both Avalonia and the CommunityToolkit.
// More info: https://docs.avaloniaui.net/docs/guides/development-guides/data-validation#manage-validationplugins
DisableAvaloniaDataAnnotationValidation();

// Create MainWindow first
MainWindow mainWindow = new MainWindow();
desktop.MainWindow = mainWindow;

Expand Down Expand Up @@ -73,17 +65,4 @@ private void ConfigureServices(IServiceCollection services)
throw new InvalidOperationException("MainWindow not available for FileDialogService");
});
}

private void DisableAvaloniaDataAnnotationValidation()
{
// Get an array of plugins to remove
DataAnnotationsValidationPlugin[] dataValidationPluginsToRemove =
BindingPlugins.DataValidators.OfType<DataAnnotationsValidationPlugin>().ToArray();

// remove each entry found
foreach (DataAnnotationsValidationPlugin plugin in dataValidationPluginsToRemove)
{
BindingPlugins.DataValidators.Remove(plugin);
}
}
}
12 changes: 6 additions & 6 deletions TriasDev.Templify.Gui/TriasDev.Templify.Gui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.3.10" />
<PackageReference Include="Avalonia.Desktop" Version="11.3.10" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.3.10" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.10" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Include="Avalonia.Diagnostics" Version="11.3.10">
<PackageReference Include="Avalonia" Version="12.0.3" />
<PackageReference Include="Avalonia.Desktop" Version="12.0.3" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="12.0.3" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="12.0.3" />
<!--Avalonia 12 replaces Avalonia.Diagnostics with AvaloniaUI.DiagnosticsSupport (bridge to external DevTools, F12).-->
<PackageReference Include="AvaloniaUI.DiagnosticsSupport" Version="2.2.1">
<IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
</PackageReference>
Expand Down
6 changes: 3 additions & 3 deletions TriasDev.Templify.Gui/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<TextBox Grid.Column="1"
Text="{Binding TemplatePath}"
IsReadOnly="True"
Watermark="Select a .docx template file"
PlaceholderText="Select a .docx template file"
Margin="10,0,10,0"/>
<Button Grid.Column="2"
Content="Browse..."
Expand All @@ -43,7 +43,7 @@
<TextBox Grid.Column="1"
Text="{Binding JsonPath}"
IsReadOnly="True"
Watermark="Select a .json data file"
PlaceholderText="Select a .json data file"
Margin="10,0,10,0"/>
<Button Grid.Column="2"
Content="Browse..."
Expand All @@ -56,7 +56,7 @@
<TextBox Grid.Column="1"
Text="{Binding OutputPath}"
IsReadOnly="True"
Watermark="Output will be saved here"
PlaceholderText="Output will be saved here"
Margin="10,0,10,0"/>
<Button Grid.Column="2"
Content="Browse..."
Expand Down
Loading