diff --git a/LOMV2.sln b/LOMV2.sln new file mode 100644 index 0000000..9444e73 --- /dev/null +++ b/LOMV2.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33213.308 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LOMV2", "LOMV2\LOMV2.csproj", "{FA3491CE-5EF8-40DE-8E19-218ECAEBB7A5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FA3491CE-5EF8-40DE-8E19-218ECAEBB7A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA3491CE-5EF8-40DE-8E19-218ECAEBB7A5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA3491CE-5EF8-40DE-8E19-218ECAEBB7A5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA3491CE-5EF8-40DE-8E19-218ECAEBB7A5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {3B58DAEB-67E9-42DF-BA8A-0A1916C669C5} + EndGlobalSection +EndGlobal diff --git a/LOMV2/App.xaml b/LOMV2/App.xaml new file mode 100644 index 0000000..e2fcc17 --- /dev/null +++ b/LOMV2/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/LOMV2/App.xaml.cs b/LOMV2/App.xaml.cs new file mode 100644 index 0000000..9f068fc --- /dev/null +++ b/LOMV2/App.xaml.cs @@ -0,0 +1,38 @@ +using LOM.Services; +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace LOM; + +/// +/// Interaction logic for App.xaml +/// +public partial class App : Application +{ + private ServiceProvider serviceProvider; + + public App() + { + IServiceCollection services = new ServiceCollection(); + ConfigureServices(services); + serviceProvider = services.BuildServiceProvider(); + } + + private void ConfigureServices(IServiceCollection services) + { + services.AddSingleton(); + services.AddScoped(); + } + + private void OnStartup(object sender, StartupEventArgs e) + { + var mainWindow = serviceProvider.GetService(); + mainWindow.Show(); + } +} diff --git a/LOMV2/AssemblyInfo.cs b/LOMV2/AssemblyInfo.cs new file mode 100644 index 0000000..8b5504e --- /dev/null +++ b/LOMV2/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/LOMV2/Converters/StringDoubleConverter.cs b/LOMV2/Converters/StringDoubleConverter.cs new file mode 100644 index 0000000..53806ab --- /dev/null +++ b/LOMV2/Converters/StringDoubleConverter.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using System.Windows; + +namespace LOM.Converters; + +[ValueConversion(typeof(String), typeof(Double))] +public class StringBoolDataConverter : IValueConverter +{ + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + double doValue = (double)value; + return doValue.ToString(); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + string strValue = value as string; + if (double.TryParse(strValue, out double result)) + { + return result; + } + return DependencyProperty.UnsetValue; + } +} diff --git a/LOMV2/InputDialog.xaml b/LOMV2/InputDialog.xaml new file mode 100644 index 0000000..1f7fb31 --- /dev/null +++ b/LOMV2/InputDialog.xaml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + Answer + + + + + + + \ No newline at end of file diff --git a/LOMV2/InputDialog.xaml.cs b/LOMV2/InputDialog.xaml.cs new file mode 100644 index 0000000..56c0f6a --- /dev/null +++ b/LOMV2/InputDialog.xaml.cs @@ -0,0 +1,45 @@ +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.Shapes; + +namespace LOM +{ + /// + /// Interaction logic for InputDialog.xaml + /// + public partial class InputDialog : Window + { + public InputDialog(string question, string defaultAnswer = "") + { + InitializeComponent(); + lblQuestion.Content = question; + txtAnswer.Text = defaultAnswer; + } + + private void btnDialogOk_Click(object sender, RoutedEventArgs e) + { + this.DialogResult = true; + } + + private void Window_ContentRendered(object sender, EventArgs e) + { + txtAnswer.SelectAll(); + txtAnswer.Focus(); + } + + public string Answer + { + get { return txtAnswer.Text; } + } + } +} diff --git a/LOMV2/LOMV2.csproj b/LOMV2/LOMV2.csproj new file mode 100644 index 0000000..47b5b07 --- /dev/null +++ b/LOMV2/LOMV2.csproj @@ -0,0 +1,32 @@ + + + + WinExe + net7.0-windows + enable + true + LOMV2 + LOM + True + exeIcon2.ico + 0.8.0 + exeIcon2.png + + + + + + + + + + + + + + True + \ + + + + diff --git a/LOMV2/MainWindow.xaml b/LOMV2/MainWindow.xaml new file mode 100644 index 0000000..d72f0a2 --- /dev/null +++ b/LOMV2/MainWindow.xaml @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +