diff --git a/XplorePlane.sln b/XplorePlane.sln new file mode 100644 index 0000000..e5c7cfb --- /dev/null +++ b/XplorePlane.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36811.4 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XplorePlane", "XplorePlane\XplorePlane.csproj", "{07978DB9-4B88-4F42-9054-73992742BD6A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {07978DB9-4B88-4F42-9054-73992742BD6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {07978DB9-4B88-4F42-9054-73992742BD6A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {07978DB9-4B88-4F42-9054-73992742BD6A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {07978DB9-4B88-4F42-9054-73992742BD6A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DB6D69BA-49FD-432F-8069-2A8F64933CDE} + EndGlobalSection +EndGlobal diff --git a/XplorePlane/App.xaml b/XplorePlane/App.xaml new file mode 100644 index 0000000..000a134 --- /dev/null +++ b/XplorePlane/App.xaml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/XplorePlane/App.xaml.cs b/XplorePlane/App.xaml.cs new file mode 100644 index 0000000..38bec1d --- /dev/null +++ b/XplorePlane/App.xaml.cs @@ -0,0 +1,37 @@ +using System.Windows; +using XplorePlane.Views; +using XplorePlane.ViewModels; +using Prism.Ioc; +using Prism.DryIoc; + +namespace XplorePlane +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + protected override void OnStartup(StartupEventArgs e) + { + base.OnStartup(e); + + // Initialize Prism with DryIoc + var bootstrapper = new AppBootstrapper(); + bootstrapper.Run(); + } + } + + public class AppBootstrapper : PrismBootstrapper + { + protected override Window CreateShell() + { + return Container.Resolve(); + } + + protected override void RegisterTypes(IContainerRegistry containerRegistry) + { + containerRegistry.RegisterForNavigation(); + containerRegistry.Register(); + } + } +} diff --git a/XplorePlane/Assets/Icons/.gitkeep b/XplorePlane/Assets/Icons/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/XplorePlane/Models/Models.cs b/XplorePlane/Models/Models.cs new file mode 100644 index 0000000..b3b8608 --- /dev/null +++ b/XplorePlane/Models/Models.cs @@ -0,0 +1,287 @@ +using System; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Runtime.CompilerServices; +using System.Windows.Input; + +namespace XplorePlane.Models +{ + // ── Navigation Tree Models ──────────────────────────────────────── + public class NavGroupNode : INotifyPropertyChanged + { + public event PropertyChangedEventHandler PropertyChanged; + + private string _name; + public string Name + { + get => _name; + set { _name = value; OnPropertyChanged(); } + } + + private ObservableCollection _children; + public ObservableCollection Children + { + get => _children; + set { _children = value; OnPropertyChanged(); } + } + + public NavGroupNode(string name) + { + Name = name; + Children = new ObservableCollection(); + } + + protected void OnPropertyChanged([CallerMemberName] string name = null) + => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + } + + public class NavLeafNode : INotifyPropertyChanged + { + public event PropertyChangedEventHandler PropertyChanged; + + private string _name; + public string Name + { + get => _name; + set { _name = value; OnPropertyChanged(); } + } + + private string _iconColor; + public string IconColor + { + get => _iconColor; + set { _iconColor = value; OnPropertyChanged(); } + } + + private bool _isSelected; + public bool IsSelected + { + get => _isSelected; + set { _isSelected = value; OnPropertyChanged(); } + } + + public NavLeafNode(string name, string IconColor = "#888888", bool IsSelected = false) + { + Name = name; + this.IconColor = IconColor; + this.IsSelected = IsSelected; + } + + protected void OnPropertyChanged([CallerMemberName] string name = null) + => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + } + + // ── Inspection Callout Models ───────────────────────────────────── + public class InspectionCalloutVM : INotifyPropertyChanged + { + public event PropertyChangedEventHandler PropertyChanged; + + private string _featureName; + public string FeatureName + { + get => _featureName; + set { _featureName = value; OnPropertyChanged(); } + } + + private double _x; + public double X + { + get => _x; + set { _x = value; OnPropertyChanged(); } + } + + private double _y; + public double Y + { + get => _y; + set { _y = value; OnPropertyChanged(); } + } + + private ObservableCollection _rows; + public ObservableCollection Rows + { + get => _rows; + set { _rows = value; OnPropertyChanged(); } + } + + public InspectionCalloutVM(string featureName, double x, double y, CalloutRowVM[] rows) + { + FeatureName = featureName; + X = x; + Y = y; + Rows = new ObservableCollection(rows); + } + + protected void OnPropertyChanged([CallerMemberName] string name = null) + => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + } + + public class CalloutRowVM : INotifyPropertyChanged + { + public event PropertyChangedEventHandler PropertyChanged; + + private string _label; + public string Label + { + get => _label; + set { _label = value; OnPropertyChanged(); } + } + + private string _nominal; + public string Nominal + { + get => _nominal; + set { _nominal = value; OnPropertyChanged(); } + } + + private string _measured; + public string Measured + { + get => _measured; + set { _measured = value; OnPropertyChanged(); } + } + + private string _tolerance; + public string Tolerance + { + get => _tolerance; + set { _tolerance = value; OnPropertyChanged(); } + } + + private string _deviation; + public string Deviation + { + get => _deviation; + set { _deviation = value; OnPropertyChanged(); } + } + + private bool _isPass; + public bool IsPass + { + get => _isPass; + set { _isPass = value; OnPropertyChanged(); } + } + + public CalloutRowVM(string label, string nominal, string measured, string tolerance, string deviation, bool isPass) + { + Label = label; + Nominal = nominal; + Measured = measured; + Tolerance = tolerance; + Deviation = deviation; + IsPass = isPass; + } + + protected void OnPropertyChanged([CallerMemberName] string name = null) + => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + } + + // ── Feature Properties Model ────────────────────────────────────── + public class FeatureProperties : INotifyPropertyChanged + { + public event PropertyChangedEventHandler PropertyChanged; + + private string _name; + public string Name + { + get => _name; + set { _name = value; OnPropertyChanged(); } + } + + private string _datumLabel; + public string DatumLabel + { + get => _datumLabel; + set { _datumLabel = value; OnPropertyChanged(); } + } + + private double _x; + public double X + { + get => _x; + set { _x = value; OnPropertyChanged(); } + } + + private double _y; + public double Y + { + get => _y; + set { _y = value; OnPropertyChanged(); } + } + + private double _z; + public double Z + { + get => _z; + set { _z = value; OnPropertyChanged(); } + } + + private double _nrX; + public double NrX + { + get => _nrX; + set { _nrX = value; OnPropertyChanged(); } + } + + private double _nrY; + public double NrY + { + get => _nrY; + set { _nrY = value; OnPropertyChanged(); } + } + + private double _nrZ; + public double NrZ + { + get => _nrZ; + set { _nrZ = value; OnPropertyChanged(); } + } + + private double _height; + public double Height + { + get => _height; + set { _height = value; OnPropertyChanged(); } + } + + private double _radius; + public double Radius + { + get => _radius; + set { _radius = value; OnPropertyChanged(); } + } + + private double _diameter; + public double Diameter + { + get => _diameter; + set { _diameter = value; OnPropertyChanged(); } + } + + protected void OnPropertyChanged([CallerMemberName] string name = null) + => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + } + + // ── RelayCommand Implementation ─────────────────────────────────── + public class RelayCommand : ICommand + { + private readonly Action _execute; + private readonly Predicate _canExecute; + + public event EventHandler CanExecuteChanged + { + add { CommandManager.RequerySuggested += value; } + remove { CommandManager.RequerySuggested -= value; } + } + + public RelayCommand(Action execute, Predicate canExecute = null) + { + _execute = execute ?? throw new ArgumentNullException(nameof(execute)); + _canExecute = canExecute; + } + + public bool CanExecute(object parameter) => _canExecute?.Invoke(parameter) ?? true; + + public void Execute(object parameter) => _execute(parameter); + } +} diff --git a/XplorePlane/ViewModels/MainViewModel.cs b/XplorePlane/ViewModels/MainViewModel.cs new file mode 100644 index 0000000..d0632a4 --- /dev/null +++ b/XplorePlane/ViewModels/MainViewModel.cs @@ -0,0 +1,33 @@ +using Prism.Commands; +using Prism.Mvvm; +using System.Collections.ObjectModel; + +namespace XplorePlane.ViewModels +{ + public class MainViewModel : BindableBase + { + private string _licenseInfo = "ǰʱ"; + + + public ObservableCollection NavigationTree { get; set; } + + public DelegateCommand NavigateHomeCommand { get; set; } + public DelegateCommand NavigateInspectCommand { get; set; } + public DelegateCommand OpenFileCommand { get; set; } + public DelegateCommand ExportCommand { get; set; } + public DelegateCommand ClearCommand { get; set; } + public DelegateCommand EditPropertiesCommand { get; set; } + + public MainViewModel() + { + NavigationTree = new ObservableCollection(); + + NavigateHomeCommand = new DelegateCommand(() => { }); + NavigateInspectCommand = new DelegateCommand(() => { }); + OpenFileCommand = new DelegateCommand(() => { }); + ExportCommand = new DelegateCommand(() => { }); + ClearCommand = new DelegateCommand(() => { }); + EditPropertiesCommand = new DelegateCommand(() => { }); + } + } +} diff --git a/XplorePlane/ViewModels/MainWindowViewModel.cs b/XplorePlane/ViewModels/MainWindowViewModel.cs new file mode 100644 index 0000000..2e47d47 --- /dev/null +++ b/XplorePlane/ViewModels/MainWindowViewModel.cs @@ -0,0 +1,19 @@ +using Prism.Mvvm; + +namespace XplorePlane.ViewModels +{ + public class MainWindowViewModel : BindableBase + { + private string _title = "Prism Application"; + public string Title + { + get { return _title; } + set { SetProperty(ref _title, value); } + } + + public MainWindowViewModel() + { + + } + } +} diff --git a/XplorePlane/Views/MainWindow.xaml b/XplorePlane/Views/MainWindow.xaml new file mode 100644 index 0000000..ee7cf48 --- /dev/null +++ b/XplorePlane/Views/MainWindow.xaml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +