page sample
This commit is contained in:
9
PacticeSolution/PageSample/App.xaml
Normal file
9
PacticeSolution/PageSample/App.xaml
Normal file
@@ -0,0 +1,9 @@
|
||||
<Application x:Class="PageSample.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:PageSample"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
17
PacticeSolution/PageSample/App.xaml.cs
Normal file
17
PacticeSolution/PageSample/App.xaml.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace PageSample
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
10
PacticeSolution/PageSample/AssemblyInfo.cs
Normal file
10
PacticeSolution/PageSample/AssemblyInfo.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.Windows;
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
29
PacticeSolution/PageSample/MainWindow.xaml
Normal file
29
PacticeSolution/PageSample/MainWindow.xaml
Normal file
@@ -0,0 +1,29 @@
|
||||
<Window x:Class="PageSample.MainWindow"
|
||||
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:local="clr-namespace:PageSample"
|
||||
mc:Ignorable="d"
|
||||
Title="MainWindow" Height="400" Width="250">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button x:Name="btnPage1" Grid.Column="0" Content="Page1" Margin="3"
|
||||
Click="btnPage1_Click"/>
|
||||
<Button x:Name="btnPage2" Grid.Column="1" Content="Page2" Margin="3"
|
||||
Click="btnPage2_Click"/>
|
||||
</Grid>
|
||||
|
||||
<Frame x:Name="frmMain" Grid.Row="1"/>
|
||||
</Grid>
|
||||
</Window>
|
45
PacticeSolution/PageSample/MainWindow.xaml.cs
Normal file
45
PacticeSolution/PageSample/MainWindow.xaml.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using PageSample.SubPage;
|
||||
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 PageSample
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
private Page1 _p1;
|
||||
private Page2 _p2;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_p1 = new Page1();
|
||||
_p2 = new Page2();
|
||||
}
|
||||
|
||||
private void btnPage1_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
frmMain.Content = _p1;
|
||||
}
|
||||
|
||||
private void btnPage2_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
frmMain.Content = _p2;
|
||||
}
|
||||
}
|
||||
}
|
10
PacticeSolution/PageSample/PageSample.csproj
Normal file
10
PacticeSolution/PageSample/PageSample.csproj
Normal file
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWPF>true</UseWPF>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
18
PacticeSolution/PageSample/SubPage/Page1.xaml
Normal file
18
PacticeSolution/PageSample/SubPage/Page1.xaml
Normal file
@@ -0,0 +1,18 @@
|
||||
<Page x:Class="PageSample.SubPage.Page1"
|
||||
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:PageSample.SubPage"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800"
|
||||
Title="Page1">
|
||||
|
||||
<Grid>
|
||||
<Label Content="Page1"
|
||||
FontSize="35"
|
||||
Background="LightSalmon"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
|
||||
</Grid>
|
||||
</Page>
|
28
PacticeSolution/PageSample/SubPage/Page1.xaml.cs
Normal file
28
PacticeSolution/PageSample/SubPage/Page1.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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 PageSample.SubPage
|
||||
{
|
||||
/// <summary>
|
||||
/// Page1.xaml에 대한 상호 작용 논리
|
||||
/// </summary>
|
||||
public partial class Page1 : Page
|
||||
{
|
||||
public Page1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
18
PacticeSolution/PageSample/SubPage/Page2.xaml
Normal file
18
PacticeSolution/PageSample/SubPage/Page2.xaml
Normal file
@@ -0,0 +1,18 @@
|
||||
<Page x:Class="PageSample.SubPage.Page2"
|
||||
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:PageSample.SubPage"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800"
|
||||
Title="Page2">
|
||||
|
||||
<Grid>
|
||||
<Label Content="Page1"
|
||||
FontSize="35"
|
||||
Background="LightSkyBlue"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
|
||||
</Grid>
|
||||
</Page>
|
28
PacticeSolution/PageSample/SubPage/Page2.xaml.cs
Normal file
28
PacticeSolution/PageSample/SubPage/Page2.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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 PageSample.SubPage
|
||||
{
|
||||
/// <summary>
|
||||
/// Page2.xaml에 대한 상호 작용 논리
|
||||
/// </summary>
|
||||
public partial class Page2 : Page
|
||||
{
|
||||
public Page2()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user