feat: 에너지 화면 그래프 섹션 여닫기 기능 추가

prototype
HyungJune Kim 7 months ago
parent ad4cbf4fea
commit 18b7a31ee7

@ -237,6 +237,48 @@
</Setter> </Setter>
</Style> </Style>
<Style x:Key="VerticalTrapezoidButtonStyle" TargetType="Button">
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Width" Value="30"/>
<Setter Property="Height" Value="92"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid>
<!-- 🔷 사다리꼴(위 좁고 아래 넓음) -->
<!-- (20,0) (120,0)
\ /
(0,50) (140,50) -->
<Polygon x:Name="shape"
Fill="#1D3649"
Points="0,85.6111 30,92 30,0 0,6.38889" />
<!-- 내용 -->
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="0"/>
</Grid>
<!-- 🔷 버튼 상태 -->
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="shape" Property="Fill" Value="#264A63"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="shape" Property="Fill" Value="#162938"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="shape" Property="Fill" Value="#555"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<SolidColorBrush x:Key="LineComboBg" Color="#1D3649" /> <SolidColorBrush x:Key="LineComboBg" Color="#1D3649" />
<!-- 바 전체 배경 --> <!-- 바 전체 배경 -->
<SolidColorBrush x:Key="LineComboText" Color="#999999" /> <SolidColorBrush x:Key="LineComboText" Color="#999999" />

@ -86,7 +86,7 @@
</UniformGrid> </UniformGrid>
</Border> </Border>
<md:DrawerHost Grid.Row="1" RightDrawerBackground="Transparent" IsRightDrawerOpen="True" OpenMode="Standard"> <md:DrawerHost Grid.Row="1" RightDrawerBackground="Transparent" IsRightDrawerOpen="{Binding IsOpenMode}" OpenMode="Standard">
<Border BorderBrush="#1D3649" BorderThickness="0 0 2 0"> <Border BorderBrush="#1D3649" BorderThickness="0 0 2 0">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
@ -243,6 +243,28 @@
</Button> </Button>
</StackPanel> </StackPanel>
</Grid> </Grid>
<Grid Grid.Column="1">
<Button Name="btnVisibilityDown" Tag="right"
Style="{StaticResource VerticalTrapezoidButtonStyle}" Command="{Binding ChangeDrawerStatusCommand}"
VerticalAlignment="Top" HorizontalAlignment="Left" Visibility="{Binding BtnVisibilityRight}">
<Path Data="M13.0607 12.1111L8.11067 17.0611L9.52467 18.4751L15.8887 12.1111L9.52467 5.7471L8.11067 7.1611L13.0607 12.1111Z"
Fill="White" Stretch="Uniform"
Width="7.78" Height="12.728"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Button>
<Button Name="btnVisibilityUp" Tag="left"
Style="{StaticResource VerticalTrapezoidButtonStyle}" Command="{Binding ChangeDrawerStatusCommand}"
VerticalAlignment="Top" HorizontalAlignment="Left" Visibility="{Binding BtnVisibilityLeft}">
<Path Data="M11.1615 12.1111 L16.11153 17.0611 L14.69753 18.4751 L8.3335 12.1111 L14.69753 5.7471 L16.11153 7.1611 Z"
Fill="White" Stretch="Uniform"
Width="7.78" Height="12.728"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Button>
</Grid>
</Grid> </Grid>
</Border> </Border>
<md:DrawerHost.RightDrawerContent> <md:DrawerHost.RightDrawerContent>
@ -430,8 +452,7 @@
<StackPanel Orientation="Horizontal" Margin="24 0 0 0" Grid.Row="1"> <StackPanel Orientation="Horizontal" Margin="24 0 0 0" Grid.Row="1">
<CheckBox IsChecked="{Binding ShowMarkers}" Margin="0 0 12 0" <CheckBox IsChecked="{Binding ShowMarkers}" Margin="0 0 12 0"
Foreground="#264A60" Foreground="#264A60">
VerticalContentAlignment="Center">
<CheckBox.Style> <CheckBox.Style>
<Style TargetType="CheckBox" BasedOn="{StaticResource SquareCheckToggleButtonStyle}"> <Style TargetType="CheckBox" BasedOn="{StaticResource SquareCheckToggleButtonStyle}">
<Setter Property="Visibility" Value="Collapsed"/> <Setter Property="Visibility" Value="Collapsed"/>
@ -448,8 +469,7 @@
<TextBlock Text="마커" Style="{StaticResource CheckBoxContentTextBlockStyle}"/> <TextBlock Text="마커" Style="{StaticResource CheckBoxContentTextBlockStyle}"/>
</CheckBox> </CheckBox>
<CheckBox IsChecked="{Binding ShowLegends}" Margin="0 0 12 0" <CheckBox IsChecked="{Binding ShowLegends}" Margin="0 0 12 0"
Foreground="#264A60" Foreground="#264A60">
VerticalContentAlignment="Center">
<CheckBox.Style> <CheckBox.Style>
<Style TargetType="CheckBox" BasedOn="{StaticResource SquareCheckToggleButtonStyle}"> <Style TargetType="CheckBox" BasedOn="{StaticResource SquareCheckToggleButtonStyle}">
<Setter Property="Visibility" Value="Collapsed"/> <Setter Property="Visibility" Value="Collapsed"/>
@ -482,7 +502,8 @@
</CheckBox> </CheckBox>
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" Margin="15 0" Grid.Row="1" HorizontalAlignment="Right"> <StackPanel Orientation="Horizontal" Grid.Row="1"
HorizontalAlignment="Right" Margin="0 0 24 24">
<Button Content="그래프 생성" <Button Content="그래프 생성"
Style="{StaticResource GraphButtonStyle}" Style="{StaticResource GraphButtonStyle}"
Command="{Binding DrawGraphCommand}"/> Command="{Binding DrawGraphCommand}"/>
@ -501,9 +522,6 @@
</Border> </Border>
</md:DrawerHost.RightDrawerContent> </md:DrawerHost.RightDrawerContent>
</md:DrawerHost> </md:DrawerHost>
</Grid> </Grid>
</Border> </Border>
</UserControl> </UserControl>

