Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ToolLayerImportControl.axaml « Tools « Controls « UVtools.WPF - github.com/sn4k3/UVtools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b15be078e5fbd6aa5d877046749e3fdeee816a1c (plain)
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
<UserControl xmlns="https://github.com/avaloniaui"
             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:controls="clr-namespace:UVtools.WPF.Controls"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
             x:Class="UVtools.WPF.Controls.Tools.ToolLayerImportControl">

  <StackPanel Spacing="10">
    <Grid RowDefinitions="Auto,10,Auto,10,Auto,10,Auto"
          ColumnDefinitions="Auto,10,180,5,Auto,20,Auto">

      <TextBlock Grid.Row="0" Grid.Column="0"
          VerticalAlignment="Center"
          ToolTip.Tip="Insert: Requires images with bounds equal or less than file resolution
&#x0a;Replace: Requires images with bounds equal or less than file resolution
&#x0a;Stack: Requires images with bounds equal or less than file resolution
&#x0a;Merge: Requires images with same resolution
&#x0a;MergeMax: Requires images with same resolution
&#x0a;Subtract: Requires images with same resolution
&#x0a;AbsDiff: Requires images with same resolution
&#x0a;BitwiseAnd: Requires images with same resolution
&#x0a;BitwiseOr: Requires images with same resolution
&#x0a;BitwiseXOr: Requires images with same resolution"
          Text="Import type:"/>

      <ComboBox Grid.Row="0" Grid.Column="2"
                 VerticalAlignment="Center"
                 HorizontalAlignment="Stretch"
                 Items="{Binding Operation.ImportType, Converter={StaticResource EnumToCollectionConverter}, Mode=OneTime}"
                 SelectedItem="{Binding Operation.ImportType, Converter={StaticResource FromValueDescriptionToEnumConverter}}"/>

      <TextBlock Grid.Row="0" Grid.Column="4"
                 VerticalAlignment="Center"
                 Text="layers"/>

      <CheckBox Grid.Row="0" Grid.Column="6"
                IsChecked="{Binding Operation.ExtendBeyondLayerCount}"
                IsVisible="{Binding Operation.IsExtendBeyondLayerCountVisible}"
                ToolTip.Tip="If enabled, imported images that go beyond last layer are appended. The file will grow in layer count if necessary to fit all imported layers.
&#x0a;If disabled, all imported images that go beyond last layer are discarded. The file will maintain same layer count."
                Content="Extend beyond layer count"/>

      <TextBlock Grid.Row="2" Grid.Column="0"
                             VerticalAlignment="Center"
                             Text="Start at layer:"/>
      <NumericUpDown Grid.Row="2" Grid.Column="2"
                     Classes="ValueLabel ValueLabel_layers"
                     Minimum="0"
                     Maximum="{Binding MaximumLayer}"
                     Value="{Binding Operation.StartLayerIndex}"/>
      <TextBlock Grid.Row="2" Grid.Column="4"
                 VerticalAlignment="Center"
                 Text="{Binding InfoLayerHeightStr}"/>

      <CheckBox Grid.Row="4" Grid.Column="2" Grid.ColumnSpan="5"
                IsChecked="{Binding Operation.DiscardUnmodifiedLayers}"
                ToolTip.Tip="If enabled, all unmodified layers forward the last inserted layer are discarded.
&#x0a;If disabled, the unmodified layers are kept."
                Content="Discard unmodified layers"/>

      <TextBlock Grid.Row="6" Grid.Column="0"
                 VerticalAlignment="Center"
                 IsVisible="{Binding Operation.IsImportStackType}"
                 Text="Stack margin:"/>
      <NumericUpDown Grid.Row="6" Grid.Column="2"
                     Classes="ValueLabel ValueLabel_px"
                     IsVisible="{Binding Operation.IsImportStackType}"
                     Minimum="0"
                     Maximum="65535"
                     Value="{Binding Operation.StackMargin}"/>
    </Grid>


    <CheckBox
      IsChecked="{Binding IsAutoSortLayersByFileNameChecked}"
      Content="Auto sort files by filename"/>


    <TextBlock Text="{Binding InfoImportResult}" />


    <Border BorderBrush="Gray" BorderThickness="1" Padding="5">
      <Grid>
        <StackPanel Spacing="5" Orientation="Horizontal">
          <controls:ButtonWithIcon Padding="5" 
                                   Command="{Binding AddFiles}"
                                   Text="Add"
                                   Spacing="5"
                                   Icon="fa-solid fa-plus"/>

          <controls:ButtonWithIcon Padding="5"
                                   IsEnabled="{Binding #FilesListBox.SelectedItems.Count}"
                                   Command="{Binding RemoveFiles}"
                                   Text="Remove"
                                   Spacing="5"
                                   Icon="fa-solid fa-minus"/>
        </StackPanel>

        <StackPanel
          HorizontalAlignment="Right"
          Spacing="5" Orientation="Horizontal">
          <controls:ButtonWithIcon Padding="5" 
                  IsEnabled="{Binding Operation.Files.Count}"
                  Command="{Binding Operation.Sort}"
                  Text="Sort by file name"
                  Spacing="5"
                  Icon="fa-solid fa-sort-alpha-up"/>

          <controls:ButtonWithIcon
            IsEnabled="{Binding Operation.Files.Count}"
            Padding="5" Command="{Binding ClearFiles}"
            Text="Clear"
            Spacing="5"
            Icon="fa-solid fa-xmark"/>

          <TextBlock
            VerticalAlignment="Center"
            Text="{Binding Operation.Files.Count, StringFormat=Files: {0}}"/>
        </StackPanel>
      </Grid>
    </Border>

    <Grid
      ColumnDefinitions="400,400"
      RowDefinitions="400"
      >
      <ListBox
        Name="FilesListBox"
        SelectionMode="Multiple"
        SelectedItem="{Binding SelectedFile}"
        Items="{Binding Operation.Files}" />

      <Image 
        Grid.Column="1"
        Stretch="Uniform"
        Source="{Binding PreviewImage}"/>
    </Grid>
    
    
  </StackPanel>

  
  
</UserControl>