Bläddra i källkod

Изменение отображения задач с DataGrid на ListView

Данилов Денис 1 år sedan
förälder
incheckning
a1bc8f9ae1
4 ändrade filer med 156 tillägg och 1 borttagningar
  1. 1 1
      esoft/MainWindow.xaml.cs
  2. 88 0
      esoft/Pages/TaskLists.xaml
  3. 60 0
      esoft/Pages/TaskLists.xaml.cs
  4. 7 0
      esoft/esoft.csproj

+ 1 - 1
esoft/MainWindow.xaml.cs

@@ -30,7 +30,7 @@ namespace esoft
             PreviewKeyDown += (s, e) => { if (e.Key == Key.F12) Application.Current.MainWindow.WindowState = WindowState.Maximized; };
 
             //Открытие страницы LoginPage при запуске программы
-            FrameMain.Navigate(new Pages.ServicesPage());
+            FrameMain.Navigate(new Pages.TaskLists());
         }
 
         private void btnBack_Click(object sender, RoutedEventArgs e)

+ 88 - 0
esoft/Pages/TaskLists.xaml

@@ -0,0 +1,88 @@
+<Page x:Class="esoft.Pages.TaskLists"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:esoft.Pages"
+      mc:Ignorable="d" 
+      d:DesignHeight="1000"
+      Title="Список задач" Width="1920" >
+
+    <Grid Width="1920">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="auto"></RowDefinition>
+            <RowDefinition Height="*"></RowDefinition>
+        </Grid.RowDefinitions>
+
+        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Height="50">
+            <ComboBox Margin="5" Width="200" Height="25" Name="cbManager" DisplayMemberPath="" FontSize="16" SelectionChanged="cbStatus_SelectionChanged"/>
+            <ComboBox Margin="5" Width="200" Height="25" Name="cbExecutor" DisplayMemberPath="" FontSize="16" SelectionChanged="cbExecutor_SelectionChanged"/>
+            <ComboBox Margin="5" Width="200" Height="25" Name="cbStatus" FontSize="16" DisplayMemberPath="Name" SelectionChanged="cbStatus_SelectionChanged"/>
+            <Button Height="25" Name="btnClearFilter" Content="Очистка фильтра" Width="200" Margin ="5" FontSize="16" Click="btnClearFilter_Click"/>
+        </StackPanel>
+
+        <StackPanel Background="#e6e6e6" Margin="0,15,0,0" Grid.Row="1">
+            <TextBlock Text="Название задачи" FontSize="26" Margin="35, 15, 0, 0" VerticalAlignment ="Center" FontWeight="Bold"></TextBlock>
+            <TextBlock Text="Дата создания задачи" Margin="800, -35, 0, 0" FontSize="26" VerticalAlignment ="Center" FontWeight="Bold"></TextBlock>
+            <TextBlock Text="Исполнитель" HorizontalAlignment="Center" Margin="600, -35, 0, 0" VerticalAlignment ="Center" FontSize="26" FontWeight="Bold"></TextBlock>
+            <TextBlock Text="Менеджер" HorizontalAlignment="Center" Margin="1100, -35, 0, 0" VerticalAlignment ="Center" FontSize="26" FontWeight="Bold"></TextBlock>
+            <TextBlock Text="Статус" HorizontalAlignment="Right" Margin="0, -35, 125, 0" VerticalAlignment ="Center" FontSize="26" FontWeight="Bold"></TextBlock>
+        </StackPanel>
+
+        <ListView Grid.Row="1" Name="LViewTask" Height="720" Width="1900" HorizontalAlignment="Center" VerticalAlignment="Top" Background="{x:Null}" BorderBrush="{x:Null}" Margin="0,83,0,0">
+
+            <ListView.ItemTemplate>
+                <DataTemplate>
+                    <Grid HorizontalAlignment="Center" Width="1900" Height="109">
+
+                        <TextBlock Text="{Binding Title}" FontSize="26" Margin="50, 0, 0, 0" VerticalAlignment="Center" HorizontalAlignment="Left" Width="750" TextWrapping="Wrap"></TextBlock>
+                        <TextBlock Text="{Binding CreateDateTime, StringFormat='{}{0:dd MMMM yyyy г.}', ConverterCulture='ru-RU'}" Margin="800, 32, 0, 0" FontSize="26"></TextBlock>
+                        <TextBlock Text="{Binding FioUser}" HorizontalAlignment="Center" Margin="600, 0, 0, 0" VerticalAlignment ="Center" FontSize="26"></TextBlock>
+                        <TextBlock Text="{Binding FioManager}" HorizontalAlignment="Center" Margin="1100, 0, 0, 0" VerticalAlignment ="Center" FontSize="26"></TextBlock>
+                        <TextBlock Text="{Binding Status}" Margin="1670, 0, 0, 0" VerticalAlignment ="Center" FontSize="26"></TextBlock>
+
+                    </Grid>
+                </DataTemplate>
+            </ListView.ItemTemplate>
+
+            <ListView.ItemContainerStyle>
+                <Style TargetType="ListViewItem">
+
+                    <Setter Property= "Width" Value="1870"/>
+                    <Setter Property="Background" Value="#99d3ff"/>
+                    <Style.Resources>
+                        <Style TargetType="Border">
+                            <Setter Property="CornerRadius" Value="30"/>
+                        </Style>
+                    </Style.Resources>
+
+                </Style>
+            </ListView.ItemContainerStyle>
+        </ListView>
+
+        <Button Grid.Row="3" HorizontalAlignment="Left" Name="BtnDeleteTask" Content="Удалить задачу" Width="196" Height="40" BorderThickness="0" Style="{StaticResource  StandartButtons}" Margin="1650,820,0,15" Click="BtnDeleteTask_Click">
+            <Button.Resources>
+                <Style TargetType="Border">
+                    <Setter Property="CornerRadius" Value="10"/>
+                </Style>
+            </Button.Resources>
+        </Button>
+
+        <Button Grid.Row="3" HorizontalAlignment="Left" Name="BtnAddTask" Content="Добавить задачу" Width="196" Height="40" BorderThickness="0" Style="{StaticResource  StandartButtons}" Margin="1420,820,0,15" Click="BtnAddTask_Click">
+            <Button.Resources>
+                <Style TargetType="Border">
+                    <Setter Property="CornerRadius" Value="10"/>
+                </Style>
+            </Button.Resources>
+        </Button>
+
+        <Button Grid.Row="3" HorizontalAlignment="Left" Name="BtnUpdate" Content="Обновить список" Width="196" Height="40" BorderThickness="0" Style="{StaticResource  StandartButtons}" Margin="1190,820,0,15" Click="BtnUpdate_Click">
+            <Button.Resources>
+                <Style TargetType="Border">
+                    <Setter Property="CornerRadius" Value="10"/>
+                </Style>
+            </Button.Resources>
+        </Button>
+
+    </Grid>
+</Page>

