source: trunk/CrypPlugins/KeySearcher/Presentation/KeySearcherQuickWatchPresentation.xaml.cs @ 1674

Last change on this file since 1674 was 1674, checked in by Paul Lelgemann, 12 years ago

o Refactored distributed KeySearcher: updated directory structure and variable names

File size: 1.3 KB
Line 
1using System;
2using System.Windows.Controls;
3using System.Windows.Media;
4using System.Collections.ObjectModel;
5
6namespace KeySearcher.Presentation
7{   
8    public partial class KeySearcherQuickWatchPresentation : UserControl
9    {       
10        public ObservableCollection<ResultEntry> entries = new ObservableCollection<ResultEntry>();
11
12        public KeySearcherQuickWatchPresentation()
13        {
14            InitializeComponent();
15            SizeChanged += sizeChanged;
16            this.DataContext = entries;
17        }
18
19        public void sizeChanged(Object sender, EventArgs eventArgs)
20        {
21            double height = this.ActualHeight - this.Grid.ActualHeight;
22            if(height<0){
23                height=0;
24            }
25            this.ListView.Height = height;
26            this.ListView.Width = this.ActualWidth;
27
28            double heightTransform = (this.ActualHeight - height) / this.Grid.ActualHeight;
29            double widthTransform = this.ActualWidth / this.Grid.ActualWidth;
30
31            if (widthTransform > heightTransform)
32            {
33                widthTransform = heightTransform;
34            }
35               
36
37            this.Grid.RenderTransform = new ScaleTransform(widthTransform, heightTransform);
38        }
39    }
40}
Note: See TracBrowser for help on using the repository browser.