Skip to content
This repository was archived by the owner on Oct 19, 2025. It is now read-only.

Commit 3da4221

Browse files
committed
Initial
1 parent f5f9140 commit 3da4221

File tree

102 files changed

+5113
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+5113
-0
lines changed
203 KB
Binary file not shown.

Resources/appicon.ico

15.5 KB
Binary file not shown.

Source/.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[*.cs]
2+
3+
# CA1822: Mark members as static
4+
dotnet_diagnostic.CA1822.severity = none

Source/Compunet.SudokuSolver.sln

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.2.32630.192
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Compunet.SudokuSolver", "Compunet.SudokuSolver\Compunet.SudokuSolver.csproj", "{919C24F3-65B8-41A2-8156-A9A29FEC51FB}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A6841F4F-45FB-430C-BDCF-358343CDDCBD}"
9+
ProjectSection(SolutionItems) = preProject
10+
.editorconfig = .editorconfig
11+
EndProjectSection
12+
EndProject
13+
Global
14+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
15+
Debug|Any CPU = Debug|Any CPU
16+
Release|Any CPU = Release|Any CPU
17+
EndGlobalSection
18+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
19+
{919C24F3-65B8-41A2-8156-A9A29FEC51FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20+
{919C24F3-65B8-41A2-8156-A9A29FEC51FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
21+
{919C24F3-65B8-41A2-8156-A9A29FEC51FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
22+
{919C24F3-65B8-41A2-8156-A9A29FEC51FB}.Release|Any CPU.Build.0 = Release|Any CPU
23+
EndGlobalSection
24+
GlobalSection(SolutionProperties) = preSolution
25+
HideSolutionNode = FALSE
26+
EndGlobalSection
27+
GlobalSection(ExtensibilityGlobals) = postSolution
28+
SolutionGuid = {C6C6CD8F-B694-45F7-BDC6-5E5B51478904}
29+
EndGlobalSection
30+
EndGlobal
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Application x:Class="Compunet.SudokuSolver.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:Compunet.SudokuSolver">
5+
<Application.Resources>
6+
<ResourceDictionary>
7+
<ResourceDictionary.MergedDictionaries>
8+
<ResourceDictionary Source="/Theming/Themes/LightTheme.xaml"/>
9+
<ResourceDictionary Source="/Theming/Fonts.xaml"/>
10+
<ResourceDictionary Source="/Theming/Icons.xaml"/>
11+
<ResourceDictionary Source="/Theming/ToolTip.xaml"/>
12+
<ResourceDictionary Source="/Theming/TextBox.xaml"/>
13+
<ResourceDictionary Source="/Theming/Buttons.xaml"/>
14+
<ResourceDictionary Source="/Theming/Windows.xaml"/>
15+
</ResourceDictionary.MergedDictionaries>
16+
</ResourceDictionary>
17+
</Application.Resources>
18+
</Application>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
using Compunet.SudokuSolver.Container;
2+
using Compunet.SudokuSolver.Mvvm;
3+
using Compunet.SudokuSolver.Services;
4+
using Compunet.SudokuSolver.Theming.Themes;
5+
using Microsoft.Extensions.DependencyInjection;
6+
using System.Windows;
7+
8+
namespace Compunet.SudokuSolver
9+
{
10+
public partial class App : Application
11+
{
12+
protected override async void OnStartup(StartupEventArgs e)
13+
{
14+
IServiceCollection services = new ServiceCollection();
15+
ConfigureServices(services);
16+
17+
IoC.CreateSimple(services);
18+
19+
await IoC.Simple.GetRequiredService<ISettingsService>().Load();
20+
await IoC.Simple.GetRequiredService<IThemeService>().Load();
21+
22+
MainWindow = new AppWindow();
23+
MainWindow.Show();
24+
}
25+
26+
private IServiceCollection ConfigureServices(IServiceCollection services)
27+
{
28+
return services.AddTransient<CreatePuzzleDialogViewModel>()
29+
.AddTransient<SudokuViewModel>()
30+
.AddTransient<AppWindowViewModel>()
31+
.AddTransient<AppSidebarViewModel>()
32+
.AddSingleton<ISudokuStoreService, SudokuStoreService>()
33+
.AddSingleton<ISudokuInputService, SudokuInputService>()
34+
.AddSingleton<ISettingsService, SettingsService>()
35+
.AddSingleton<ICreatePuzzleDialogService, CreatePuzzleDialogService>()
36+
.AddSingleton<IExitService, ExitService>()
37+
.AddSingleton<IThemeService, ThemeManager>();
38+
}
39+
40+
protected override void OnExit(ExitEventArgs e)
41+
{
42+
IoC.Simple.GetRequiredService<IExitService>().OnExit();
43+
IoC.Simple.GetRequiredService<ISettingsService>().Save().Wait();
44+
}
45+
}
46+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<controls:BaseWindow
2+
x:Class="Compunet.SudokuSolver.AppWindow"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
xmlns:local="clr-namespace:Compunet.SudokuSolver"
8+
mc:Ignorable="d"
9+
xmlns:controls="clr-namespace:Compunet.SudokuSolver.Controls"
10+
xmlns:views="clr-namespace:Compunet.SudokuSolver.Views"
11+
xmlns:converters="clr-namespace:Compunet.SudokuSolver.Mvvm.Converters"
12+
xmlns:mvvm="clr-namespace:Compunet.SudokuSolver.Mvvm"
13+
xmlns:wpf="clr-namespace:Compunet.SudokuSolver.Windows"
14+
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
15+
xmlns:behavior="clr-namespace:Compunet.SudokuSolver.Behaviors"
16+
d:DataContext="{d:DesignInstance Type=mvvm:AppWindowViewModel}"
17+
WindowState="Maximized"
18+
FlowDirection="RightToLeft"
19+
Style="{StaticResource ThemeWindow}"
20+
MinHeight="700"
21+
MinWidth="{Binding ElementName=BoardControl, Path=ActualWidth}"
22+
Title="סודוקו" Height="450" Width="1000">
23+
24+
<Grid>
25+
26+
<Grid Name="RootContent">
27+
28+
<Grid.ColumnDefinitions>
29+
<ColumnDefinition x:Name="SidebarArea" Width="1*"/>
30+
<ColumnDefinition Width="Auto"/>
31+
<ColumnDefinition Width="1*"/>
32+
</Grid.ColumnDefinitions>
33+
34+
<Grid Grid.Column="0">
35+
36+
<views:AppSidebarControl Width="60" HorizontalAlignment="Left"/>
37+
38+
</Grid>
39+
40+
<Grid Grid.Column="1"
41+
Name="BoardControl">
42+
43+
<Viewbox>
44+
45+
<views:SudokuControl Margin="20"
46+
Width="500"
47+
Height="550"/>
48+
49+
</Viewbox>
50+
51+
</Grid>
52+
53+
<!--<Grid>
54+
55+
<controls:SubmitFeedbackPopupControl x:Name="SubmitFeedbackPopup"/>
56+
57+
</Grid>-->
58+
59+
</Grid>
60+
61+
<Grid>
62+
<Border Name="OverlayBorder"
63+
Background="Black"
64+
Opacity="0"
65+
Visibility="Collapsed"/>
66+
</Grid>
67+
68+
</Grid>
69+
70+
</controls:BaseWindow>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using Compunet.SudokuSolver.Container;
2+
using Compunet.SudokuSolver.Controls;
3+
using Compunet.SudokuSolver.Mvvm;
4+
using Microsoft.Extensions.DependencyInjection;
5+
using System.Windows;
6+
using System.Windows.Media.Effects;
7+
8+
namespace Compunet.SudokuSolver
9+
{
10+
public partial class AppWindow : BaseWindow, IWindowOverlayMode
11+
{
12+
public AppWindow()
13+
{
14+
InitializeComponent();
15+
DataContext = IoC.Simple.GetRequiredService<AppWindowViewModel>();
16+
}
17+
18+
public void SetOverlay()
19+
{
20+
OverlayBorder.Visibility = Visibility.Visible;
21+
OverlayBorder.Opacity = .5;
22+
Effect = new BlurEffect() { Radius = 10.0 };
23+
}
24+
25+
public void CancelOverlay()
26+
{
27+
OverlayBorder.Opacity = 0;
28+
OverlayBorder.Visibility = Visibility.Collapsed;
29+
Effect = null;
30+
}
31+
}
32+
33+
public interface IWindowOverlayMode
34+
{
35+
void SetOverlay();
36+
void CancelOverlay();
37+
}
38+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.Windows;
2+
3+
[assembly: ThemeInfo(
4+
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5+
//(used if a resource is not found in the page,
6+
// or application resource dictionaries)
7+
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8+
//(used if a resource is not found in the page,
9+
// app, or any theme specific resource dictionaries)
10+
)]
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using Microsoft.Xaml.Behaviors;
2+
using System.Windows;
3+
using System.Windows.Input;
4+
5+
namespace Compunet.SudokuSolver.Behaviors
6+
{
7+
public class InvokeCommandOnKeyDownBehavior : Behavior<UIElement>
8+
{
9+
public static readonly DependencyProperty CommandProperty =
10+
DependencyProperty.Register(nameof(Command),
11+
typeof(ICommand),
12+
typeof(InvokeCommandOnKeyDownBehavior),
13+
new PropertyMetadata(null));
14+
15+
16+
public ICommand Command
17+
{
18+
get => (ICommand)GetValue(CommandProperty);
19+
set => SetValue(CommandProperty, value);
20+
}
21+
22+
23+
protected override void OnAttached()
24+
{
25+
AssociatedObject.KeyDown += AssociatedObject_KeyDown;
26+
}
27+
28+
protected override void OnDetaching()
29+
{
30+
AssociatedObject.KeyDown -= AssociatedObject_KeyDown;
31+
}
32+
33+
private void AssociatedObject_KeyDown(object sender, KeyEventArgs e)
34+
{
35+
Command?.Execute(e.Key);
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)