-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
150 lines (143 loc) · 9.08 KB
/
Copy pathMainWindow.xaml
File metadata and controls
150 lines (143 loc) · 9.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<Window x:Class="AsusFanControl.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:AsusFanControl"
xmlns:inf="clr-namespace:AsusFanControl.Infrastructure"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:tb="clr-namespace:H.NotifyIcon;assembly=H.NotifyIcon.Wpf"
Style="{StaticResource MaterialDesignWindow}"
mc:Ignorable="d" StateChanged="Window_StateChanged"
Title="Asus Fan Control" Height="450" Width="800" MinWidth="1280" MinHeight="720" WindowStartupLocation="CenterScreen" Icon="/thermometer.ico">
<Window.Resources>
<Style x:Key="InfoLabelStyle" TargetType="Label">
<Setter Property="FontSize" Value="16"/>
<Setter Property="Margin" Value="0 0 10 0"/>
</Style>
<inf:EnumToIntConverter x:Key="EnumToIntConverter" />
</Window.Resources>
<Grid Background="#ffdadada">
<tb:TaskbarIcon x:Name="SystemTrayIcon"
ToolTipText="AsusFanControl"
IconSource="/images/thermometer.ico"
MenuActivation="RightClick">
<tb:TaskbarIcon.ContextMenu>
<ContextMenu Width="155" FontSize="12" >
<ContextMenu.Resources>
<Style TargetType="ContextMenu">
<Setter Property="Padding" Value="0 5 0 5"/>
</Style>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="5"></Setter>
</Style>
<Style TargetType="MenuItem">
</Style>
</ContextMenu.Resources>
<MenuItem Click="MenuItem_Click" Header="Показать/Скрыть" />
<MenuItem Click="Button_Click_Closed" Header="Выйти" />
</ContextMenu>
</tb:TaskbarIcon.ContextMenu>
</tb:TaskbarIcon>
<Border MinWidth="800" Background="White"
Margin="15" Padding="30"
VerticalAlignment="Center"
MaxWidth="550" CornerRadius="16">
<Border.Effect>
<DropShadowEffect BlurRadius="30" Color="LightGray" ShadowDepth="0"/>
</Border.Effect>
<StackPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="Asus Fan Controller" FontSize="30" Margin="0 0 0 20"/>
<Label Content="Отображение датчиков:" Grid.Column="1" HorizontalAlignment="Center"></Label>
<ToggleButton Style="{StaticResource MaterialDesignSwitchToggleButton}" IsChecked="{Binding Setting.SensorInfoEnabled}"
Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Bottom" />
<Label Content="Ручной режим работы:" Grid.Column="2" HorizontalAlignment="Center"></Label>
<ToggleButton Style="{StaticResource MaterialDesignSwitchToggleButton}" Command="{Binding SwitchFanControlStateCommand}" IsChecked="{Binding Setting.FanAutoState}"
Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Bottom" />
<Border Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Bottom" Background="Transparent" MouseDown="ToggleButton_Click">
<materialDesign:PackIcon Kind="ArrowRight" Foreground="Gray" Width="62" Height="30" />
</Border>
<Canvas>
<ListBox Canvas.Left="730" Canvas.Top="30" Style="{StaticResource MaterialDesignToolVerticalToggleListBox}" Visibility="Collapsed" SelectionChanged="StatusModeListBox_Selected"
x:Name="StatusModeListBox" SelectedIndex="{Binding Setting.FanMode, Mode=TwoWay, Converter={StaticResource EnumToIntConverter }}" >
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Height" Value="75"/>
<Setter Property="Width" Value="75"/>
</Style>
</ListBox.ItemContainerStyle>
<ListBoxItem Style="{StaticResource MaterialDesignListBoxItem}" FontSize="16" Content="Мягкий режим"/>
<ListBoxItem Style="{StaticResource MaterialDesignListBoxItem}" FontSize="16" Content="Нормальный режим"/>
<ListBoxItem Style="{StaticResource MaterialDesignListBoxItem}" FontSize="16" Content="Агресивный режим"/>
</ListBox>
</Canvas>
</Grid>
<Grid Margin="0 0 0 20">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Label Content="Скорость кулера" Style="{StaticResource InfoLabelStyle}"/>
<Label Content="{Binding Path=FanSpeed}" Grid.Column="1" Style="{StaticResource InfoLabelStyle}" HorizontalAlignment="Right"/>
</Grid>
<Grid Margin="0 0 0 20">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Label Content="Температура процессора" Style="{StaticResource InfoLabelStyle}"/>
<Label Content="{Binding Path=TempProcessor}" Grid.Column="1" Style="{StaticResource InfoLabelStyle}" HorizontalAlignment="Right"/>
</Grid>
<Grid Margin="0 0 0 20">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Label Content="Выбрать график" Style="{StaticResource InfoLabelStyle}"/>
<ComboBox Style="{DynamicResource MaterialDesignFloatingHintComboBox}" SelectedItem="{Binding SelectedGraph}"
HorizontalContentAlignment="Stretch" ItemsSource="{Binding Graphs}" Grid.Column="1" >
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
<Grid Margin="0 0 0 20">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Label Content="Регулировка мощности кулеров" Style="{StaticResource InfoLabelStyle}" Grid.Row="0" />
<Label Content="{Binding FanPower}" Style="{StaticResource InfoLabelStyle}" Grid.Column="1" HorizontalAlignment="Right"/>
<Slider Grid.Row="1" Grid.ColumnSpan="2" Margin="0 10 0 0"
PreviewMouseUp="Slider_Complete"
PreviewKeyDown="Slider_PreviewKeyDown"
IsEnabled="{Binding Setting.FanAutoState}"
Value="{Binding FanPower}"
Maximum="100" SmallChange="1"/>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Button Margin="10" Content="Построение графиков" Click="Button_Click_Graph_Form"></Button>
<Button Margin="10" Grid.Column="1" Content="Сохранить настройки" Command="{Binding SaveSettingCommand}"></Button>
<Button Margin="10" Grid.Column="2" Style="{StaticResource MaterialDesignRaisedSecondaryButton}" Content="Закрыть" Click="Button_Click_Closed"></Button>
</Grid>
</StackPanel>
</Border>
</Grid>
</Window>