source: trunk/CrypPlugins/KeySearcher/Presentation/Controls/LocalQuickWatchPresentation.xaml.cs @ 1682

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

o Work on the distributed KeySearcher presentation

File size: 1.3 KB
Line 
1using System;
2using System.Windows.Media;
3using System.Collections.ObjectModel;
4using KeySearcher;
5
6namespace KeySearcherPresentation.Controls
7{   
8    public partial class LocalQuickWatchPresentation
9    {       
10        public ObservableCollection<ResultEntry> entries = new ObservableCollection<ResultEntry>();
11
12        public LocalQuickWatchPresentation()
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.