[build] 교육 프로젝트 초안 작성 완료
이 커밋에서는 WPF 애플리케이션의 초기 구성과 관련된 여러 가지 중요한 변경사항들이 이루어졌습니다. 주요 변경사항은 다음과 같습니다: 1. `App.xaml`에서 애플리케이션의 시작점을 `StartupUri`에서 `Startup` 이벤트로 변경하였습니다. 이를 통해 애플리케이션 시작 시 보다 세밀한 컨트롤이 가능해졌습니다. 2. `App.xaml.cs`에서 `OnStartup` 메서드 대신 `Application_Startup` 메서드를 사용하도록 변경하였고, `Main` 메서드의 주석 처리된 부분을 삭제하여 코드를 정리하였습니다. 또한, 테마와 언어 설정을 위한 메서드들의 접근 제한자를 `private`에서 `static`으로 변경하여 클래스 레벨에서 접근 가능하게 하였습니다. 3. `AppSettings.cs`에서 발생한 변수명 오류를 수정하여, 이벤트 아규먼트의 `Old` 값을 `language`에서 `theme`으로 정확히 반영하도록 하였습니다. 4. `MemberInputPanel.xaml`에서 정적 리소스 대신 동적 리소스를 사용하도록 변경하여, 런타임에 리소스 변경이 가능하게 하였습니다. 5. 사용되지 않는 `AlreadyExcutedAppException.cs` 파일을 삭제하여 프로젝트의 깔끔함을 유지하였습니다. 6. `MainWindowViewModel.cs`와 `RegistMemberWindowViewModel.cs`에서 코드 정리를 수행하고, 윈도우 최소화, 최대화, 닫기 등의 기능을 수행하는 커맨드를 추가하였습니다. 7. `LoginWindow.xaml`과 `MainWindow.xaml`에서 정적 리소스를 동적 리소스로 변경하여 언어 및 테마 변경 시 UI가 동적으로 업데이트 되도록 개선했습니다. 이러한 변경사항들은 애플리케이션의 시작 과정을 보다 유연하게 만들고, 사용자 인터페이스의 동적 업데이트를 가능하게 하며, 전반적인 코드의 정리와 개선을 목표로 합니다.
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:service="clr-namespace:WPFBeginner.Services"
|
xmlns:service="clr-namespace:WPFBeginner.Services"
|
||||||
xmlns:conv="clr-namespace:WPFBeginner.Converters"
|
xmlns:conv="clr-namespace:WPFBeginner.Converters"
|
||||||
StartupUri="/Views/MainWindow.xaml">
|
Startup="Application_Startup">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<service:ViewModelLocator x:Key="ViewModelLocator"/>
|
<service:ViewModelLocator x:Key="ViewModelLocator"/>
|
||||||
|
|||||||
@@ -26,38 +26,34 @@ namespace WPFBeginner
|
|||||||
|
|
||||||
public static AppSettings Config { get; private set; }
|
public static AppSettings Config { get; private set; }
|
||||||
|
|
||||||
//[STAThread]
|
private void Application_Startup(object sender, StartupEventArgs e)
|
||||||
//static void Main()
|
|
||||||
//{
|
|
||||||
//try
|
|
||||||
//{
|
|
||||||
// var application = new App();
|
|
||||||
// application.InitializeComponent(); // For resouce load.
|
|
||||||
// application.Run();
|
|
||||||
//}
|
|
||||||
//catch (AlreadyExcutedAppException ex)
|
|
||||||
//{
|
|
||||||
// MessageBox.Show("이미 실행중입니다. 종료 후, 다시 실행해주세요");
|
|
||||||
//}
|
|
||||||
//catch (LoginFailedException ex)
|
|
||||||
//{
|
|
||||||
// // Do not anything;
|
|
||||||
//}
|
|
||||||
//catch (Exception ex)
|
|
||||||
//{
|
|
||||||
// // log
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
|
|
||||||
protected override void OnStartup(StartupEventArgs e)
|
|
||||||
{
|
{
|
||||||
base.OnStartup(e);
|
|
||||||
|
|
||||||
//Login();
|
|
||||||
InitializeService();
|
InitializeService();
|
||||||
|
var main = new MainWindow();
|
||||||
|
App.Current.MainWindow = main;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Login();
|
||||||
|
|
||||||
|
Application.Current.ShutdownMode = ShutdownMode.OnMainWindowClose;
|
||||||
|
App.Current.MainWindow.Show();
|
||||||
|
}
|
||||||
|
catch(Exception ex)
|
||||||
|
{
|
||||||
|
App.Current.MainWindow.Close();
|
||||||
|
Environment.Exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeService()
|
private void UnhandledExceptionHandle(object e)
|
||||||
|
{
|
||||||
|
if(e is UnhandledExceptionEventArgs uee && uee.ExceptionObject is LoginFailedException)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void InitializeService()
|
||||||
{
|
{
|
||||||
Config = JsonSerializer.Deserialize<AppSettings>(File.ReadAllText("appsettings.json"));
|
Config = JsonSerializer.Deserialize<AppSettings>(File.ReadAllText("appsettings.json"));
|
||||||
|
|
||||||
@@ -78,22 +74,22 @@ namespace WPFBeginner
|
|||||||
.BuildServiceProvider());
|
.BuildServiceProvider());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetTheme(string code)
|
private static void SetTheme(string code)
|
||||||
{
|
{
|
||||||
if (_currentTheme != null)
|
if (_currentTheme != null)
|
||||||
Resources.MergedDictionaries.Remove(_currentTheme);
|
App.Current.Resources.MergedDictionaries.Remove(_currentTheme);
|
||||||
|
|
||||||
_currentTheme = ResourceExplorer.GetThemeResourceDic(code);
|
_currentTheme = ResourceExplorer.GetThemeResourceDic(code);
|
||||||
Resources.MergedDictionaries.Add(_currentTheme);
|
App.Current.Resources.MergedDictionaries.Add(_currentTheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetLanguage(string code)
|
private static void SetLanguage(string code)
|
||||||
{
|
{
|
||||||
if (_currentLanguage != null)
|
if (_currentLanguage != null)
|
||||||
Resources.MergedDictionaries.Remove( _currentLanguage );
|
App.Current.Resources.MergedDictionaries.Remove( _currentLanguage );
|
||||||
|
|
||||||
_currentLanguage = ResourceExplorer.GetLanguageResourceDic(code);
|
_currentLanguage = ResourceExplorer.GetLanguageResourceDic(code);
|
||||||
Resources.MergedDictionaries.Add(_currentLanguage);
|
App.Current.Resources.MergedDictionaries.Add(_currentLanguage);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Login()
|
private static void Login()
|
||||||
@@ -101,9 +97,10 @@ namespace WPFBeginner
|
|||||||
var login = new LoginWindow();
|
var login = new LoginWindow();
|
||||||
var isSuccess = login.ShowDialog();
|
var isSuccess = login.ShowDialog();
|
||||||
|
|
||||||
if (isSuccess != true)
|
if (isSuccess != true)
|
||||||
throw new LoginFailedException();
|
throw new LoginFailedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace WPFBeginner.Configurations
|
|||||||
{
|
{
|
||||||
var eventArg = new StringChangedEventArg()
|
var eventArg = new StringChangedEventArg()
|
||||||
{
|
{
|
||||||
Old = language,
|
Old = theme,
|
||||||
New = value
|
New = value
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -39,10 +39,10 @@
|
|||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Label Grid.Row="0" Style="{StaticResource LabelTitle}" Content="{StaticResource Cultures.MainWindow.Label.Name}"/>
|
<Label Grid.Row="0" Style="{StaticResource LabelTitle}" Content="{DynamicResource Cultures.MainWindow.Label.Name}"/>
|
||||||
<Label Grid.Row="1" Style="{StaticResource LabelTitle}" Content="{StaticResource Cultures.MainWindow.Label.Call}" />
|
<Label Grid.Row="1" Style="{StaticResource LabelTitle}" Content="{DynamicResource Cultures.MainWindow.Label.Call}" />
|
||||||
<Label Grid.Row="2" Style="{StaticResource LabelTitle}" Content="{StaticResource Cultures.MainWindow.Label.No}"/>
|
<Label Grid.Row="2" Style="{StaticResource LabelTitle}" Content="{DynamicResource Cultures.MainWindow.Label.No}"/>
|
||||||
<Label Grid.Row="3" Style="{StaticResource LabelTitle}" Content="{StaticResource Cultures.MainWindow.Label.Mail}"/>
|
<Label Grid.Row="3" Style="{StaticResource LabelTitle}" Content="{DynamicResource Cultures.MainWindow.Label.Mail}"/>
|
||||||
|
|
||||||
<TextBox Grid.Row="0" Grid.Column="1" Style="{StaticResource InputBox}" Text="{Binding ElementName=root, Path=MemberName}"/>
|
<TextBox Grid.Row="0" Grid.Column="1" Style="{StaticResource InputBox}" Text="{Binding ElementName=root, Path=MemberName}"/>
|
||||||
<TextBox Grid.Row="1" Grid.Column="1" Style="{StaticResource InputBox}" Text="{Binding ElementName=root, Path=Call}"/>
|
<TextBox Grid.Row="1" Grid.Column="1" Style="{StaticResource InputBox}" Text="{Binding ElementName=root, Path=Call}"/>
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace WPFBeginner.Exceptions
|
|
||||||
{
|
|
||||||
internal class AlreadyExcutedAppException : Exception
|
|
||||||
{
|
|
||||||
public AlreadyExcutedAppException() : base()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -82,28 +82,6 @@ namespace WPFBeginner.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool isKorean;
|
|
||||||
public bool IsKorean
|
|
||||||
{
|
|
||||||
get => isKorean;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
SetProperty(ref isKorean, value);
|
|
||||||
App.Config.Language = value ? "ko-KR" : "en-US";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool isDefaultTheme;
|
|
||||||
public bool IsDefaultTheme
|
|
||||||
{
|
|
||||||
get => isDefaultTheme;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
SetProperty(ref isDefaultTheme, value);
|
|
||||||
App.Config.Theme = value ? "DefaultTheme" : "LightTheme";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ICommand SearchClickCommand => new RelayCommand(() =>
|
public ICommand SearchClickCommand => new RelayCommand(() =>
|
||||||
{
|
{
|
||||||
var errorMessage = ValidateSearchValues();
|
var errorMessage = ValidateSearchValues();
|
||||||
@@ -114,7 +92,6 @@ namespace WPFBeginner.ViewModels
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
IEnumerable<Member> result = Members;
|
IEnumerable<Member> result = Members;
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(MemberName))
|
if (!string.IsNullOrWhiteSpace(MemberName))
|
||||||
@@ -137,6 +114,46 @@ namespace WPFBeginner.ViewModels
|
|||||||
OnPropertyChanged(nameof(Members));
|
OnPropertyChanged(nameof(Members));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
public ICommand CloseCommand => new RelayCommand<Window>(window => window.Close());
|
||||||
|
|
||||||
|
public ICommand MinimizeCommand => new RelayCommand<Window>(window => window.WindowState = WindowState.Minimized);
|
||||||
|
|
||||||
|
public ICommand MaximizeCommad => new RelayCommand<Window>(window =>
|
||||||
|
{
|
||||||
|
switch (window.WindowState)
|
||||||
|
{
|
||||||
|
case WindowState.Maximized:
|
||||||
|
window.WindowState = WindowState.Normal;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WindowState.Normal:
|
||||||
|
window.WindowState = WindowState.Maximized;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
public bool IsKorean => App.Config.Language.Equals("ko-KR", StringComparison.OrdinalIgnoreCase);
|
||||||
|
public bool IsEnglish => App.Config.Language.Equals("en-US", StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
|
||||||
|
public ICommand LangueChangeCommand => new RelayCommand<string>(code =>
|
||||||
|
{
|
||||||
|
App.Config.Language = code;
|
||||||
|
OnPropertyChanged(nameof(IsKorean));
|
||||||
|
OnPropertyChanged(nameof(IsEnglish));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public bool IsDefaultTheme => App.Config.Theme.Equals("DefaultTheme", StringComparison.OrdinalIgnoreCase);
|
||||||
|
public bool IsLightTheme => App.Config.Theme.Equals("LightTheme", StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
public ICommand ThemeChangeCommand => new RelayCommand<string>(code =>
|
||||||
|
{
|
||||||
|
App.Config.Theme = code;
|
||||||
|
OnPropertyChanged(nameof(IsDefaultTheme));
|
||||||
|
OnPropertyChanged(nameof(IsLightTheme));
|
||||||
|
});
|
||||||
|
|
||||||
private string ValidateSearchValues()
|
private string ValidateSearchValues()
|
||||||
{
|
{
|
||||||
@@ -186,8 +203,6 @@ namespace WPFBeginner.ViewModels
|
|||||||
{
|
{
|
||||||
CreateDefaultMember();
|
CreateDefaultMember();
|
||||||
searchModel = new Member();
|
searchModel = new Member();
|
||||||
isKorean = App.Config.Language.Equals("ko-KR", StringComparison.OrdinalIgnoreCase);
|
|
||||||
isDefaultTheme = App.Config.Theme.Equals("DefaultTheme", StringComparison.OrdinalIgnoreCase);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreateDefaultMember()
|
private void CreateDefaultMember()
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ namespace WPFBeginner.ViewModels
|
|||||||
window.DialogResult = false;
|
window.DialogResult = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private string Validate()
|
private string Validate()
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(MemberName) || string.IsNullOrWhiteSpace(EmployeeNo))
|
if (string.IsNullOrWhiteSpace(MemberName) || string.IsNullOrWhiteSpace(EmployeeNo))
|
||||||
@@ -44,5 +46,7 @@ namespace WPFBeginner.ViewModels
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
<ColumnDefinition Width="40"/>
|
<ColumnDefinition Width="40"/>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Label Grid.ColumnSpan="2" Content="{StaticResource Cultures.LoginWindow.Inform}" Margin="15,0" FontSize="24" HorizontalAlignment="Left" VerticalAlignment="Center" FontWeight="Bold" FontFamily="Noto Sans CJK KR Medium" Foreground="Black" />
|
<Label Grid.ColumnSpan="2" Content="{DynamicResource Cultures.LoginWindow.Inform}" Margin="15,0" FontSize="24" HorizontalAlignment="Left" VerticalAlignment="Center" FontWeight="Bold" FontFamily="Noto Sans CJK KR Medium" Foreground="Black" />
|
||||||
<Image Grid.Row="1" Grid.Column="0" Source="/Resources/Images/ico_user.png" Margin="10"/>
|
<Image Grid.Row="1" Grid.Column="0" Source="/Resources/Images/ico_user.png" Margin="10"/>
|
||||||
<TextBox Grid.Row="1" Grid.Column="1" Name="TB_User" Text="{Binding User}" Margin="5,5,15,0" FontSize="14"
|
<TextBox Grid.Row="1" Grid.Column="1" Name="TB_User" Text="{Binding User}" Margin="5,5,15,0" FontSize="14"
|
||||||
Background="#7FFFFFFF" VerticalContentAlignment="Center" Padding="10,0,0,0"
|
Background="#7FFFFFFF" VerticalContentAlignment="Center" Padding="10,0,0,0"
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
sv:PasswordBoxAssistant.BoundPassword="{Binding Path=Password, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="5,5,15,0"
|
sv:PasswordBoxAssistant.BoundPassword="{Binding Path=Password, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="5,5,15,0"
|
||||||
FontSize="14" Background="#7FFFFFFF" VerticalContentAlignment="Center" Padding="10,0,0,0" IsTabStop="True" TabIndex="2"/>
|
FontSize="14" Background="#7FFFFFFF" VerticalContentAlignment="Center" Padding="10,0,0,0" IsTabStop="True" TabIndex="2"/>
|
||||||
<Grid Grid.Row="3" Grid.ColumnSpan="2">
|
<Grid Grid.Row="3" Grid.ColumnSpan="2">
|
||||||
<Button Style="{StaticResource LoginButtonStyle}" Content="{StaticResource Cultures.LoginWindow.LoginButtonText}" Margin="100,5" Background="#FFFF7575" FontSize="14" Foreground="White" FontWeight="Bold"
|
<Button Style="{StaticResource LoginButtonStyle}" Content="{DynamicResource Cultures.LoginWindow.LoginButtonText}" Margin="100,5" Background="#FFFF7575" FontSize="14" Foreground="White" FontWeight="Bold"
|
||||||
Command="{Binding LoginClickCommand}" CommandParameter="{Binding ElementName=root}" IsTabStop="True" TabIndex="3"/>
|
Command="{Binding LoginClickCommand}" CommandParameter="{Binding ElementName=root}" IsTabStop="True" TabIndex="3"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:uc="clr-namespace:WPFBeginner.Controls"
|
xmlns:uc="clr-namespace:WPFBeginner.Controls"
|
||||||
WindowStyle="None" ResizeMode="CanResize"
|
WindowStyle="None" ResizeMode="CanResize" Name="root"
|
||||||
mc:Ignorable="d" Title="MainWindow" Height="500" Width="400" Padding="20">
|
mc:Ignorable="d" Title="MainWindow" Height="500" Width="400" Padding="20">
|
||||||
|
|
||||||
<WindowChrome.WindowChrome>
|
<WindowChrome.WindowChrome>
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
</Window.DataContext>
|
</Window.DataContext>
|
||||||
|
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
|
|
||||||
<Style x:Key="SearchButton" TargetType="Button">
|
<Style x:Key="SearchButton" TargetType="Button">
|
||||||
<Setter Property="Background" Value="{DynamicResource Colors.SearchButton.Background.Normal}"/>
|
<Setter Property="Background" Value="{DynamicResource Colors.SearchButton.Background.Normal}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource Colors.SearchButton.BorderBrush.Normal}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource Colors.SearchButton.BorderBrush.Normal}"/>
|
||||||
@@ -58,14 +59,14 @@
|
|||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Label Content="{StaticResource Cultures.MainWindow.Title}" Foreground="{StaticResource Colors.TitleBar.Title.Foreground}"
|
<Label Content="{DynamicResource Cultures.MainWindow.Title}" Foreground="{DynamicResource Colors.TitleBar.Title.Foreground}"
|
||||||
FontSize="14" FontFamily="NanumSquareOTF_ac Bold" VerticalContentAlignment="Center" Padding="10 0"/>
|
FontSize="14" FontFamily="NanumSquareOTF_ac Bold" VerticalContentAlignment="Center" Padding="10 0"/>
|
||||||
<Grid Grid.Column="2">
|
<Grid Grid.Column="2">
|
||||||
<StackPanel Orientation="Horizontal" WindowChrome.IsHitTestVisibleInChrome="True" VerticalAlignment="Top">
|
<StackPanel Orientation="Horizontal" WindowChrome.IsHitTestVisibleInChrome="True" VerticalAlignment="Top">
|
||||||
<ToggleButton Width="22" Height="22" Style="{DynamicResource SettingButtonStyle}" Name="bt_settings"/>
|
<ToggleButton Width="22" Height="22" Style="{DynamicResource SettingButtonStyle}" Name="bt_settings"/>
|
||||||
<Button Width="39" Height="27" Style="{DynamicResource TiTleBarMinimizeButton}" Command="{Binding MinimizeCommand}"/>
|
<Button Width="39" Height="27" Style="{DynamicResource TiTleBarMinimizeButton}" Command="{Binding MinimizeCommand}" CommandParameter="{Binding ElementName=root}"/>
|
||||||
<Button Width="39" Height="27" Style="{DynamicResource TiTleBarMaximizeButton}" Command="{Binding MaximizeCommad}"/>
|
<Button Width="39" Height="27" Style="{DynamicResource TiTleBarMaximizeButton}" Command="{Binding MaximizeCommad}" CommandParameter="{Binding ElementName=root}"/>
|
||||||
<Button Width="39" Height="27" Style="{DynamicResource TiTleBarCloseButton}" Command="{Binding CloseCommand}"/>
|
<Button Width="39" Height="27" Style="{DynamicResource TiTleBarCloseButton}" Command="{Binding CloseCommand}" CommandParameter="{Binding ElementName=root}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Popup PlacementTarget="{Binding ElementName=bt_settings}" Placement="Bottom" IsOpen="{Binding ElementName=bt_settings, Path=IsChecked}" StaysOpen="False">
|
<Popup PlacementTarget="{Binding ElementName=bt_settings}" Placement="Bottom" IsOpen="{Binding ElementName=bt_settings, Path=IsChecked}" StaysOpen="False">
|
||||||
<Border Background="{DynamicResource Colors.SettingPopup.Background}" BorderThickness="1" BorderBrush="{DynamicResource Colors.SettingPopup.BorderBrush}" >
|
<Border Background="{DynamicResource Colors.SettingPopup.Background}" BorderThickness="1" BorderBrush="{DynamicResource Colors.SettingPopup.BorderBrush}" >
|
||||||
@@ -78,20 +79,23 @@
|
|||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<RadioButton Content="한글판" Foreground="{DynamicResource Colors.SettingPopup.Foreground}" GroupName="Cultures" IsChecked="{Binding IsKorean}"/>
|
<RadioButton Content="한글판" Foreground="{DynamicResource Colors.SettingPopup.Foreground}"
|
||||||
<RadioButton Content="English" Foreground="{DynamicResource Colors.SettingPopup.Foreground}" GroupName="Cultures" IsChecked="{Binding IsKorean, Converter={StaticResource InverseBoolConverter}}"/>
|
GroupName="Cultures" IsChecked="{Binding IsKorean, Mode=OneWay}" Command="{Binding LangueChangeCommand}" CommandParameter="ko-KR"/>
|
||||||
|
<RadioButton Content="English" Foreground="{DynamicResource Colors.SettingPopup.Foreground}"
|
||||||
|
GroupName="Cultures" IsChecked="{Binding IsEnglish, Mode=OneWay}" Command="{Binding LangueChangeCommand}" CommandParameter="en-US"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel Grid.Row="2">
|
<StackPanel Grid.Row="2">
|
||||||
<RadioButton Content="Dark" Foreground="{DynamicResource Colors.SettingPopup.Foreground}" GroupName="Themes"/>
|
<RadioButton Content="Default" Foreground="{DynamicResource Colors.SettingPopup.Foreground}" GroupName="Themes"
|
||||||
<RadioButton Content="Light" Foreground="{DynamicResource Colors.SettingPopup.Foreground}" GroupName="Themes"/>
|
IsChecked="{Binding IsDefaultTheme, Mode=OneWay}" Command="{Binding ThemeChangeCommand}" CommandParameter="DefaultTheme"/>
|
||||||
|
<RadioButton Content="Light" Foreground="{DynamicResource Colors.SettingPopup.Foreground}" GroupName="Themes"
|
||||||
|
IsChecked="{Binding IsLightTheme, Mode=OneWay}" Command="{Binding ThemeChangeCommand}" CommandParameter="LightTheme"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Popup>
|
</Popup>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<Border HorizontalAlignment="Stretch" VerticalAlignment="Bottom" BorderThickness="0.5" BorderBrush="{DynamicResource Colors.Section.HorizontalSeperator}"/>
|
<Border HorizontalAlignment="Stretch" VerticalAlignment="Bottom" BorderThickness="0.5" BorderBrush="{DynamicResource Colors.Section.HorizontalSeperator}"/>
|
||||||
|
|
||||||
@@ -112,7 +116,7 @@
|
|||||||
Command="{Binding SearchClickCommand}">
|
Command="{Binding SearchClickCommand}">
|
||||||
<StackPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
|
<StackPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
|
||||||
<Image Source="/Resources/Images/btn_search_001.png" Stretch="UniformToFill"/>
|
<Image Source="/Resources/Images/btn_search_001.png" Stretch="UniformToFill"/>
|
||||||
<Label Content="{StaticResource Cultures.MainWindow.Button.Search}"
|
<Label Content="{DynamicResource Cultures.MainWindow.Button.Search}"
|
||||||
Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=Button}}"
|
Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=Button}}"
|
||||||
HorizontalAlignment="Center" FontFamily="Yu Gothic UI" FontWeight="Bold" FontSize="12" Margin="0" Padding="0"/>
|
HorizontalAlignment="Center" FontFamily="Yu Gothic UI" FontWeight="Bold" FontSize="12" Margin="0" Padding="0"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@@ -132,18 +136,34 @@
|
|||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="10 5">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="10 5">
|
||||||
<Button Content="{StaticResource Cultures.MainWindow.Button.Add}" Style="{DynamicResource DataGridEditButtonStyle}" Command="{Binding AddClickCommand}"/>
|
<Button Content="{DynamicResource Cultures.MainWindow.Button.Add}" Style="{DynamicResource DataGridEditButtonStyle}" Command="{Binding AddClickCommand}"/>
|
||||||
<Button Content="{StaticResource Cultures.MainWindow.Button.Delete}" Style="{DynamicResource DataGridEditButtonStyle}" Command="{Binding DeleteClickCommand}"/>
|
<Button Content="{DynamicResource Cultures.MainWindow.Button.Delete}" Style="{DynamicResource DataGridEditButtonStyle}" Command="{Binding DeleteClickCommand}"/>
|
||||||
<Button Content="{StaticResource Cultures.MainWindow.Button.Init}" Style="{DynamicResource DataGridEditButtonStyle}" Command="{Binding InitClickCommand}"/>
|
<Button Content="{DynamicResource Cultures.MainWindow.Button.Init}" Style="{DynamicResource DataGridEditButtonStyle}" Command="{Binding InitClickCommand}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<DataGrid Grid.Row="1" Margin="5" ItemsSource="{Binding Members}" SelectedItem="{Binding SelectedMember}" AutoGenerateColumns="False" IsReadOnly="True">
|
<DataGrid Grid.Row="1" Margin="5" ItemsSource="{Binding Members}" SelectedItem="{Binding SelectedMember}" AutoGenerateColumns="False" IsReadOnly="True">
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridTextColumn Header="{DynamicResource Cultures.MainWindow.DatagGid.Column.Name}" Binding="{Binding Name}" Width="*"/>
|
<DataGridTextColumn Binding="{Binding Name}" Width="*">
|
||||||
<DataGridTextColumn Header="{DynamicResource Cultures.MainWindow.DatagGid.Column.Call}" Binding="{Binding Call}" Width="*"/>
|
<DataGridTextColumn.Header>
|
||||||
<DataGridTextColumn Header="{DynamicResource Cultures.MainWindow.DatagGid.Column.No}" Binding="{Binding EmployeeNo}" Width="*"/>
|
<TextBlock Text="{DynamicResource Cultures.MainWindow.DatagGid.Column.Name}" />
|
||||||
<DataGridTextColumn Header="{DynamicResource Cultures.MainWindow.DatagGid.Column.Email}" Binding="{Binding EMail}" Width="*"/>
|
</DataGridTextColumn.Header>
|
||||||
|
</DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Binding="{Binding Call}" Width="*">
|
||||||
|
<DataGridTextColumn.Header>
|
||||||
|
<TextBlock Text="{DynamicResource Cultures.MainWindow.DatagGid.Column.Call}" />
|
||||||
|
</DataGridTextColumn.Header>
|
||||||
|
</DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Binding="{Binding EmployeeNo}" Width="*">
|
||||||
|
<DataGridTextColumn.Header>
|
||||||
|
<TextBlock Text="{DynamicResource Cultures.MainWindow.DatagGid.Column.No}" />
|
||||||
|
</DataGridTextColumn.Header>
|
||||||
|
</DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Binding="{Binding EMail}" Width="*">
|
||||||
|
<DataGridTextColumn.Header>
|
||||||
|
<TextBlock Text="{DynamicResource Cultures.MainWindow.DatagGid.Column.Email}" />
|
||||||
|
</DataGridTextColumn.Header>
|
||||||
|
</DataGridTextColumn>
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
WindowStyle="SingleBorderWindow"
|
WindowStyle="SingleBorderWindow"
|
||||||
xmlns:vm ="clr-namespace:WPFBeginner.ViewModels"
|
xmlns:vm ="clr-namespace:WPFBeginner.ViewModels"
|
||||||
mc:Ignorable="d" WindowStartupLocation="CenterOwner" Name="root"
|
mc:Ignorable="d" WindowStartupLocation="CenterOwner" Name="root"
|
||||||
Title="Regist" SizeToContent="WidthAndHeight" MinWidth="200" MinHeight="200" d:DesignHeight="200" d:DesignWidth="200"
|
Title="" SizeToContent="WidthAndHeight" MinWidth="350" MinHeight="200" d:DesignHeight="200" d:DesignWidth="200"
|
||||||
bh:WindowBehavior.HideCloseButton="True">
|
bh:WindowBehavior.HideCloseButton="True">
|
||||||
|
|
||||||
<Window.DataContext>
|
<Window.DataContext>
|
||||||
|
|||||||
Reference in New Issue
Block a user