page sample

main
syneffort 2 years ago
parent 2c793d21af
commit 1a15ebc427
  1. 9
      PacticeSolution/BindingBasic/App.xaml
  2. 17
      PacticeSolution/BindingBasic/App.xaml.cs
  3. 10
      PacticeSolution/BindingBasic/AssemblyInfo.cs
  4. 10
      PacticeSolution/BindingBasic/BindingBasic.csproj
  5. 13
      PacticeSolution/BindingBasic/MainWindow.xaml
  6. 28
      PacticeSolution/BindingBasic/MainWindow.xaml.cs
  7. 20
      PacticeSolution/PacticeSolution.sln
  8. 9
      PacticeSolution/PageSample/App.xaml
  9. 17
      PacticeSolution/PageSample/App.xaml.cs
  10. 10
      PacticeSolution/PageSample/AssemblyInfo.cs
  11. 29
      PacticeSolution/PageSample/MainWindow.xaml
  12. 45
      PacticeSolution/PageSample/MainWindow.xaml.cs
  13. 10
      PacticeSolution/PageSample/PageSample.csproj
  14. 18
      PacticeSolution/PageSample/SubPage/Page1.xaml
  15. 28
      PacticeSolution/PageSample/SubPage/Page1.xaml.cs
  16. 18
      PacticeSolution/PageSample/SubPage/Page2.xaml
  17. 28
      PacticeSolution/PageSample/SubPage/Page2.xaml.cs
  18. 37
      PacticeSolution/StringBuilderTest/Program.cs
  19. 10
      PacticeSolution/StringBuilderTest/StringBuilderTest.csproj

@ -0,0 +1,9 @@
<Application x:Class="BindingBasic.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:BindingBasic"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

@ -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 BindingBasic
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

@ -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)
)]

@ -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>

@ -0,0 +1,13 @@
<Window x:Class="BindingBasic.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:BindingBasic"
mc:Ignorable="d"
Title="MainWindow" Height="300" Width="400">
<StackPanel>
<TextBox x:Name="txtMain"/>
<Label Content="{Binding ElementName=txtMain, Path=Text}"/>
</StackPanel>
</Window>

@ -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 BindingBasic
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}

@ -91,7 +91,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddressBook_MVVMSample", "A
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AddressBook_MVVMSampleV2", "AddressBook_MVVMSampleV2\AddressBook_MVVMSampleV2.csproj", "{0CE2A390-5A8B-4F13-9F60-A4AF77F0B1F3}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AddressBook_MVVMSampleV2", "AddressBook_MVVMSampleV2\AddressBook_MVVMSampleV2.csproj", "{0CE2A390-5A8B-4F13-9F60-A4AF77F0B1F3}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSSQL_MVVM_Sample", "MSSQL_MVVM_Sample\MSSQL_MVVM_Sample.csproj", "{BAAF8254-74D1-406D-9765-43DCA9F939C7}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSSQL_MVVM_Sample", "MSSQL_MVVM_Sample\MSSQL_MVVM_Sample.csproj", "{BAAF8254-74D1-406D-9765-43DCA9F939C7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BindingBasic", "BindingBasic\BindingBasic.csproj", "{8A804AD3-0DE0-406A-94ED-25A185875278}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StringBuilderTest", "StringBuilderTest\StringBuilderTest.csproj", "{39BB03B4-BD6D-412A-AEF9-524597AA5673}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PageSample", "PageSample\PageSample.csproj", "{FA1B4A97-2D15-4EDD-BB0F-7E689F203DCD}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -279,6 +285,18 @@ Global
{BAAF8254-74D1-406D-9765-43DCA9F939C7}.Debug|Any CPU.Build.0 = Debug|Any CPU {BAAF8254-74D1-406D-9765-43DCA9F939C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BAAF8254-74D1-406D-9765-43DCA9F939C7}.Release|Any CPU.ActiveCfg = Release|Any CPU {BAAF8254-74D1-406D-9765-43DCA9F939C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BAAF8254-74D1-406D-9765-43DCA9F939C7}.Release|Any CPU.Build.0 = Release|Any CPU {BAAF8254-74D1-406D-9765-43DCA9F939C7}.Release|Any CPU.Build.0 = Release|Any CPU
{8A804AD3-0DE0-406A-94ED-25A185875278}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8A804AD3-0DE0-406A-94ED-25A185875278}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A804AD3-0DE0-406A-94ED-25A185875278}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A804AD3-0DE0-406A-94ED-25A185875278}.Release|Any CPU.Build.0 = Release|Any CPU
{39BB03B4-BD6D-412A-AEF9-524597AA5673}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39BB03B4-BD6D-412A-AEF9-524597AA5673}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39BB03B4-BD6D-412A-AEF9-524597AA5673}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39BB03B4-BD6D-412A-AEF9-524597AA5673}.Release|Any CPU.Build.0 = Release|Any CPU
{FA1B4A97-2D15-4EDD-BB0F-7E689F203DCD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FA1B4A97-2D15-4EDD-BB0F-7E689F203DCD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA1B4A97-2D15-4EDD-BB0F-7E689F203DCD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FA1B4A97-2D15-4EDD-BB0F-7E689F203DCD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

@ -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>

@ -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
{
}
}

@ -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)
)]

@ -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>

@ -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;
}
}
}

@ -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>

@ -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>

@ -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();
}
}
}

@ -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>

@ -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();
}
}
}

@ -0,0 +1,37 @@
using System.Diagnostics;
using System.Text;
namespace StringBuilderTest
{
internal class Program
{
static void Main(string[] args)
{
int cnt = 100000;
Stopwatch sw = new Stopwatch();
Console.WriteLine("Test1\tString");
sw.Start();
string s = "";
for (int i = 0; i < cnt; i++)
{
s += i;
}
sw.Stop();
Console.WriteLine($"Elapsed: {sw.ElapsedMilliseconds}ms");
Console.WriteLine("Test2\tStringBuilder");
sw.Restart();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < cnt; i++)
{
sb.Append(i);
}
sw.Stop();
Console.WriteLine($"Elapsed: {sw.ElapsedMilliseconds}ms");
}
}
}

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
Loading…
Cancel
Save