+ 60 - 0
esoft/Pages/TaskLists.xaml.cs

@@ -0,0 +1,60 @@
+using esoft.Entities;
+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.Navigation;
+using System.Windows.Shapes;
+
+namespace esoft.Pages
+{
+    /// <summary>
+    /// Логика взаимодействия для TaskLists.xaml
+    /// </summary>
+    public partial class TaskLists : Page
+    {
+        public TaskLists()
+        {
+            InitializeComponent();
+            LViewTask.ItemsSource = Class.TaskFill.TaskFills();
+        }
+
+        private void BtnAddTask_Click(object sender, RoutedEventArgs e)
+        {
+
+        }
+
+        private void BtnDeleteTask_Click(object sender, RoutedEventArgs e)
+        {
+
+        }
+
+        private void BtnUpdate_Click(object sender, RoutedEventArgs e)
+        {
+            LViewTask.ItemsSource = Class.TaskFill.TaskFills();
+        }
+
+        private void cbStatus_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+
+        }
+
+        private void cbExecutor_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+
+        }
+
+        private void btnClearFilter_Click(object sender, RoutedEventArgs e)
+        {
+
+        }
+    }
+}

+ 7 - 0
esoft/esoft.csproj

@@ -145,6 +145,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Pages\TaskLists.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Pages\AddEditServicePage.xaml.cs">
@@ -156,6 +160,9 @@
     <Compile Include="Pages\ServicesPage.xaml.cs">
       <DependentUpon>ServicesPage.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Pages\TaskLists.xaml.cs">
+      <DependentUpon>TaskLists.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Properties\AssemblyInfo.cs">
       <SubType>Code</SubType>
     </Compile>