@ -2,6 +2,7 @@
using System.Collections.Specialized; using System.Collections.Specialized;
using System.ComponentModel; using System.ComponentModel;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Input; using System.Windows.Input;
using SmartAquaViewer.Controls; using SmartAquaViewer.Controls;
using SmartAquaViewer.DataAnalysis; using SmartAquaViewer.DataAnalysis;
@ -196,6 +197,51 @@ namespace SmartAquaViewer.ViewModel
} }
} }
private bool _isOpenMode;
public bool IsOpenMode
{
get => _isOpenMode;
set
{
if (_isOpenMode != value)
{
_isOpenMode = value;
OnPropertyChanged();
_btnVisibilityRight = _isOpenMode ? Visibility.Visible : Visibility.Collapsed;
BtnVisibilityLeft = _isOpenMode ? Visibility.Collapsed : Visibility.Visible;
}
}
}
private Visibility _btnVisibilityRight;
public Visibility BtnVisibilityRight
{
get => _btnVisibilityRight;
set
{
if (_btnVisibilityRight != value)
{
_btnVisibilityRight = value;
OnPropertyChanged();
}
}
}
private Visibility _btnVisibilityLeft;
public Visibility BtnVisibilityLeft
{
get => _btnVisibilityLeft;
set
{
if (_btnVisibilityLeft != value)
{
_btnVisibilityLeft = value;
OnPropertyChanged();
}
}
}
public bool ShowXSelector => SelectedGraphType == GraphType.SCATTER; public bool ShowXSelector => SelectedGraphType == GraphType.SCATTER;
// [필드 후보 목록] 탭/시스템에 따라 달라짐 // [필드 후보 목록] 탭/시스템에 따라 달라짐
@ -236,11 +282,15 @@ namespace SmartAquaViewer.ViewModel
private bool _isDonut; private bool _isDonut;
public bool IsDonut { get => _isDonut; set { _isDonut = value; OnPropertyChanged(); } } public bool IsDonut { get => _isDonut; set { _isDonut = value; OnPropertyChanged(); } }
public ICommand ChangeDrawerStatusCommand { get; }
public ICommand DrawGraphCommand { get; } public ICommand DrawGraphCommand { get; }
public EnergyViewModel() public EnergyViewModel()
{ {
IsOpenMode = true;
BtnVisibilityLeft = Visibility.Collapsed;
GraphTypes = new ObservableCollection<GraphType> GraphTypes = new ObservableCollection<GraphType>
{ {
GraphType.LINE, GraphType.LINE,
@ -257,6 +307,7 @@ namespace SmartAquaViewer.ViewModel
SelectedKind = StepFieldKind.Energy; // 기본적으로 에너지 관련 필드만 표시 SelectedKind = StepFieldKind.Energy; // 기본적으로 에너지 관련 필드만 표시
ChangeDrawerStatusCommand = new RelayCommand(_ => IsOpenMode = !IsOpenMode);
DrawGraphCommand = new RelayCommand(DrawGraph); DrawGraphCommand = new RelayCommand(DrawGraph);
RebuildAvailableFields(); RebuildAvailableFields();

Loading…
Cancel
Save