Никита Кашлач 3 年之前
父节点
当前提交
335507af31

+ 35 - 0
MatrixXAMLOnly/DiagramWindow.xaml

@@ -0,0 +1,35 @@
+<Window x:Class="MatrixXAMLOnly.DiagramWindow"
+        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:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
+        xmlns:local="clr-namespace:MatrixXAMLOnly"
+        mc:Ignorable="d"
+        Title="Диаграмма" Height="500" Width="800" Icon="Images\matrix_icon.ico" MinHeight="500" MinWidth="800">
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="0.2*"/>
+            <RowDefinition/>
+        </Grid.RowDefinitions>
+
+        <Border Grid.Row="0" BorderBrush="Black" BorderThickness="0 0 0 1">
+            <Grid>
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition/>
+                    <ColumnDefinition/>
+                </Grid.ColumnDefinitions>
+
+                <StackPanel Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 15 0 15">
+                    <ComboBox x:Name="ComboBoxOrientation" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="14" FontWeight="SemiBold" Margin="0 0 10 0" MinWidth="120">
+                        <ComboBoxItem Content="По строке:"/>
+                        <ComboBoxItem Content="По столбцу:"/>
+                    </ComboBox>
+                    <TextBox x:Name="TextBoxNum" MinWidth="50" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="14" MaxLength="1"/>
+                </StackPanel>
+
+                <Button x:Name="BtnCreateDiagram" Content="Построить диаграмму" Grid.Column="1" Margin="10 15 50 15" MinWidth="200" HorizontalAlignment="Right"/>
+            </Grid>
+        </Border>
+    </Grid>
+</Window>

+ 21 - 0
MatrixXAMLOnly/DiagramWindow.xaml.cs

@@ -0,0 +1,21 @@
+using System.Windows;
+using Matrix;
+
+namespace MatrixXAMLOnly
+{
+    /// <summary>
+    /// Логика взаимодействия для DiagramWindow.xaml
+    /// </summary>
+    public partial class DiagramWindow : Window
+    {
+        public DiagramWindow()
+        {
+            InitializeComponent();
+        }
+
+        public DiagramWindow(MyMatrix matrix)
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 1 - 1
MatrixXAMLOnly/MainWindow.xaml

@@ -5,7 +5,7 @@
         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">
+        Title="Калькулятор: матрицы" Height="700" Width="1100" Icon="Images\matrix_icon.ico" MinHeight="500" MinWidth="800">
     <Window.Resources>
         <Style TargetType="{x:Type Button}" x:Key="HamburgerBtn">
             <Setter Property="Background" Value="Transparent" />

+ 4 - 2
MatrixXAMLOnly/MainWindow.xaml.cs

@@ -2,9 +2,7 @@
 using System.Linq;
 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;
 using Matrix;
 
@@ -22,6 +20,10 @@ namespace MatrixXAMLOnly
         {
             InitializeComponent();
 
+            DiagramWindow wnd = new DiagramWindow();
+            wnd.Show();
+            Close();
+
             BtnAddition.Content = "Сложение матриц";
             BtnDifference.Content = "Вычитание матриц";
             BtnMultiplicationOnScalar.Content = "Умножение матрицы \nна скаляр";

+ 1 - 1
MatrixXAMLOnly/Matrix.cs

@@ -7,7 +7,7 @@ using System.Windows;
 
 namespace Matrix
 {
-    class MyMatrix : Object
+    public class MyMatrix : Object
     {
         public double[,] data; // 
 

+ 5 - 0
MatrixXAMLOnly/MatrixXAMLOnly.csproj

@@ -4,6 +4,7 @@
     <OutputType>WinExe</OutputType>
     <TargetFramework>net6.0-windows</TargetFramework>
     <UseWPF>true</UseWPF>
+    <SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
   </PropertyGroup>
 
   <ItemGroup>
@@ -11,6 +12,10 @@
   </ItemGroup>
 
   <ItemGroup>
+    <PackageReference Include="LiveCharts.Wpf" Version="0.9.7" />
+  </ItemGroup>
+
+  <ItemGroup>
     <Resource Include="Images\matrix_icon.ico" />
   </ItemGroup>