Forráskód Böngészése

Добавьте файлы проекта.

Никита Кашлач 3 éve
szülő
commit
b30d5028dc

+ 25 - 0
MatrixXAMLOnly.sln

@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31605.320
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MatrixXAMLOnly", "MatrixXAMLOnly\MatrixXAMLOnly.csproj", "{463CADBE-6CAF-45F0-94D5-FED816937772}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{463CADBE-6CAF-45F0-94D5-FED816937772}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{463CADBE-6CAF-45F0-94D5-FED816937772}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{463CADBE-6CAF-45F0-94D5-FED816937772}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{463CADBE-6CAF-45F0-94D5-FED816937772}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {03A0EB1B-5407-45B7-A864-476ABCC35D91}
+	EndGlobalSection
+EndGlobal

+ 9 - 0
MatrixXAMLOnly/App.xaml

@@ -0,0 +1,9 @@
+<Application x:Class="MatrixXAMLOnly.App"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:local="clr-namespace:MatrixXAMLOnly"
+             StartupUri="MainWindow.xaml">
+    <Application.Resources>
+         
+    </Application.Resources>
+</Application>

+ 17 - 0
MatrixXAMLOnly/App.xaml.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace MatrixXAMLOnly
+{
+    /// <summary>
+    /// Interaction logic for App.xaml
+    /// </summary>
+    public partial class App : Application
+    {
+    }
+}

+ 10 - 0
MatrixXAMLOnly/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)
+)]

BIN
MatrixXAMLOnly/Images/matrix_icon.ico


+ 437 - 0
MatrixXAMLOnly/MainWindow.xaml

@@ -0,0 +1,437 @@
+<Window x:Class="MatrixXAMLOnly.MainWindow"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        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:local="clr-namespace:MatrixXAMLOnly"
+        mc:Ignorable="d"
+        Title="Калькулятор: матрицы" Height="700" Width="1100" Icon="Images\matrix_icon.ico" MinHeight="500" MinWidth="800" x:Name="Window">
+    <Window.Resources>
+        <Style TargetType="{x:Type Button}" x:Key="HamburgerBtn">
+            <Setter Property="Background" Value="Transparent" />
+            <Setter Property="Foreground" Value="#373737" />
+            <Setter Property="FontSize" Value="15" />
+            <Setter Property="SnapsToDevicePixels" Value="True" />
+
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="{x:Type Button}">
+                        <Border CornerRadius="1" Background="{TemplateBinding Background}">
+                            <Grid>
+                                <Grid.RowDefinitions>
+                                    <RowDefinition Height="2.5*"/>
+                                    <RowDefinition Height="1*"/>
+                                    <RowDefinition Height="0.8*"/>
+                                    <RowDefinition Height="1*"/>
+                                    <RowDefinition Height="0.8*"/>
+                                    <RowDefinition Height="1*"/>
+                                    <RowDefinition Height="2.5*"/>
+                                </Grid.RowDefinitions>
+                                <Grid.ColumnDefinitions>
+                                    <ColumnDefinition/>
+                                    <ColumnDefinition Width="6*"/>
+                                    <ColumnDefinition/>
+                                </Grid.ColumnDefinitions>
+
+                                <Rectangle Grid.Row="1" Grid.Column="1" Fill="#373737" RadiusX="2" RadiusY="2"/>
+                                <Rectangle Grid.Row="3" Grid.Column="1" Fill="#373737" RadiusX="2" RadiusY="2"/>
+                                <Rectangle Grid.Row="5" Grid.Column="1" Fill="#373737" RadiusX="2" RadiusY="2"/>
+                            </Grid>
+                        </Border>
+
+                        <ControlTemplate.Triggers>
+                            <Trigger Property="IsMouseOver" Value="True">
+                                <Setter Property="Background" Value="#cccdc6" />
+                                <Setter Property="Foreground" Value="White" />
+                            </Trigger>
+
+                            <Trigger Property="IsPressed" Value="True">
+                                <Setter Property="Background" Value="#e8e9eb" />
+                                <Setter Property="Foreground" Value="White" />
+                            </Trigger>
+                        </ControlTemplate.Triggers>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+
+        <Style TargetType="{x:Type Button}" x:Key="HamburgerMenuItemBtn">
+            <Setter Property="Background" Value="Transparent"/>
+            <Setter Property="Foreground" Value="#373737"/>
+            <Setter Property="FontSize" Value="15"/>
+            <Setter Property="SnapsToDevicePixels" Value="True"/>
+            <Setter Property="MinHeight" Value="40"/>
+            <Setter Property="Cursor" Value="Hand"/>
+
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="{x:Type Button}">
+                        <Border BorderThickness="0 0 0 1" BorderBrush="#373737">
+                            <Grid>
+                                <TextBlock x:Name="TextBlockTemplateHamburgerMenuItem" Text="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"/>
+                            </Grid>
+                        </Border>
+
+                        <ControlTemplate.Triggers>
+                            <Trigger Property="IsMouseOver" Value="True">
+                                <Setter Property="Background" Value="#cccdc6"/>
+                                <Setter Property="Foreground" Value="Black" />
+                            </Trigger>
+
+                            <Trigger Property="IsPressed" Value="True">
+                                <Setter Property="Background" Value="#e8e9eb" />
+                                <Setter Property="Foreground" Value="White" />
+                            </Trigger>
+                        </ControlTemplate.Triggers>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+
+        <Style TargetType="{x:Type TextBlock}" x:Key="OperationSign">
+            <Setter Property="HorizontalAlignment" Value="Center"/>
+            <Setter Property="VerticalAlignment" Value="Center"/>
+            <Setter Property="Foreground" Value="#373737"/>
+            <Setter Property="FontSize" Value="40"/>
+            <Setter Property="FontWeight" Value="SemiBold"/>
+        </Style>
+    </Window.Resources>
+    
+    
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition/>
+            <RowDefinition Height="4*"/>
+            <RowDefinition/>
+        </Grid.RowDefinitions>
+
+        <!-- CurtainMenu -->
+        <Grid x:Name="CurtainMenu" Panel.ZIndex="1" Grid.Row="0" Grid.RowSpan="3" Width="0" HorizontalAlignment="Left" Background="#FFE8E9EB" Opacity="0.95">
+            <StackPanel Margin="0 70 0 0" Orientation="Vertical">
+                <Button Content="Сложение матрицы" Style="{StaticResource HamburgerMenuItemBtn}"/>
+                <Button Content="Вычитание матрицы" Style="{StaticResource HamburgerMenuItemBtn}"/>
+                <Button Content="Умножение матрицы на скаляр" Style="{StaticResource HamburgerMenuItemBtn}"/>
+                <Button Content="Транспонирование матрицы" Style="{StaticResource HamburgerMenuItemBtn}"/>
+                <Button Content="Умножение матрицы на её транспонированную матрицу" Style="{StaticResource HamburgerMenuItemBtn}"/>
+                <Button Content="Перестановка строк" Style="{StaticResource HamburgerMenuItemBtn}"/>
+                <Button Content="Перестановка строк согласно вектору транспозиции" Style="{StaticResource HamburgerMenuItemBtn}"/>
+                <Button Content="Обратная матрица" Style="{StaticResource HamburgerMenuItemBtn}"/>
+            </StackPanel>
+        </Grid>
+
+        <!-- Hamburger Button -->
+        <Button x:Name="BtnHamburgerMenu" Style="{StaticResource HamburgerBtn}" Panel.ZIndex="1" MinHeight="70" MaxHeight="70" MinWidth="70" MaxWidth="70" Cursor="Hand" Focusable="False" VerticalAlignment="Top" HorizontalAlignment="Left" Click="BtnHamburgerMenu_Click"/>
+
+        <!-- Addition -->
+        <Grid x:Name="GridContentAddition" Grid.RowSpan="3" Visibility="Collapsed">
+            <Grid.RowDefinitions>
+                <RowDefinition/>
+                <RowDefinition Height="4*"/>
+                <RowDefinition/>
+            </Grid.RowDefinitions>
+
+            <!-- UpperBody -->
+            <Grid Grid.Row="0">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="0.1*"/>
+                    <ColumnDefinition/>
+                </Grid.ColumnDefinitions>
+
+            </Grid>
+
+            <!-- MidlleBody -->
+            <Grid Grid.Row="1">
+                <Border Grid.ColumnSpan="3" BorderBrush="Black" BorderThickness="0 1 0 1">
+                    <Grid>
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition/>
+                            <ColumnDefinition Width="0.05*"/>
+                            <ColumnDefinition/>
+                            <ColumnDefinition Width="0.05*"/>
+                            <ColumnDefinition/>
+                        </Grid.ColumnDefinitions>
+
+                        <Grid x:Name="GridAdditionFrstTerm" Grid.Column="0">
+                            
+                        </Grid>
+
+                        <TextBlock Text="+" Grid.Column="1" Style="{StaticResource OperationSign}"/>
+
+                        <Grid x:Name="GridAdditionScndTerm" Grid.Column="2">
+                            
+                        </Grid>
+
+                        <TextBlock Text="=" Grid.Column="3" Style="{StaticResource OperationSign}"/>
+
+                        <Grid x:Name="GridAdditionResult" Grid.Column="4">
+                            
+                        </Grid>
+                    </Grid>
+                </Border>
+            </Grid>
+
+            <!-- BottomBody -->
+            <Grid Grid.Row="2">
+
+            </Grid>
+        </Grid> <!-- Addition -->
+
+        <!-- Difference -->
+        <Grid x:Name="GridContentDifference" Grid.RowSpan="3" Visibility="Collapsed">
+            <Grid.RowDefinitions>
+                <RowDefinition/>
+                <RowDefinition Height="4*"/>
+                <RowDefinition/>
+            </Grid.RowDefinitions>
+
+            <!-- UpperBody -->
+            <Grid Grid.Row="0">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="0.1*"/>
+                    <ColumnDefinition/>
+                </Grid.ColumnDefinitions>
+
+            </Grid>
+
+            <!-- MidlleBody -->
+            <Grid Grid.Row="1">
+                <Border Grid.ColumnSpan="3" BorderBrush="Black" BorderThickness="0 1 0 1">
+                    <Grid>
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition/>
+                            <ColumnDefinition Width="0.05*"/>
+                            <ColumnDefinition/>
+                            <ColumnDefinition Width="0.05*"/>
+                            <ColumnDefinition/>
+                        </Grid.ColumnDefinitions>
+
+                        <Grid x:Name="GridDifferenceFrstTerm" Grid.Column="0">
+                            
+                        </Grid>
+
+                        <TextBlock Text="-" Grid.Column="1" Style="{StaticResource OperationSign}"/>
+
+                        <Grid x:Name="GridDifferenceScndTerm" Grid.Column="2">
+                            
+                        </Grid>
+
+                        <TextBlock Text="=" Grid.Column="3" Style="{StaticResource OperationSign}"/>
+
+                        <Grid x:Name="GridDifferenceResult" Grid.Column="4">
+                            
+                        </Grid>
+                    </Grid>
+                </Border>
+            </Grid>
+
+            <!-- BottomBody -->
+            <Grid Grid.Row="2">
+
+            </Grid>
+        </Grid> <!-- Difference -->
+
+        <!-- MultiplicationOnScalar -->
+        <Grid x:Name="GridContentMultiplication" Grid.RowSpan="3" Visibility="Collapsed">
+            <Grid.RowDefinitions>
+                <RowDefinition/>
+                <RowDefinition Height="4*"/>
+                <RowDefinition/>
+            </Grid.RowDefinitions>
+
+            <!-- UpperBody -->
+            <Grid Grid.Row="0">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="0.1*"/>
+                    <ColumnDefinition/>
+                </Grid.ColumnDefinitions>
+
+            </Grid>
+
+            <!-- MidlleBody -->
+            <Grid Grid.Row="1">
+                <Border Grid.ColumnSpan="3" BorderBrush="Black" BorderThickness="0 1 0 1">
+                    <Grid>
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition/>
+                            <ColumnDefinition Width="0.05*"/>
+                            <ColumnDefinition/>
+                            <ColumnDefinition Width="0.05*"/>
+                            <ColumnDefinition/>
+                        </Grid.ColumnDefinitions>
+
+                        <Grid x:Name="GridMultiplicationOnScalarFrstTerm" Grid.Column="0">
+
+                        </Grid>
+
+                        <TextBlock Text="*" Grid.Column="1" Style="{StaticResource OperationSign}" Margin="0 15 0 0"/>
+
+                        <TextBox x:Name="TextBoxMultiplicationOnScalarScndTerm" Grid.Column="2" Width="100" Height="100" HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="20" FontWeight="SemiBold" MaxLength="8"/>
+
+                        <TextBlock Text="=" Grid.Column="3" Style="{StaticResource OperationSign}"/>
+
+                        <Grid x:Name="GridMultiplicationOnScalarResult" Grid.Column="4">
+
+                        </Grid>
+                    </Grid>
+                </Border>
+            </Grid>
+
+            <!-- BottomBody -->
+            <Grid Grid.Row="2">
+
+            </Grid>
+        </Grid> <!-- MultiplicationOnScalar -->
+
+        <!-- Transpose -->
+        <Grid x:Name="GridContentTranspose" Grid.RowSpan="3" Visibility="Collapsed">
+            <Grid.RowDefinitions>
+                <RowDefinition/>
+                <RowDefinition Height="4*"/>
+                <RowDefinition/>
+            </Grid.RowDefinitions>
+
+            <!-- UpperBody -->
+            <Grid Grid.Row="0">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="0.1*"/>
+                    <ColumnDefinition/>
+                </Grid.ColumnDefinitions>
+
+            </Grid>
+
+            <!-- MidlleBody -->
+            <Grid Grid.Row="1">
+                <Border Grid.ColumnSpan="3" BorderBrush="Black" BorderThickness="0 1 0 1">
+                    <Grid>
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition/>
+                            <ColumnDefinition Width="0.1*"/>
+                            <ColumnDefinition/>
+                        </Grid.ColumnDefinitions>
+
+                        <Grid x:Name="GridTransposeFrom" Grid.Column="0">
+
+                        </Grid>
+
+                        <TextBlock Text="=>" Grid.Column="1" Style="{StaticResource OperationSign}"/>
+
+                        <Grid x:Name="GridTransposed" Grid.Column="2">
+
+                        </Grid>
+                    </Grid>
+                </Border>
+            </Grid>
+
+            <!-- BottomBody -->
+            <Grid Grid.Row="2">
+
+            </Grid>
+        </Grid> <!-- Transpose -->
+
+        <!-- MultiplicationOnTransposed -->
+        <Grid x:Name="GridContentMultiplicationOnTransposed" Grid.RowSpan="3" Visibility="Collapsed">
+            <Grid.RowDefinitions>
+                <RowDefinition/>
+                <RowDefinition Height="4*"/>
+                <RowDefinition/>
+            </Grid.RowDefinitions>
+
+            <!-- UpperBody -->
+            <Grid Grid.Row="0">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="0.1*"/>
+                    <ColumnDefinition/>
+                </Grid.ColumnDefinitions>
+
+            </Grid>
+
+            <!-- MidlleBody -->
+            <Grid Grid.Row="1">
+                <Border Grid.ColumnSpan="3" BorderBrush="Black" BorderThickness="0 1 0 1">
+                    <Grid>
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition/>
+                            <ColumnDefinition Width="0.1*"/>
+                            <ColumnDefinition/>
+                        </Grid.ColumnDefinitions>
+
+                        <Grid x:Name="GridMultiplicationOnTransposedTerm" Grid.Column="0">
+
+                        </Grid>
+
+                        <TextBlock Text="=>" Grid.Column="1" Style="{StaticResource OperationSign}"/>
+
+                        <Grid x:Name="GridMultiplicationOnTransposedResult" Grid.Column="2">
+
+                        </Grid>
+                    </Grid>
+                </Border>
+            </Grid>
+
+            <!-- BottomBody -->
+            <Grid Grid.Row="2">
+
+            </Grid>
+        </Grid> <!-- MultiplicationOnTransposed -->
+
+        <!-- RowsReplace -->
+        <Grid x:Name="GridContentRowsReplace" Grid.RowSpan="3" Visibility="Collapsed">
+            <Grid.RowDefinitions>
+                <RowDefinition/>
+                <RowDefinition Height="4*"/>
+                <RowDefinition/>
+            </Grid.RowDefinitions>
+
+            <!-- UpperBody -->
+            <Grid Grid.Row="0">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="0.1*"/>
+                    <ColumnDefinition/>
+                </Grid.ColumnDefinitions>
+
+            </Grid>
+
+            <!-- MidlleBody -->
+            <Grid Grid.Row="1">
+                <Border Grid.ColumnSpan="3" BorderBrush="Black" BorderThickness="0 1 0 1">
+                    <Grid>
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition/>
+                            <ColumnDefinition Width="0.4*"/>
+                            <ColumnDefinition/>
+                        </Grid.ColumnDefinitions>
+
+                        <Grid x:Name="GridRowsReplaceMatrix" Grid.Column="0">
+                            
+                        </Grid>
+
+                        <Grid Grid.Column="1">
+                            <Grid.RowDefinitions>
+                                <RowDefinition/>
+                                <RowDefinition/>
+                                <RowDefinition/>
+                            </Grid.RowDefinitions>
+
+                            <TextBox x:Name="TextBoxRowReplaceFrstTerm" Grid.Row="0" Width="50" Height="50" HorizontalAlignment="Center" VerticalAlignment="Bottom" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="20" FontWeight="SemiBold" MaxLength="2"/>
+
+                            <TextBlock Text="=>" Grid.Row="1" Style="{StaticResource OperationSign}"/>
+
+                            <TextBox x:Name="TextBoxRowReplaceScndTerm" Grid.Row="2" Width="50" Height="50" HorizontalAlignment="Center" VerticalAlignment="Top" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="20" FontWeight="SemiBold" MaxLength="2"/>
+
+                        </Grid>
+
+                        <Grid x:Name="GridRowsReplaceResult" Grid.Column="2">
+
+                        </Grid>
+                    </Grid>
+                </Border>
+            </Grid>
+
+            <!-- BottomBody -->
+            <Grid Grid.Row="2">
+
+            </Grid>
+        </Grid> <!-- RowsReplace -->
+        
+    </Grid>
+</Window>

+ 114 - 0
MatrixXAMLOnly/MainWindow.xaml.cs

@@ -0,0 +1,114 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+
+namespace MatrixXAMLOnly
+{
+    /// <summary>
+    /// Interaction logic for MainWindow.xaml
+    /// </summary>
+    public partial class MainWindow : Window
+    {
+
+
+        public MainWindow()
+        {
+            InitializeComponent();
+
+            GridContentAddition.Visibility = Visibility.Visible;
+            GridAdditionFrstTerm.Children.Add(CreateMatrix(5, 5));
+        }
+
+        private void BtnHamburgerMenu_Click(object sender, RoutedEventArgs e)
+        {
+            DoubleAnimation menuAnimation = new DoubleAnimation();
+            menuAnimation.From = CurtainMenu.ActualWidth;
+            menuAnimation.DecelerationRatio = 1.0;
+
+            if (menuAnimation.From == 250)
+            {
+                menuAnimation.To = 0;
+                menuAnimation.Duration = TimeSpan.FromSeconds(0.2);
+            }
+            else
+            {
+                menuAnimation.To = 250;
+                menuAnimation.Duration = TimeSpan.FromSeconds(0.2);
+            }
+
+            CurtainMenu.BeginAnimation(WidthProperty, menuAnimation);
+        }
+
+        private Grid CreateMatrix(int a, int b)
+        {
+            Grid matrixGrid = new Grid();
+            matrixGrid.Margin = new Thickness(25, 75, 25, 75);
+
+            // Добавление колонок
+            for (int i = 0; i < a; i++)
+            {
+                matrixGrid.ColumnDefinitions.Add(new ColumnDefinition());
+            }
+
+            // Добавление строк
+            for (int j = 0; j < b; j++)
+            {
+                matrixGrid.RowDefinitions.Add(new RowDefinition());
+            }
+
+            // Добавление TextBox'ов
+            for (int i = 0; i < a; i++)
+            {
+                for (int j = 0; j < b; j++)
+                {
+                    TextBox textBox = new TextBox()
+                    {
+                        HorizontalContentAlignment = HorizontalAlignment.Center,
+                        VerticalContentAlignment = VerticalAlignment.Center
+                    };
+
+                    textBox.KeyDown += TextBox_KeyDown;
+
+                    Grid.SetColumn(textBox, i);
+                    Grid.SetRow(textBox, j);
+                    matrixGrid.Children.Add(textBox);
+                }
+            }
+
+            return matrixGrid;
+        }
+
+        private void TextBox_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.Key != Key.NumPad0 && e.Key != Key.D0 &&
+                e.Key != Key.NumPad1 && e.Key != Key.D1 &&
+                e.Key != Key.NumPad2 && e.Key != Key.D2 &&
+                e.Key != Key.NumPad3 && e.Key != Key.D3 &&
+                e.Key != Key.NumPad4 && e.Key != Key.D4 &&
+                e.Key != Key.NumPad5 && e.Key != Key.D5 &&
+                e.Key != Key.NumPad6 && e.Key != Key.D6 &&
+                e.Key != Key.NumPad7 && e.Key != Key.D7 &&
+                e.Key != Key.NumPad8 && e.Key != Key.D8 &&
+                e.Key != Key.NumPad9 && e.Key != Key.D9)
+            {
+                e.Handled = true;
+            }
+        }
+    }
+
+    enum Operation
+    {
+        Addition,
+        Difference,
+        MultiplicationOnScalar,
+        Transposition,
+        MultiplicationOnTransposed,
+        RowReplace,
+        RowReplaceOnTranspositionVector,
+        Inverse
+    }
+}

+ 17 - 0
MatrixXAMLOnly/MatrixXAMLOnly.csproj

@@ -0,0 +1,17 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <OutputType>WinExe</OutputType>
+    <TargetFramework>net5.0-windows</TargetFramework>
+    <UseWPF>true</UseWPF>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <None Remove="Images\matrix_icon.ico" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Resource Include="Images\matrix_icon.ico" />
+  </ItemGroup>
+
+</Project>