Pārlūkot izejas kodu

Data Entry list now uses a zoom panel

Kenric Nugteren 1 gadu atpakaļ
vecāks
revīzija
9806f22745

+ 4 - 3
prs.desktop/Panels/DataEntry/DataEntryList.xaml

@@ -6,6 +6,7 @@
              xmlns:local="clr-namespace:PRSDesktop"
              xmlns:sf="http://schemas.syncfusion.com/wpf"
              xmlns:dynamic="clr-namespace:InABox.DynamicGrid;assembly=InABox.Wpf"
+             xmlns:wpf="clr-namespace:InABox.Wpf;assembly=InABox.Wpf"
              mc:Ignorable="d" 
              d:DesignHeight="450" d:DesignWidth="800"
              x:Name="Control"
@@ -61,7 +62,7 @@
                             AllowDrop="True"
                             DragOver="DynamicTabItem_DragOver"
                             Drop="DynamicTabItem_Drop">
-                        <ScrollViewer x:Name="ViewListPanel" VerticalScrollBarVisibility="Auto">
+                        <wpf:ZoomPanel x:Name="ZoomPanel">
                             <ItemsControl Margin="10" ItemsSource="{Binding ViewList}">
                                 <ItemsControl.ItemsPanel>
                                     <ItemsPanelTemplate>
@@ -80,12 +81,12 @@
                                 </ItemsControl.ContextMenu>
                                 <ItemsControl.ItemTemplate>
                                     <DataTemplate DataType="ImageSource">
-                                        <Image Source="{Binding}" Margin="0,0,0,20" ContextMenu="{Binding RelativeSource={RelativeSource AncestorType=ItemsControl,Mode=FindAncestor},Path=ContextMenu}"
+                                        <Image Source="{Binding}" Margin="0,0,0,20" ContextMenu="{Binding RelativeSource={RelativeSource            AncestorType=ItemsControl,Mode=FindAncestor},Path=ContextMenu}"
                                                MouseLeftButtonDown="Image_MouseLeftButtonDown"/>
                                     </DataTemplate>
                                 </ItemsControl.ItemTemplate>
                             </ItemsControl>
-                        </ScrollViewer>
+                        </wpf:ZoomPanel>
                     </Border>
                 </Grid>
             </dynamic:DynamicTabItem>

+ 3 - 2
prs.desktop/Panels/DataEntry/DataEntryList.xaml.cs

@@ -22,7 +22,6 @@ using Path = System.IO.Path;
 using Image = System.Windows.Controls.Image;
 using System.ComponentModel;
 using System.Windows.Controls;
-using System.Windows.Forms;
 using Clipboard = System.Windows.Clipboard;
 using DataFormats = System.Windows.DataFormats;
 using DragDropEffects = System.Windows.DragDropEffects;
@@ -34,6 +33,8 @@ using System.Collections.ObjectModel;
 using System.Windows.Data;
 using PRSDesktop.Panels.DataEntry;
 using InABox.Wpf.Editors;
+using System.Timers;
+using Microsoft.Win32;
 
 namespace PRSDesktop;
 
@@ -498,7 +499,7 @@ public partial class DataEntryList : UserControl, ICorePanel, IDockPanel
             Title = @"Select Files to Upload",
             InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
         };
-        if (ofd.ShowDialog() == DialogResult.OK)
+        if (ofd.ShowDialog() == true)
         {
             foreach (var file in ofd.FileNames)
                 Upload(