design: 리스트 박스 스타일 변경

prototype
HyungJune Kim 7 months ago
parent edb92f3191
commit e308fcbf34

@ -2,31 +2,34 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SmartAquaViewer"
xmlns:classes="clr-namespace:SmartAquaViewer.Classes"
xmlns:view="clr-namespace:SmartAquaViewer.View"
xmlns:vm="clr-namespace:SmartAquaViewer.ViewModel"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesign2.Defaults.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Secondary/MaterialDesignColor.Lime.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml"/>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Badged.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Card.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Chip.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Clock.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Flipper.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.FlipperClassic.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ColorPicker.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.PopupBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.RatingBar.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TimePicker.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Shadows.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.SmartHint.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Snackbar.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.AutoSuggestBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.SplitButton.xaml" />
<ResourceDictionary Source="/Resources/Generic.xaml"/>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesign2.Defaults.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Secondary/MaterialDesignColor.Lime.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Badged.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Card.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Chip.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Clock.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Flipper.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.FlipperClassic.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ColorPicker.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.PopupBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.RatingBar.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TimePicker.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Shadows.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.SmartHint.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Snackbar.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.AutoSuggestBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.SplitButton.xaml" />
</ResourceDictionary.MergedDictionaries>
<DataTemplate DataType="{x:Type vm:MonitoringViewModel}">
@ -41,6 +44,7 @@
<DataTemplate DataType="{x:Type vm:CCTVViewModel}">
<view:CCTVView/>
</DataTemplate>
</ResourceDictionary>
</Application.Resources>
</Application>

@ -4,6 +4,7 @@ using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
namespace SmartAquaViewer.Classes
@ -78,4 +79,32 @@ namespace SmartAquaViewer.Classes
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
=> throw new NotImplementedException();
}
public class BoolToVisibilityConverter : IValueConverter
{
public bool Inverse { get; set; }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
bool flag = false;
if (value is bool b)
flag = b;
if (Inverse)
flag = !flag;
return flag ? Visibility.Visible : Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is Visibility visibility)
{
bool flag = visibility == Visibility.Visible;
return Inverse ? !flag : flag;
}
return false;
}
}
}

@ -1,11 +1,15 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:classes="clr-namespace:SmartAquaViewer.Classes"
xmlns:helper="clr-namespace:SmartAquaViewer.Helper"
xmlns:vm="clr-namespace:SmartAquaViewer.ViewModel"
xmlns:model="clr-namespace:SmartAquaViewer.Model"
xmlns:da="clr-namespace:SmartAquaViewer.DataAnalysis"
xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:shell="clr-namespace:System.Windows.Shell;assembly=PresentationFramework">
<classes:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
<FontFamily x:Key="SCDream1">pack://application:,,,/Fonts/#S-Core Dream 1 Thin</FontFamily>
<FontFamily x:Key="SCDream2">pack://application:,,,/Fonts/#S-Core Dream 2 ExtraLight</FontFamily>
<FontFamily x:Key="SCDream3">pack://application:,,,/Fonts/#S-Core Dream 3 Light</FontFamily>
@ -192,6 +196,8 @@
<Style x:Key="TrapezoidButtonStyle" TargetType="Button">
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Width" Value="92"/>
<Setter Property="Height" Value="30"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
@ -203,7 +209,7 @@
(0,50) (140,50) -->
<Polygon x:Name="shape"
Fill="#1D3649"
Points="20,0 120,0 140,50 0,50" />
Points="85.6111,0 92,30 0,30 6.38889,0" />
<!-- 내용 -->
<ContentPresenter HorizontalAlignment="Center"
@ -301,4 +307,118 @@
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style x:Key="PageCommandButtonStyle"
TargetType="Button"
BasedOn="{StaticResource MaterialDesignFlatLightBgButton}">
<!-- 기본 속성 재정의 -->
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Width" Value="20"/>
<Setter Property="Height" Value="20"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Opacity" Value="1"/>
</Style>
<Style TargetType="ListBoxItem" x:Key="TransparentListBoxItemStyle" BasedOn="{StaticResource MaterialDesignListBoxItem}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border Background="Transparent">
<ContentPresenter/>
</Border>
<ControlTemplate.Triggers>
<!-- Hover 배경 제거 -->
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Transparent"/>
</Trigger>
<!-- 선택 배경 제거 -->
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="Transparent"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.6"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SquareCheckToggleButtonStyle" TargetType="ToggleButton">
<!-- 기본 값들 -->
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Foreground" Value="#808890"/>
<!-- 기본 숫자색: 회색 -->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<StackPanel Orientation="Horizontal"
VerticalAlignment="Center">
<!-- 네모 체크박스 부분 -->
<Border x:Name="CheckBoxBorder"
Width="18"
Height="18"
Margin="0,0,4,0"
Background="Transparent"
BorderBrush="#294A63"
BorderThickness="1.5">
<!-- 체크 표시 -->
<Path x:Name="CheckMark"
Stroke="White"
StrokeThickness="2"
Data="M3,9 L7,13 L14,4"
Stretch="Uniform"
SnapsToDevicePixels="True"
Visibility="Collapsed"/>
</Border>
<!-- 숫자(컨텐츠) -->
<ContentPresenter x:Name="contentPresenter"
VerticalAlignment="Center"
TextElement.Foreground="{TemplateBinding Foreground}"/>
</StackPanel>
<ControlTemplate.Triggers>
<!-- 체크 되었을 때 -->
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="CheckBoxBorder"
Property="Background"
Value="#28567A"/>
<!-- 파란 배경 -->
<Setter TargetName="CheckBoxBorder"
Property="BorderBrush"
Value="#28567A"/>
<Setter TargetName="CheckMark"
Property="Visibility"
Value="Visible"/>
<Setter Property="Foreground" Value="White"/>
<!-- 숫자 흰색 -->
</Trigger>
<!-- 마우스 오버 효과 약간 -->
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="CheckBoxBorder"
Property="BorderBrush"
Value="#3A6C90"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save