Prechádzať zdrojové kódy

Starting on live maps

Kenric Nugteren 5 mesiacov pred
rodič
commit
bbeaefee74

+ 1 - 4
PRS.Avalonia/PRS.Avalonia.Desktop/PRS.Avalonia.Desktop.csproj

@@ -9,6 +9,7 @@
         <UseWinUI>true</UseWinUI>
         <WindowsPackaging>None</WindowsPackaging>
         <EnableMsixTooling>true</EnableMsixTooling>
+        <Configurations>Debug;Release;DebugDev</Configurations>
     </PropertyGroup>
 
     <PropertyGroup>
@@ -22,10 +23,6 @@
     <ItemGroup>
         <PackageReference Include="Avalonia.Desktop" />
         <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
-        <PackageReference Include="Avalonia.Diagnostics">
-            <IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
-            <PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
-        </PackageReference>
     </ItemGroup>
 
     <ItemGroup>

+ 25 - 0
PRS.Avalonia/PRS.Avalonia/Modules/EquipmentModule/EquipmentMaps/EquipmentMapsMenuView.axaml

@@ -0,0 +1,25 @@
+<UserControl xmlns="https://github.com/avaloniaui"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+             xmlns:modules="clr-namespace:PRS.Avalonia.Modules"
+             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
+             x:Class="PRS.Avalonia.Modules.EquipmentMapsMenuView"
+             x:DataType="modules:EquipmentMapsMenuViewModel">
+	<Grid>
+		<Grid.RowDefinitions>
+			<RowDefinition Height="*"/>
+			<RowDefinition Height="Auto"/>
+		</Grid.RowDefinitions>
+		<Grid.ColumnDefinitions>
+			<ColumnDefinition Width="*"/>
+			<ColumnDefinition Width="*"/>
+		</Grid.ColumnDefinitions>
+		
+		<Button Grid.Row="1" Grid.Column="0"
+				Content="Clear All"
+				Command="{Binding ClearAllCommand}"/>
+		<Button Grid.Row="1" Grid.Column="1"
+				Content="Select All"/>
+	</Grid>
+</UserControl>

+ 16 - 0
PRS.Avalonia/PRS.Avalonia/Modules/EquipmentModule/EquipmentMaps/EquipmentMapsMenuView.axaml.cs

@@ -0,0 +1,16 @@
+using Avalonia.Controls;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PRS.Avalonia.Modules;
+
+public partial class EquipmentMapsMenuView : UserControl
+{
+    public EquipmentMapsMenuView()
+    {
+        InitializeComponent();
+    }
+}

+ 19 - 0
PRS.Avalonia/PRS.Avalonia/Modules/EquipmentModule/EquipmentMaps/EquipmentMapsMenuViewModel.cs

@@ -0,0 +1,19 @@
+using CommunityToolkit.Mvvm.Input;
+using DialogHostAvalonia;
+using InABox.Avalonia;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PRS.Avalonia.Modules;
+
+public partial class EquipmentMapsMenuViewModel : PopupViewModel
+{
+    [RelayCommand]
+    private void ClearAll()
+    {
+        Close();
+    }
+}

+ 10 - 1
PRS.Avalonia/PRS.Avalonia/Modules/EquipmentModule/EquipmentMaps/EquipmentMapsView.axaml

@@ -3,8 +3,17 @@
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:modules="clr-namespace:PRS.Avalonia.Modules"
+             xmlns:components="clr-namespace:InABox.Avalonia.Components;assembly=InABox.Avalonia"
              mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
              x:Class="PRS.Avalonia.Modules.EquipmentMapsView"
              x:DataType="modules:EquipmentMapsViewModel">
-    Welcome to Avalonia!
+	<Grid>
+		<Grid.RowDefinitions>
+			<RowDefinition Height="Auto"/>
+			<RowDefinition Height="*"/>
+		</Grid.RowDefinitions>
+		
+		<components:SearchBar Command="{Binding SearchCommand}"
+							  Text="{Binding SearchText}"/>
+	</Grid>
 </UserControl>

+ 27 - 1
PRS.Avalonia/PRS.Avalonia/Modules/EquipmentModule/EquipmentMaps/EquipmentMapsViewModel.cs

@@ -1,6 +1,32 @@
+using CommunityToolkit.Mvvm.ComponentModel;
+using CommunityToolkit.Mvvm.Input;
+using InABox.Avalonia;
+using InABox.Avalonia.Components;
+using PRS.Avalonia.Dialogs;
+using System.Threading.Tasks;
+
 namespace PRS.Avalonia.Modules;
 
-public class EquipmentMapsViewModel : ModuleViewModel
+public partial class EquipmentMapsViewModel : ModuleViewModel
 {
     public override string Title => "Live Maps";
+
+    [ObservableProperty]
+    private string _searchText = "";
+
+    public EquipmentMapsViewModel()
+    {
+        PrimaryMenu.Add(new AvaloniaMenuItem(Images.menu, SelectFilter));
+    }
+
+    private async Task<bool> SelectFilter()
+    {
+        return true;
+    }
+
+    [RelayCommand]
+    private void Search()
+    {
+
+    }
 }

+ 6 - 0
PRS.Avalonia/PRS.Avalonia/PRS.Avalonia.csproj

@@ -4,6 +4,10 @@
         <Nullable>enable</Nullable>
         <LangVersion>latest</LangVersion>
         <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
