XFEstudio/MyFirstRespo
添加主页面效果
1d00446
代码差异
15 个文件
+82
-65
@@ -1,9 +1,9 @@
1
<Application x:Class="FileSystemWatcher.App"
1
<Application x:Class="XFEToolBox.App"
2
2
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
3
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
xmlns:local="clr-namespace:FileSystemWatcher"
5
StartupUri="MainWindow.xaml">
4
xmlns:local="clr-namespace:XFEToolBox"
5
StartupUri="/Views/Windows/MainWindow.xaml">
6
6
<Application.Resources>
7
7
<ResourceDictionary Source="/Resources/Style/MainStyle.xaml"/>
8
8
</Application.Resources>
9
9
</Application>
@@ -1,14 +1,10 @@
1
using System.Configuration;
2
using System.Data;
3
using System.Windows;
1
using System.Windows;
4
2
5
namespace FileSystemWatcher
6
{
7
/// <summary>
8
/// Interaction logic for App.xaml
9
/// </summary>
10
public partial class App : Application
11
{
12
}
3
namespace XFEToolBox;
13
4
5
/// <summary>
6
/// Interaction logic for App.xaml
7
/// </summary>
8
public partial class App : Application
9
{
14
10
}
二进制文件已变更,无法进行逐行预览。
@@ -0,0 +1,19 @@
1
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
3
<Style x:Key="TabBorderStyle" TargetType="Border">
4
<Style.Triggers>
5
<Trigger Property="IsMouseOver" Value="True">
6
<Trigger.Setters>
7
<Setter Property="Background" Value="#b4b4e9"/>
8
</Trigger.Setters>
9
</Trigger>
10
<EventTrigger RoutedEvent="MouseLeftButtonDown">
11
<BeginStoryboard Name="bgChange">
12
<Storyboard>
13
<ColorAnimation Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" To="White" Duration="0:0:0:0.1"/>
14
</Storyboard>
15
</BeginStoryboard>
16
</EventTrigger>
17
</Style.Triggers>
18
</Style>
19
</ResourceDictionary>
@@ -2,6 +2,6 @@
2
2
3
3
namespace XFEToolBox.ViewModel;
4
4
5
public class MainPageViewModel : ObservableObject
5
public partial class MainPageViewModel : ObservableObject
6
6
{
7
7
}
@@ -1,11 +1,19 @@
1
1
using CommunityToolkit.Mvvm.ComponentModel;
2
using FileSystemWatcher.ViewPage;
2
using XFEToolBox.Views.Pages;
3
using XFEToolBox.Views.Windows;
3
4
using System.Windows.Controls;
4
5
5
namespace FileSystemWatcher.ViewModel;
6
namespace XFEToolBox.ViewModel;
6
7
7
8
public partial class MainWindowViewModel : ObservableObject
8
9
{
10
public MainWindow? ViewPage { get; set; }
11
9
12
[ObservableProperty]
10
13
private Page? currentPage = new MainPage();
14
15
public MainWindowViewModel(MainWindow viewPage)
16
{
17
ViewPage = viewPage;
18
}
11
19
}
@@ -2,6 +2,6 @@
2
2
3
3
namespace XFEToolBox.ViewModel;
4
4
5
public class SettingPageViewModel : ObservableObject
5
public partial class SettingPageViewModel : ObservableObject
6
6
{
7
}
7
}
@@ -1,28 +0,0 @@
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
using System.Windows;
7
using System.Windows.Controls;
8
using System.Windows.Data;
9
using System.Windows.Documents;
10
using System.Windows.Input;
11
using System.Windows.Media;
12
using System.Windows.Media.Imaging;
13
using System.Windows.Navigation;
14
using System.Windows.Shapes;
15
16
namespace FileSystemWatcher.ViewPage
17
{
18
/// <summary>
19
/// MainPage.xaml 的交互逻辑
20
/// </summary>
21
public partial class MainPage : Page
22
{
23
public MainPage()
24
{
25
InitializeComponent();
26
}
27
}
28
}
@@ -1,9 +1,9 @@
1
<Page x:Class="FileSystemWatcher.ViewPage.MainPage"
1
<Page x:Class="XFEToolBox.Views.Pages.MainPage"
2
2
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
3
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
4
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5
5
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6
xmlns:local="clr-namespace:FileSystemWatcher.ViewPage"
6
xmlns:local="clr-namespace:XFEToolBox.Views.Pages"
7
7
mc:Ignorable="d"
8
8
d:DesignHeight="450" d:DesignWidth="800"
9
9
Title="MainPage">
@@ -0,0 +1,14 @@
1
using System.Windows.Controls;
2
3
namespace XFEToolBox.Views.Pages;
4
5
/// <summary>
6
/// MainPage.xaml 的交互逻辑
7
/// </summary>
8
public partial class MainPage : Page
9
{
10
public MainPage()
11
{
12
InitializeComponent();
13
}
14
}
@@ -1,9 +1,9 @@
1
<Page x:Class="XFEToolBox.ViewPage.SettingPage"
1
<Page x:Class="XFEToolBox.Views.Pages.SettingPage"
2
2
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
3
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
4
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5
5
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6
xmlns:local="clr-namespace:XFEToolBox.ViewPage"
6
xmlns:local="clr-namespace:XFEToolBox.Views.Pages"
7
7
mc:Ignorable="d"
8
8
d:DesignHeight="450" d:DesignWidth="800"
9
9
Title="SettingPage">
@@ -1,6 +1,6 @@
1
1
using System.Windows.Controls;
2
2
3
namespace XFEToolBox.ViewPage;
3
namespace XFEToolBox.Views.Pages;
4
4
5
5
/// <summary>
6
6
/// SettingPage.xaml 的交互逻辑
@@ -1,16 +1,15 @@
1
<Window x:Class="FileSystemWatcher.Windows.MainWindow"
1
<Window x:Class="XFEToolBox.Views.Windows.MainWindow"
2
2
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
3
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
4
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5
5
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6
xmlns:viewmodel="clr-namespace:FileSystemWatcher.ViewModel"
7
xmlns:local="clr-namespace:FileSystemWatcher.Windows"
6
xmlns:viewmodel="clr-namespace:XFEToolBox.ViewModel"
7
xmlns:local="clr-namespace:XFEToolBox.Views.Windows"
8
8
mc:Ignorable="d"
9
Title="MainWindow" Height="500" Width="800" Background="Transparent" WindowStyle="None" AllowsTransparency="True" WindowStartupLocation="CenterScreen">
10
<Window.DataContext>
11
<viewmodel:MainWindowViewModel/>
12
</Window.DataContext>
13
<Border CornerRadius="20" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="#9898e7">
9
d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel}"
10
Title="MainWindow" Height="450" Width="720" Background="Transparent" WindowStyle="None" AllowsTransparency="True" WindowStartupLocation="CenterScreen">
11
12
<Border CornerRadius="20" Background="#9898e7">
14
13
<Grid>
15
14
<Grid.ColumnDefinitions>
16
15
<ColumnDefinition Width="*"/>
@@ -28,8 +27,11 @@
28
27
<ColumnDefinition Width="45"/>
29
28
<ColumnDefinition Width="45"/>
30
29
</Grid.ColumnDefinitions>
31
<Image Grid.Column="1" Source="/Resources/Image/min.png" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2"/>
32
<Image Grid.Column="2" Source="/Resources/Image/close.png" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2"/>
30
<Border CornerRadius="0,0,20,20" Style="{StaticResource TabBorderStyle}">
31
<Image x:Name="dragTabImage" Source="/Resources/Image/tabline.png" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="4"/>
32
</Border>
33
<Image x:Name="minimizeImage" x:FieldModifier="internal" Grid.Column="1" Source="/Resources/Image/min.png" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4"/>
34
<Image x:Name="closeWindowImage" Grid.Column="2" Source="/Resources/Image/close.png" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4"/>
33
35
</Grid>
34
36
</Border>
35
37
<Border Grid.Column="0" Grid.Row="0" Background="Transparent">
@@ -1,6 +1,7 @@
1
using System.Windows;
1
using XFEToolBox.ViewModel;
2
using System.Windows;
2
3
3
namespace FileSystemWatcher.Windows
4
namespace XFEToolBox.Views.Windows
4
5
{
5
6
/// <summary>
6
7
/// Interaction logic for MainWindow.xaml
@@ -8,9 +9,12 @@ namespace FileSystemWatcher.Windows
8
9
public partial class MainWindow : Window
9
10
{
10
11
public static MainWindow? Current { get; private set; }
12
public MainWindowViewModel ViewModel { get; private set; }
11
13
public MainWindow()
12
14
{
13
15
InitializeComponent();
16
ViewModel = new MainWindowViewModel(this);
17
DataContext = ViewModel;
14
18
Current = this;
15
19
}
16
20
}
@@ -11,6 +11,7 @@
11
11
<ItemGroup>
12
12
<None Remove="Resources\Image\close.png" />
13
13
<None Remove="Resources\Image\min.png" />
14
<None Remove="Resources\Image\tabline.png" />
14
15
</ItemGroup>
15
16
16
17
<ItemGroup>
@@ -24,6 +25,7 @@
24
25
<ItemGroup>
25
26
<Resource Include="Resources\Image\close.png" />
26
27
<Resource Include="Resources\Image\min.png" />
28
<Resource Include="Resources\Image\tabline.png" />
27
29
</ItemGroup>
28
30
29
31
</Project>