Просмотр исходного кода

Create usercontrol to be able to loop through it

Ruben 4 лет назад
Родитель
Сommit
f1e2b9fd84

+ 50 - 0
PicView/Views/UserControls/Misc/ThumbnailOutputUC.xaml

@@ -0,0 +1,50 @@
+<UserControl
+    x:Class="PicView.Views.UserControls.ThumbnailOutputUC"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:uc="clr-namespace:PicView.Views.UserControls">
+
+    <UserControl.Resources>
+        <Style TargetType="TextBlock">
+            <Setter Property="FontFamily" Value="/PicView;component/Themes/Resources/fonts/#Roboto Medium" />
+            <Setter Property="Foreground" Value="{StaticResource MainColorBrush}" />
+            <Setter Property="Width" Value="130" />
+            <Setter Property="VerticalAlignment" Value="Center" />
+            <Setter Property="TextTrimming" Value="CharacterEllipsis" />
+            <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=Text}" />
+        </Style>
+    </UserControl.Resources>
+
+    <StackPanel>
+        <StackPanel Margin="15,3,0,5" Orientation="Horizontal">
+            <TextBlock x:Name="OutPutString" Width="170" />
+
+            <TextBox
+                x:Name="OutPutStringBox"
+                Width="260"
+                FontSize="11"
+                IsReadOnly="False" />
+            <uc:FolderButton x:Name="OutputFolderButton" />
+        </StackPanel>
+
+        <StackPanel Margin="15,3,0,6" Orientation="Horizontal">
+
+            <TextBlock Width="170" Text="{StaticResource Resize}" />
+
+            <StackPanel Orientation="Horizontal">
+
+                <ComboBox Width="130">
+                    <ComboBoxItem Content="{StaticResource Width}" />
+                    <ComboBoxItem Content="{StaticResource Height}" />
+                    <ComboBoxItem Content="Percentage" IsSelected="True" />
+                </ComboBox>
+                <TextBox
+                    x:Name="ValueBox"
+                    Width="115"
+                    Margin="15,0,0,0"
+                    IsReadOnly="False"
+                    Text="80" />
+            </StackPanel>
+        </StackPanel>
+    </StackPanel>
+</UserControl>

+ 28 - 0
PicView/Views/UserControls/Misc/ThumbnailOutputUC.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PicView.Views.UserControls
+{
+    public partial class ThumbnailOutputUC : UserControl
+    {
+        public ThumbnailOutputUC(int i, string folderPath, string filename)
+        {
+            InitializeComponent();
+
+            OutPutString.Text = $"Thumbnail {i} output folder";
+            OutPutStringBox.Text = folderPath + @"\" + filename;
+         }
+    }
+}