+        <Configurations>Debug;Release;DebugDev</Configurations>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDev|AnyCPU'">
+      <DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
     </PropertyGroup>
 
     <ItemGroup>
@@ -301,6 +305,8 @@
         <PackageReference Include="Avalonia.Fonts.Inter" />
         <PackageReference Include="Avalonia.Themes.Fluent" />
         <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
+		<PackageReference Condition="'$(Configuration)' == 'DebugDev'" Include="Avalonia.Diagnostics" />
+
         <PackageReference Include="CommunityToolkit.Mvvm" />
         <PackageReference Include="DialogHost.Avalonia" />
         <PackageReference Include="Material.Avalonia" />

+ 1 - 1
prs.classes/PRSClasses.csproj

@@ -5,7 +5,7 @@
         <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
         <RootNamespace>Comal.Classes</RootNamespace>
 		<Nullable>enable</Nullable>
-		<Configurations>Debug;Release;Test</Configurations>
+		<Configurations>Debug;Release;Test;DebugDev</Configurations>
 		<Platforms>AnyCPU;x64</Platforms>
     </PropertyGroup>
 

+ 1 - 1
prs.desktop/PRSDesktop.csproj

@@ -11,7 +11,7 @@
         <FileVersion>1.0</FileVersion>
         <IsPackable>false</IsPackable>
 		<Nullable>enable</Nullable>
-		<Configurations>Debug;Release;Debug - DB;Test</Configurations>
+		<Configurations>Debug;Release;Debug - DB;Test;DebugDev</Configurations>
 
 		<PreserveCompilationContext>true</PreserveCompilationContext>
 

+ 1 - 1
prs.licensing/PRSLicensing.csproj

@@ -6,7 +6,7 @@
     <UseWPF>true</UseWPF>
     <ApplicationIcon>reversed.ico</ApplicationIcon>
     <TargetFramework>net8.0-windows</TargetFramework>
-    <Configurations>Debug;Release;Test</Configurations>
+    <Configurations>Debug;Release;Test;DebugDev</Configurations>
     <Platforms>AnyCPU;x64</Platforms>
   </PropertyGroup>
 

+ 4 - 3
prs.mobile.new/PRS.Mobile/PRS.Mobile.csproj

@@ -4,6 +4,7 @@
         <LangVersion>9</LangVersion>
         <Nullable>enable</Nullable>
         <TargetFramework>netstandard2.1</TargetFramework>
+        <Configurations>Debug;Release;DebugDev</Configurations>
     </PropertyGroup>
 
     <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -129,10 +130,10 @@
       <SharedImage Include="Images\photolibrary.svg" BaseSize="50,50" />
       <SharedImage Include="Images\clock.svg" BaseSize="50,50" />
       <SharedImage Include="Images\rotate.svg" BaseSize="50,50" />
-      <SharedImage Include="Images\trash.svg"  BaseSize="30,30" />
+      <SharedImage Include="Images\trash.svg" BaseSize="30,30" />
       <SharedImage Include="Images\barcode.svg" BaseSize="50,50" />
-      <SharedImage Include="Images\hide.svg"  BaseSize="30,30" />
-      <SharedImage Include="Images\show.svg"  BaseSize="30,30" />
+      <SharedImage Include="Images\hide.svg" BaseSize="30,30" />
+      <SharedImage Include="Images\show.svg" BaseSize="30,30" />
     </ItemGroup>
 
     <ItemGroup>

+ 1 - 1
prs.server/PRSServer.csproj

@@ -12,7 +12,7 @@
         <AssemblyName>PRSServer</AssemblyName>
         <RootNamespace>$(AssemblyName)</RootNamespace>
         <StartupObject>PRSServer.App</StartupObject>
-        <Configurations>Debug;Release;Debug - DB;Test</Configurations>
+        <Configurations>Debug;Release;Debug - DB;Test;DebugDev</Configurations>
         <ApplicationIcon>hollow.ico</ApplicationIcon>
 		<PreserveCompilationContext>true</PreserveCompilationContext>
 		<Platforms>AnyCPU;x64</Platforms>

+ 1 - 1
prs.services/PRSServices.csproj

@@ -4,7 +4,7 @@
     <TargetFramework>net8.0-windows</TargetFramework>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Configurations>Debug;Release;Test</Configurations>
+    <Configurations>Debug;Release;Test;DebugDev</Configurations>
     <Platforms>AnyCPU;x64</Platforms>
   </PropertyGroup>
 

+ 1 - 1
prs.shared/PRS.Shared.csproj

@@ -6,7 +6,7 @@
     <Nullable>enable</Nullable>
 	  <UseWpf>true</UseWpf>
 	  <LangVersion>default</LangVersion>
-	  <Configurations>Debug;Release;Test</Configurations>
+	  <Configurations>Debug;Release;Test;DebugDev</Configurations>
 	  <Platforms>AnyCPU;x64</Platforms>
   </PropertyGroup>
 

+ 1 - 1
prs.stores/PRSStores.csproj

@@ -4,7 +4,7 @@
     <TargetFramework>net8.0-windows</TargetFramework>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Configurations>Debug;Release;Test</Configurations>
+    <Configurations>Debug;Release;Test;DebugDev</Configurations>
     <Platforms>AnyCPU;x64</Platforms>
   </PropertyGroup>