source: trunk/CrypPlugins/FrequencyTest/FrequencyTestPresentation.xaml.cs @ 738

Last change on this file since 738 was 738, checked in by Arno Wacker, 12 years ago
  • Fixed autozoom feature of frequency test; finally seems to work in all cases - this closes #97, after all it was not an editor bug, but a missing "Stretch" in the FrequencyTest-presentation.
  • Removed the zoom-slider from presentation. Zoom/Scale is now accessible only in the settings (usually not needed, since autozoom is default)
  • Re-introduced ProgressChanged (faked, it just become fully green when done)
  • Changed Background to LightYellow in Run-mode and LightGray when stopped. This way it does not interfere with the progress-green.
  • Updated samples using FrequencyTest to avoid loading warnings.
File size: 2.1 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows;
6using System.Windows.Controls;
7using System.Windows.Data;
8using System.Windows.Documents;
9using System.Windows.Input;
10using System.Windows.Media;
11using System.Windows.Media.Imaging;
12using System.Windows.Navigation;
13using System.Windows.Shapes;
14using System.Threading;
15using System.Windows.Automation.Provider;
16using System.Windows.Automation.Peers;
17using Cryptool.FrequencyTest;
18using System.Windows.Threading;
19namespace Cryptool.FrequencyTest
20{
21    /// <summary>
22    /// Interaction logic for FrequencyTestPresentation.xaml
23    /// </summary>
24    public partial class FrequencyTestPresentation : UserControl
25    {
26
27        public  FrequencyTestPresentation()
28        {
29           InitializeComponent();
30        }
31
32
33        public void ShowData(DataSource data)
34        {
35            Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
36            {
37                DataSource source = (DataSource)this.Resources["source"];
38                source.ValueCollection.Clear();
39                for (int i = 0; i < data.ValueCollection.Count; i++)
40                {
41                    source.ValueCollection.Add(data.ValueCollection[i]);
42                }               
43            }, null);
44        }
45
46
47        public void SetHeadline(string text)
48        {
49            Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
50            {
51                chartHeadline.Text = text;
52            }, null);
53        }
54
55        public void SetScaler(double value)
56        {
57            Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
58            {
59                chart.LayoutTransform = new ScaleTransform(value, value);
60            }, null);
61        }
62
63        public void SetBackground(Brush brush)
64        {
65            Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
66            {
67                chart.Background = brush;
68            }, null);
69        }
70
71    }
72}
Note: See TracBrowser for help on using the repository browser.