sc 1 year ago
parent
commit
4a1165fe07
  1. 14
      DyeingComputer.csproj
  2. 14
      MainWindow.xaml
  3. 4
      MainWindow.xaml.cs
  4. 12
      View/WorkOrder.xaml
  5. 28
      View/WorkOrder.xaml.cs
  6. 41
      ViewModel/ViewModelLocator.cs

14
DyeingComputer.csproj

@ -89,6 +89,10 @@
<Compile Include="UserClass\SqliteHelper.cs" />
<Compile Include="UserClass\StrToInt.cs" />
<Compile Include="UserClass\TCPServer.cs" />
<Compile Include="ViewModel\ViewModelLocator.cs" />
<Compile Include="View\WorkOrder.xaml.cs">
<DependentUpon>WorkOrder.xaml</DependentUpon>
</Compile>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@ -101,6 +105,10 @@
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="View\WorkOrder.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
@ -177,10 +185,12 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Model\" />
<Folder Include="ViewModel\" />
<Folder Include="View\" />
<Folder Include="Windows\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommonServiceLocator">
<Version>2.0.7</Version>
</PackageReference>
<PackageReference Include="CommunityToolkit.Mvvm">
<Version>8.2.2</Version>
</PackageReference>

14
MainWindow.xaml

@ -4,20 +4,16 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:lang="clr-namespace:DyeingComputer.Properties"
xmlns:local="clr-namespace:DyeingComputer"
xmlns:local="clr-namespace:DyeingComputer"
mc:Ignorable="d"
Title="SUNLIGHT 838 b0.0.1 (2024/08/10)"
Title="SUNLIGHT 838 b0.0.1 (2024/08/10)"
Height="720" Width="1280">
<Window.Resources>
<Window.Resources>
<Style x:Key="RadioButtonStyle" TargetType="{x:Type RadioButton}">
<Setter Property="Background" Value="{DynamicResource MahApps.Brushes.ThemeBackground}"/>
<Setter Property="BorderBrush" Value="{DynamicResource MahApps.Brushes.CheckBox}"/>
<Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}"/>
<Setter Property="FontFamily" Value="{DynamicResource MahApps.Fonts.Family.Control}"/>
<Setter Property="FontSize" Value="{DynamicResource MahApps.Font.Size.Content}"/>
<Setter Property="Foreground" Value="{DynamicResource MahApps.Brushes.Text}"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="Padding" Value="6 0 0 0"/>

4
MainWindow.xaml.cs

@ -1,4 +1,6 @@
using DyeingComputer.UserClass;
using DyeingComputer.ViewModel;
using DyeingComputer.View;
using System;
using System.Collections.Generic;
using System.Linq;
@ -13,7 +15,6 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Data.SQLite;
namespace DyeingComputer
{
@ -25,6 +26,7 @@ namespace DyeingComputer
public MainWindow()
{
InitializeComponent();
}
private void RadioButton_toolbar(object sender, RoutedEventArgs e)

12
View/WorkOrder.xaml

@ -0,0 +1,12 @@
<UserControl x:Class="DyeingComputer.View.WorkOrder"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DyeingComputer.View"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
</Grid>
</UserControl>

28
View/WorkOrder.xaml.cs

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace DyeingComputer.View
{
/// <summary>
/// WorkOrder.xaml 的交互逻辑
/// </summary>
public partial class WorkOrder : UserControl
{
public WorkOrder()
{
InitializeComponent();
}
}
}

41
ViewModel/ViewModelLocator.cs

@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
using CommonServiceLocator;
namespace DyeingComputer.ViewModel
{
public class ViewModelLocator
{
public ViewModelLocator()
{
// ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
////if (ViewModelBase.IsInDesignModeStatic)
////{
//// // Create design time view services and models
//// SimpleIoc.Default.Register<IDataService, DesignDataService>();
////}
////else
////{
//// // Create run time view services and models
//// SimpleIoc.Default.Register<IDataService, DataService>();
////}
// SimpleIoc.Default.Register<MainWindowViewModel>();
}
// public MainWindowViewModel Main
// {
// get
// {
// return ServiceLocator.Current.GetInstance<MainWindowViewModel>();
// }
// }
}
}
Loading…
Cancel
Save