This commit is contained in:
sc committed 2022-02-07 18:55:09 +08:00
commit ce3a40f1ee
7 files changed
+34 -15

No files matched your search

+7 -2
View File
@@ -106,8 +106,8 @@
<Grid> <Grid>
<Rectangle HorizontalAlignment="Left" Width="180" Margin="0,0,0,0" Fill="#FFCCCCCC"/> <Rectangle HorizontalAlignment="Left" Width="180" Margin="0,0,0,0" Fill="#FFCCCCCC"/>
<RadioButton Content="查询" Tag="&#xF15C;" HorizontalAlignment="Left" Height="55" Margin="0,190,0,0" VerticalAlignment="Top" Width="180" Background="#FFCCCCCC" Style="{DynamicResource RadioButtonStyle}"/> <RadioButton Content="查询" Tag="&#xF15C;" HorizontalAlignment="Left" Height="55" Margin="0,190,0,0" VerticalAlignment="Top" Width="180" Background="#FFCCCCCC" Style="{DynamicResource RadioButtonStyle}" Checked="RadioButton_Checked"/>
<RadioButton Content="统计" Tag="&#xF00B;" HorizontalAlignment="Left" Height="55" Margin="0,245,0,0" VerticalAlignment="Top" Width="180" Background="#FFCCCCCC" Style="{DynamicResource RadioButtonStyle}"/> <RadioButton Content="统计" Tag="&#xF00B;" HorizontalAlignment="Left" Height="55" Margin="0,245,0,0" VerticalAlignment="Top" Width="180" Background="#FFCCCCCC" Style="{DynamicResource RadioButtonStyle}" Checked="RadioButton_Checked"/>
<RadioButton Content="退出" Tag="&#xF08B;" HorizontalAlignment="Left" Height="55" Margin="0,0,0,50" VerticalAlignment="Bottom" Width="180" Background="#FFCCCCCC" Style="{DynamicResource Style}" Checked="exit" /> <RadioButton Content="退出" Tag="&#xF08B;" HorizontalAlignment="Left" Height="55" Margin="0,0,0,50" VerticalAlignment="Bottom" Width="180" Background="#FFCCCCCC" Style="{DynamicResource Style}" Checked="exit" />
<RadioButton Content="帮助" Tag="&#xF0B1;" HorizontalAlignment="Left" Height="55" Margin="0,0,0,105" VerticalAlignment="Bottom" Width="180" Background="#FFCCCCCC" Style="{DynamicResource Style}" Checked="help" /> <RadioButton Content="帮助" Tag="&#xF0B1;" HorizontalAlignment="Left" Height="55" Margin="0,0,0,105" VerticalAlignment="Bottom" Width="180" Background="#FFCCCCCC" Style="{DynamicResource Style}" Checked="help" />
<Rectangle HorizontalAlignment="Left" Height="150" Margin="15,15,0,0" VerticalAlignment="Top" Width="150"> <Rectangle HorizontalAlignment="Left" Height="150" Margin="15,15,0,0" VerticalAlignment="Top" Width="150">
@@ -116,5 +116,10 @@
</Rectangle.Fill> </Rectangle.Fill>
</Rectangle> </Rectangle>
<!--righe-->
<Grid Grid.Column="1">
<ContentControl x:Name="container" Margin="180,0,0,0"/>
</Grid>
</Grid> </Grid>
</mah:MetroWindow> </mah:MetroWindow>
+16 -2
View File
@@ -1,4 +1,6 @@
using MahApps.Metro.Controls; using Audit.View;
using Audit.ViewModel;
using MahApps.Metro.Controls;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -31,7 +33,6 @@ namespace Audit
private void TimePicker_SelectedDateTimeChanged(object sender, RoutedPropertyChangedEventArgs<DateTime?> e) private void TimePicker_SelectedDateTimeChanged(object sender, RoutedPropertyChangedEventArgs<DateTime?> e)
{ {
} }
private void exit(object sender, RoutedEventArgs e) private void exit(object sender, RoutedEventArgs e)
@@ -44,5 +45,18 @@ namespace Audit
Windows.help help= new Windows.help(); Windows.help help= new Windows.help();
help.Show();//实例化并打开帮助窗口 help.Show();//实例化并打开帮助窗口
} }
private void RadioButton_Checked(object sender, RoutedEventArgs e)
{
if (!(sender is RadioButton button)) return;
if (string.IsNullOrEmpty(button.Content.ToString())) return;
switch (button.Content.ToString())
{
case "查询": container.Content = new QueryView(); break;
case "统计": container.Content = new StatisticsView(); break;
default:
break;
}
}
} }
} }
+4 -4
View File
@@ -1,13 +1,13 @@
<Page x:Class="Audit.View.QueryView" <UserControl x:Class="Audit.View.QueryView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Audit.View" xmlns:local="clr-namespace:Audit.View"
mc:Ignorable="d" mc:Ignorable="d" DataContext="{Binding Source={StaticResource Locator},Path=Query}"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="900" d:DesignWidth="1100">
<Grid> <Grid>
<TextBlock Text="QueryView" FontSize="100"/> <TextBlock Text="QueryView" FontSize="100"/>
</Grid> </Grid>
</Page> </UserControl>
+1 -1
View File
@@ -18,7 +18,7 @@ namespace Audit.View
/// <summary> /// <summary>
/// QueryView.xaml 的交互逻辑 /// QueryView.xaml 的交互逻辑
/// </summary> /// </summary>
public partial class QueryView : Page public partial class QueryView : UserControl
{ {
///<Summary> ///<Summary>
/// QueryView /// QueryView
+3 -3
View File
@@ -4,9 +4,9 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Audit.View" xmlns:local="clr-namespace:Audit.View"
mc:Ignorable="d" mc:Ignorable="d" DataContext="{Binding Source={StaticResource Locator},Path=Statistics}"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="900" d:DesignWidth="1000">
<Grid> <Grid>
<TextBlock Text="StatisticsViewModel" FontSize="100"/> <TextBlock Text="StatisticsView" FontSize="100"/>
</Grid> </Grid>
</UserControl> </UserControl>
-3
View File
@@ -20,9 +20,6 @@ namespace Audit.View
/// </summary> /// </summary>
public partial class StatisticsView : UserControl public partial class StatisticsView : UserControl
{ {
///<Summary>
/// StatisticsView
///</Summary>
public StatisticsView() public StatisticsView()
{ {
InitializeComponent(); InitializeComponent();
+3
View File
@@ -6,6 +6,9 @@ using System.Threading.Tasks;
namespace Audit.ViewModel namespace Audit.ViewModel
{ {
///<Summary>
/// StatisticsViewModel
///</Summary>
public class StatisticsViewModel public class StatisticsViewModel
{ {
} }