忱 沈 4 years ago
parent
commit
b0b46449f8
  1. 8
      Audit.csproj
  2. 3
      MainWindow.xaml
  3. 3
      MainWindow.xaml.cs
  4. 4
      View/StatisticsView.xaml
  5. 70
      View/StuffView.xaml
  6. 31
      View/StuffView.xaml.cs
  7. 12
      ViewModel/StuffViewModel.cs

8
Audit.csproj

@ -143,6 +143,7 @@
<Compile Include="ViewModel\MainViewModel.cs" /> <Compile Include="ViewModel\MainViewModel.cs" />
<Compile Include="ViewModel\QueryViewModel.cs" /> <Compile Include="ViewModel\QueryViewModel.cs" />
<Compile Include="ViewModel\StatisticsViewModel.cs" /> <Compile Include="ViewModel\StatisticsViewModel.cs" />
<Compile Include="ViewModel\StuffViewModel.cs" />
<Compile Include="ViewModel\ViewModelLocator.cs" /> <Compile Include="ViewModel\ViewModelLocator.cs" />
<Compile Include="View\QueryView.xaml.cs"> <Compile Include="View\QueryView.xaml.cs">
<DependentUpon>QueryView.xaml</DependentUpon> <DependentUpon>QueryView.xaml</DependentUpon>
@ -150,6 +151,9 @@
<Compile Include="View\StatisticsView.xaml.cs"> <Compile Include="View\StatisticsView.xaml.cs">
<DependentUpon>StatisticsView.xaml</DependentUpon> <DependentUpon>StatisticsView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="View\StuffView.xaml.cs">
<DependentUpon>StuffView.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\help.xaml.cs"> <Compile Include="Windows\help.xaml.cs">
<DependentUpon>help.xaml</DependentUpon> <DependentUpon>help.xaml</DependentUpon>
</Compile> </Compile>
@ -183,6 +187,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="View\StuffView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\help.xaml"> <Page Include="Windows\help.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>

3
MainWindow.xaml

@ -107,7 +107,8 @@
<Rectangle HorizontalAlignment="Left" Width="140" Margin="0,0,0,0" Fill="#FFCCCCCC"/> <Rectangle HorizontalAlignment="Left" Width="140" Margin="0,0,0,0" Fill="#FFCCCCCC"/>
<RadioButton Content="查询" Tag="&#xF15C;" HorizontalAlignment="Left" Height="55" Margin="0,190,0,0" VerticalAlignment="Top" Width="140" Background="#FFCCCCCC" Style="{DynamicResource RadioButtonStyle}" Checked="RadioButton_Checked"/> <RadioButton Content="查询" Tag="&#xF15C;" HorizontalAlignment="Left" Height="55" Margin="0,190,0,0" VerticalAlignment="Top" Width="140" Background="#FFCCCCCC" Style="{DynamicResource RadioButtonStyle}" Checked="RadioButton_Checked"/>
<RadioButton Content="统计" Tag="&#xF00B;" HorizontalAlignment="Left" Height="55" Margin="0,245,0,0" VerticalAlignment="Top" Width="140" Background="#FFCCCCCC" Style="{DynamicResource RadioButtonStyle}" Checked="RadioButton_Checked"/> <RadioButton Content="统计" Tag="&#xf080;" HorizontalAlignment="Left" Height="55" Margin="0,245,0,0" VerticalAlignment="Top" Width="140" Background="#FFCCCCCC" Style="{DynamicResource RadioButtonStyle}" Checked="RadioButton_Checked"/>
<RadioButton Content="原料" Tag="&#xF00B;" HorizontalAlignment="Left" Height="55" Margin="0,300,0,0" VerticalAlignment="Top" Width="140" Background="#FFCCCCCC" Style="{DynamicResource RadioButtonStyle}" Checked="RadioButton_Checked"/>
<RadioButton Content="退出" Tag="&#xF08B;" HorizontalAlignment="Left" Height="55" Margin="0,0,0,50" VerticalAlignment="Bottom" Width="140" Background="#FFCCCCCC" Style="{DynamicResource Style}" Checked="exit" /> <RadioButton Content="退出" Tag="&#xF08B;" HorizontalAlignment="Left" Height="55" Margin="0,0,0,50" VerticalAlignment="Bottom" Width="140" Background="#FFCCCCCC" Style="{DynamicResource Style}" Checked="exit" />
<RadioButton Content="帮助" Tag="&#xF0B1;" HorizontalAlignment="Left" Height="55" Margin="0,0,0,105" VerticalAlignment="Bottom" Width="140" Background="#FFCCCCCC" Style="{DynamicResource Style}" Checked="help" /> <RadioButton Content="帮助" Tag="&#xF0B1;" HorizontalAlignment="Left" Height="55" Margin="0,0,0,105" VerticalAlignment="Bottom" Width="140" Background="#FFCCCCCC" Style="{DynamicResource Style}" Checked="help" />
<Rectangle HorizontalAlignment="Left" Height="120" Margin="10,10,0,0" VerticalAlignment="Top" Width="120"> <Rectangle HorizontalAlignment="Left" Height="120" Margin="10,10,0,0" VerticalAlignment="Top" Width="120">

