Warnings cleanup
This commit is contained in:
parent
b2f5aee4e7
commit
0669b8910c
@ -1,6 +1,5 @@
|
|||||||
<Application xmlns="https://github.com/avaloniaui"
|
<Application xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:local="using:AutoCat"
|
|
||||||
xmlns:sty="using:FluentAvalonia.Styling"
|
xmlns:sty="using:FluentAvalonia.Styling"
|
||||||
x:Class="AutoCat.App"
|
x:Class="AutoCat.App"
|
||||||
RequestedThemeVariant="Default">
|
RequestedThemeVariant="Default">
|
||||||
|
|||||||
@ -11,7 +11,7 @@ using Microsoft.Extensions.Hosting;
|
|||||||
|
|
||||||
namespace AutoCat;
|
namespace AutoCat;
|
||||||
|
|
||||||
public partial class App : Application
|
public class App : Application
|
||||||
{
|
{
|
||||||
public IHost AppHost { get; private set; }
|
public IHost AppHost { get; private set; }
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
|
||||||
using Avalonia.Data;
|
using Avalonia.Data;
|
||||||
using Avalonia.Data.Converters;
|
using Avalonia.Data.Converters;
|
||||||
using Avalonia.Markup.Xaml;
|
using Avalonia.Markup.Xaml;
|
||||||
@ -7,9 +6,9 @@ using Avalonia.Markup.Xaml.MarkupExtensions;
|
|||||||
|
|
||||||
namespace AutoCat.Extensions;
|
namespace AutoCat.Extensions;
|
||||||
|
|
||||||
public class MathExtension: MarkupExtension
|
public class MathExtension(string path): MarkupExtension
|
||||||
{
|
{
|
||||||
public string Path { get; set; }
|
public string Path { get; set; } = path;
|
||||||
|
|
||||||
public double Mult { get; set; } = 1;
|
public double Mult { get; set; } = 1;
|
||||||
public double Add { get; set; } = 0;
|
public double Add { get; set; } = 0;
|
||||||
|
|||||||
@ -6,24 +6,20 @@ using Avalonia.Markup.Xaml.MarkupExtensions;
|
|||||||
|
|
||||||
namespace AutoCat.Extensions;
|
namespace AutoCat.Extensions;
|
||||||
|
|
||||||
public class TernaryExtension : MarkupExtension
|
public class TernaryExtension(string path) : MarkupExtension
|
||||||
{
|
{
|
||||||
public TernaryExtension()
|
public string Path { get; set; } = path;
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Path { get; set; }
|
public object? True { get; set; }
|
||||||
|
|
||||||
public object True { get; set; }
|
public object? False { get; set; }
|
||||||
|
|
||||||
public object False { get; set; }
|
|
||||||
|
|
||||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||||
{
|
{
|
||||||
var binding = new ReflectionBindingExtension(Path)
|
var binding = new ReflectionBindingExtension(Path)
|
||||||
{
|
{
|
||||||
Mode = BindingMode.OneWay,
|
Mode = BindingMode.OneWay,
|
||||||
Converter = new FuncValueConverter<bool, object>(e => e ? True : False)
|
Converter = new FuncValueConverter<bool, object?>(e => e ? True : False)
|
||||||
};
|
};
|
||||||
|
|
||||||
return binding.ProvideValue(serviceProvider);
|
return binding.ProvideValue(serviceProvider);
|
||||||
|
|||||||
@ -1,27 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Avalonia;
|
|
||||||
using Avalonia.Data;
|
|
||||||
using Avalonia.Data.Converters;
|
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
using Avalonia.Markup.Xaml.MarkupExtensions;
|
|
||||||
|
|
||||||
namespace AutoCat.Extensions;
|
|
||||||
|
|
||||||
public class ThicknessExtension: MarkupExtension
|
|
||||||
{
|
|
||||||
public string Path { get; set; }
|
|
||||||
|
|
||||||
public double Mult { get; set; } = 1;
|
|
||||||
public double Add { get; set; } = 0;
|
|
||||||
|
|
||||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
|
||||||
{
|
|
||||||
var binding = new ReflectionBindingExtension(Path)
|
|
||||||
{
|
|
||||||
Mode = BindingMode.OneWay,
|
|
||||||
Converter = new FuncValueConverter<double, object>(e => new Thickness( e*Mult + Add))
|
|
||||||
};
|
|
||||||
|
|
||||||
return binding.ProvideValue(serviceProvider);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace AutoCat.Pages;
|
namespace AutoCat.Pages;
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
using System;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using AutoCatCore.Model;
|
using AutoCatCore.Model;
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace AutoCat.Pages;
|
namespace AutoCat.Pages;
|
||||||
|
|
||||||
@ -20,7 +17,7 @@ public partial class ReportPage : UserControl
|
|||||||
|
|
||||||
public Vehicle Vehicle
|
public Vehicle Vehicle
|
||||||
{
|
{
|
||||||
get => (Vehicle)GetValue(VehicleProperty);
|
get => GetValue(VehicleProperty);
|
||||||
set => SetValue(VehicleProperty, value);
|
set => SetValue(VehicleProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace AutoCat.Pages;
|
namespace AutoCat.Pages;
|
||||||
|
|
||||||
|
|||||||
@ -5,9 +5,6 @@ using AutoCat.Utils;
|
|||||||
using AutoCatCore.Services.Api;
|
using AutoCatCore.Services.Api;
|
||||||
using AutoCatCore.Services.Storage;
|
using AutoCatCore.Services.Storage;
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
using MsBox.Avalonia;
|
|
||||||
using MsBox.Avalonia.Dto;
|
|
||||||
using MsBox.Avalonia.Enums;
|
|
||||||
|
|
||||||
namespace AutoCat.ViewModels;
|
namespace AutoCat.ViewModels;
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Reactive;
|
using System.Reactive;
|
||||||
using System.Reactive.Linq;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using AutoCat.Utils;
|
using AutoCat.Utils;
|
||||||
using AutoCatCore.Model;
|
using AutoCatCore.Model;
|
||||||
using AutoCatCore.Services.Api;
|
using AutoCatCore.Services.Api;
|
||||||
using DynamicData.Binding;
|
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
|
|
||||||
namespace AutoCat.ViewModels;
|
namespace AutoCat.ViewModels;
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using AutoCatCore.Model;
|
using AutoCatCore.Model;
|
||||||
using AutoCatCore.Services.Api;
|
using AutoCatCore.Services.Api;
|
||||||
using DynamicData;
|
using DynamicData;
|
||||||
@ -28,7 +27,7 @@ public class HistoryViewModel: ViewModelBase
|
|||||||
LoadVehicles();
|
LoadVehicles();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task LoadVehicles()
|
private async void LoadVehicles()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:pages="clr-namespace:AutoCat.Pages"
|
|
||||||
xmlns:views="clr-namespace:AutoCat.Views"
|
xmlns:views="clr-namespace:AutoCat.Views"
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
x:Class="AutoCat.Views.MasterDetailView"
|
x:Class="AutoCat.Views.MasterDetailView"
|
||||||
|
|||||||
@ -2,7 +2,6 @@ using System.Collections;
|
|||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls.Templates;
|
using Avalonia.Controls.Templates;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace AutoCat.Views;
|
namespace AutoCat.Views;
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
x:Name="PlateViewControl"
|
x:Name="PlateViewControl"
|
||||||
SizeChanged="UserControl_SizeChanged">
|
SizeChanged="UserControl_SizeChanged">
|
||||||
|
|
||||||
<Grid Height="{ext:Math Path=#PlateViewControl.Bounds.Width, Mult={x:Static views:PlateView.AspectRatio}}">
|
<Grid Height="{ext:Math #PlateViewControl.Bounds.Width, Mult={x:Static views:PlateView.AspectRatio}}">
|
||||||
<Rectangle Name="MainRect" Fill="#ccc"/>
|
<Rectangle Name="MainRect" Fill="#ccc"/>
|
||||||
<Grid ColumnDefinitions="73*,27*">
|
<Grid ColumnDefinitions="73*,27*">
|
||||||
|
|
||||||
@ -44,13 +44,12 @@
|
|||||||
Orientation="Horizontal"
|
Orientation="Horizontal"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center">
|
VerticalAlignment="Center">
|
||||||
<TextBlock Grid.Column="0"
|
<TextBlock x:Name="CountryName"
|
||||||
x:Name="CountryName"
|
|
||||||
Text="RUS"
|
Text="RUS"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Foreground="#ccc"/>
|
Foreground="#ccc"/>
|
||||||
<Grid Grid.Column="2" x:Name="FlagGrid" RowDefinitions="*,*,*">
|
<Grid x:Name="FlagGrid" RowDefinitions="*,*,*">
|
||||||
<Rectangle Grid.Row="0" Fill="White"/>
|
<Rectangle Grid.Row="0" Fill="White"/>
|
||||||
<Rectangle Grid.Row="1" Fill="Blue"/>
|
<Rectangle Grid.Row="1" Fill="Blue"/>
|
||||||
<Rectangle Grid.Row="2" Fill="Red"/>
|
<Rectangle Grid.Row="2" Fill="Red"/>
|
||||||
|
|||||||
@ -1,10 +1,6 @@
|
|||||||
using System;
|
|
||||||
using AutoCatCore.Model;
|
using AutoCatCore.Model;
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Data;
|
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
using SkiaSharp;
|
|
||||||
|
|
||||||
namespace AutoCat.Views;
|
namespace AutoCat.Views;
|
||||||
|
|
||||||
@ -21,7 +17,7 @@ public partial class PlateView : UserControl
|
|||||||
|
|
||||||
public string Number
|
public string Number
|
||||||
{
|
{
|
||||||
get => (string)GetValue(NumberProperty);
|
get => GetValue(NumberProperty);
|
||||||
set => SetValue(NumberProperty, value);
|
set => SetValue(NumberProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace AutoCat.Views;
|
namespace AutoCat.Views;
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
<TextBox Watermark="Password" PasswordChar="*"
|
<TextBox Watermark="Password" PasswordChar="*"
|
||||||
Text="{Binding Password}"
|
Text="{Binding Password}"
|
||||||
IsEnabled="{Binding !LoginCommand.IsExecuting^}"/>
|
IsEnabled="{Binding !LoginCommand.IsExecuting^}"/>
|
||||||
<Button Content="{ext:Ternary Path=LoginCommand.IsExecuting^, True=Logging In..., False=Log In}"
|
<Button Content="{ext:Ternary LoginCommand.IsExecuting^, True=Logging In..., False=Log In}"
|
||||||
Command="{Binding LoginCommand}"
|
Command="{Binding LoginCommand}"
|
||||||
IsEnabled="{Binding !LoginCommand.IsExecuting^}"
|
IsEnabled="{Binding !LoginCommand.IsExecuting^}"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
|
|||||||
@ -3,7 +3,6 @@ using Avalonia;
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls.ApplicationLifetimes;
|
using Avalonia.Controls.ApplicationLifetimes;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Hosting.Internal;
|
|
||||||
|
|
||||||
namespace AutoCat.Windows;
|
namespace AutoCat.Windows;
|
||||||
|
|
||||||
@ -15,7 +14,7 @@ public partial class AuthWindow : Window
|
|||||||
|
|
||||||
if (DataContext is AuthWindowViewModel vm)
|
if (DataContext is AuthWindowViewModel vm)
|
||||||
{
|
{
|
||||||
vm.ReplaceWithMainWindowEvent += (sender, args) =>
|
vm.ReplaceWithMainWindowEvent += (_, _) =>
|
||||||
{
|
{
|
||||||
if (Application.Current is not App app) return;
|
if (Application.Current is not App app) return;
|
||||||
if (app.ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop) return;
|
if (app.ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop) return;
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:utils="using:AutoCat.Utils"
|
xmlns:utils="using:AutoCat.Utils"
|
||||||
xmlns:vm="using:AutoCat.ViewModels"
|
xmlns:vm="using:AutoCat.ViewModels"
|
||||||
xmlns:ext="using:AutoCat.Extensions"
|
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
x:Class="AutoCat.Windows.CheckNumberDialog"
|
x:Class="AutoCat.Windows.CheckNumberDialog"
|
||||||
x:DataType="vm:CheckNumberViewModel"
|
x:DataType="vm:CheckNumberViewModel"
|
||||||
|
|||||||
@ -1,8 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls.Primitives;
|
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
using FluentAvalonia.UI.Controls;
|
|
||||||
|
|
||||||
namespace AutoCat.Windows;
|
namespace AutoCat.Windows;
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,6 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:utils="using:AutoCat.Utils"
|
xmlns:utils="using:AutoCat.Utils"
|
||||||
xmlns:ui="using:FluentAvalonia.UI.Controls"
|
xmlns:ui="using:FluentAvalonia.UI.Controls"
|
||||||
xmlns:uip="using:FluentAvalonia.UI.Controls.Primitives"
|
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
Width="800"
|
Width="800"
|
||||||
Height="600"
|
Height="600"
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using AutoCat.Pages;
|
using AutoCat.Pages;
|
||||||
using AutoCat.ViewModels;
|
using AutoCat.ViewModels;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
@ -66,7 +65,7 @@ public partial class MainWindow : Window
|
|||||||
|
|
||||||
if (dialogContent.DataContext is CheckNumberViewModel vm)
|
if (dialogContent.DataContext is CheckNumberViewModel vm)
|
||||||
{
|
{
|
||||||
vm.AutoCloseEvent += (sender, args) =>
|
vm.AutoCloseEvent += (_, _) =>
|
||||||
{
|
{
|
||||||
dialog.Hide();
|
dialog.Hide();
|
||||||
Console.WriteLine($"Checked number: {vm.Vehicle?.Number}");
|
Console.WriteLine($"Checked number: {vm.Vehicle?.Number}");
|
||||||
|
|||||||
@ -1,9 +1,4 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace AutoCatCore.Model
|
namespace AutoCatCore.Model
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user