alielie
2025-08-25 c4a3f8db90530a727ffab77c3bb5bb7d782792bf
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
<UserControl x:Class="HMI.SettingControl.SystemConfig"
             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:HMI.SettingControl"
            xmlns:pw="https://opensource.panuon.com/wpf"
            xmlns:pu="https://opensource.panuon.com/wpf-ui"
             xmlns:uic="clr-namespace:HMI.UI.Converter;assembly=HMI.UI"
            mc:Ignorable="d" 
            Background="#FFF"
             Loaded="UserControl_Loaded"
            d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <pu:StyleDictionary Includes="TabControl" />
                <ResourceDictionary Source="/HMI.UI;component/Resources/Font/Font.xaml"/>
            </ResourceDictionary.MergedDictionaries>
 
            <uic:PathImageConverter x:Key="path2Image"/>
            <uic:DataGridRowNumberConverter x:Key="rowNumber"/>
        </ResourceDictionary>
    </UserControl.Resources>
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <GroupBox Header="{DynamicResource Setting.BasicSetting}" Padding="10">
            <StackPanel>
                <pu:FormGroup x:Name="FgIcon" Style="{StaticResource InputFormGroupStyle}" 
                              HeaderWidth="Auto"
                              Header="{DynamicResource Setting.Logo}" GroupName="MyFormGroup">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition Width="30" />
                        </Grid.ColumnDefinitions>
                        <TextBox x:Name="TbIcon" IsReadOnly="True" 
                                 Text="{Binding LogoPath}"
                                 FontFamily="{StaticResource iconfont}" Style="{StaticResource EditorTextBoxStyle}" />
                        <Button Grid.Column="1" BorderThickness="0,1,1,1" Style="{StaticResource SearchButton}"
                                x:Name="BtnIcon" Click="Button_Click"/>
                    </Grid>
                </pu:FormGroup>
 
                <pu:FormGroup Header="{DynamicResource Setting.Title}" HeaderWidth="Auto" GroupName="MyFormGroup">
                    <TextBox Text="{Binding WindowTitle}"/>
                </pu:FormGroup>
 
                <pu:FormGroup Header="{DynamicResource Setting.Lang}" HeaderWidth="Auto" GroupName="MyFormGroup">
                    <ComboBox x:Name="CbLang" Style="{StaticResource FormComboxStyle}" 
                              SelectedValue="{Binding CurrentLanguage}" SelectedValuePath="Code" DisplayMemberPath="Name"/>
                </pu:FormGroup>
 
                <pu:FormGroup Header="{DynamicResource Setting.LogExpiredDays}" HeaderWidth="Auto" GroupName="MyFormGroup">
                    <pu:NumberInput Interval="1" x:Name="NiLogExpiredDays" Style="{StaticResource FormNumberInput}" 
                                    Value="{Binding LogExpiredDays}"/>
                </pu:FormGroup>
            </StackPanel>
        </GroupBox>
 
        <GroupBox Grid.Row="1" Header="{DynamicResource Setting.PlcSetting}" Padding="10">
            <StackPanel>
                <pu:FormGroup Header="{DynamicResource Setting.PlcIp}" HeaderWidth="Auto" GroupName="MyFormGroup">
                    <TextBox Text="{Binding PlcIp}"/>
                </pu:FormGroup>
 
                <pu:FormGroup Header="{DynamicResource Setting.PlcEnabled}" HeaderWidth="Auto" GroupName="MyFormGroup">
                    <CheckBox IsChecked="{Binding PlcEnabled,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
                </pu:FormGroup>
            </StackPanel>
        </GroupBox>
    </Grid>
</UserControl>