3
MainWindow.xaml.cs

@ -53,7 +53,8 @@ namespace Audit
switch (button.Content.ToString()) switch (button.Content.ToString())
{ {
case "查询": container.Content = new QueryView(); break; case "查询": container.Content = new QueryView(); break;
case "统计": container.Content = new StatisticsView(); break; case "原料": container.Content = new StatisticsView(); break;
case "统计": container.Content = new StatisticsView(); break;
default: default:
break; break;
} }

4
View/StatisticsView.xaml

@ -61,7 +61,9 @@
<Grid Grid.Row="0"/> <Grid Grid.Row="0"/>
<Grid Grid.Row="1"> <Grid Grid.Row="1">
<Grid Grid.Column="1"> <Grid Grid.Column="1">
<ContentControl x:Name="ContentControl" Margin="0,31,0,0"/> <ContentControl x:Name="ContentControl" Margin="0,31,0,0">
<Label Content="统计" HorizontalAlignment="Left" Height="195" Margin="390,179,0,0" VerticalAlignment="Top" Width="530" FontSize="48"/>
</ContentControl>
</Grid> </Grid>
</Grid> </Grid>
</Grid> </Grid>

70
View/StuffView.xaml

@ -0,0 +1,70 @@
<UserControl x:Class="Audit.View.StuffView"
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:Audit.View"
mc:Ignorable="d" DataContext="{Binding Source={StaticResource Locator},Path=Statistics}"
d:DesignHeight="900" d:DesignWidth="1140"
xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro">
<UserControl.Resources>
<Style x:Key="RadioButtonStyle" TargetType="{x:Type RadioButton}">
<Setter Property="Background" Value="{DynamicResource MahApps.Brushes.ThemeBackground}"/>
<Setter Property="BorderBrush" Value="#FFF0F0F0"/>
<Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}"/>
<Setter Property="FontFamily" Value="{DynamicResource MahApps.Fonts.Family.Control}"/>
<Setter Property="FontSize" Value="{DynamicResource MahApps.Font.Size.Content}"/>
<Setter Property="Foreground" Value="{DynamicResource MahApps.Brushes.Text}"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="Padding" Value="6 0 0 0"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RadioButton}">
<Grid>
<Border x:Name="border" Background="{TemplateBinding Background}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition>
</ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="1"
Text="{TemplateBinding Content}"
FontFamily="Fonts/#FontAwesome"
HorizontalAlignment="Center"
Width="80" FontSize="20" Margin="0,5,0,0"/>
</Grid>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FFA0A0A0" TargetName="border"/>
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Background" Value="#FFF5F5F5" TargetName="border"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="#CCCCCC">
</Border>
<Grid Grid.Row="0"/>
<Grid Grid.Row="1">
<Grid Grid.Column="1">
<ContentControl x:Name="ContentControl" Margin="0,31,0,0">
<TextBlock HorizontalAlignment="Left" Height="290" Margin="385,194,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="415"><Run Language="zh-cn" Text="原料" FontSize="72"/></TextBlock>
</ContentControl>
</Grid>
</Grid>
</Grid>
</UserControl>

31
View/StuffView.xaml.cs

@ -0,0 +1,31 @@
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 Audit.View
{
/// <summary>
/// StuffView.xaml 的交互逻辑
/// </summary>
public partial class StuffView : UserControl
{
/// <summary>
/// StuffView
/// </summary>
public StuffView()
{
InitializeComponent();
}
}
}

12
ViewModel/StuffViewModel.cs

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Audit.ViewModel
{
internal class StuffViewModel
{
}
}
Loading…
Cancel
Save