Ejemplo n.º 1
0
        protected FrameworkElement CreateProgressTab()
        {
            var timeElapsedLabel = new Label();

            TimeElapsedLabel = timeElapsedLabel;

            var timeRemaining = new Label();

            TimeRemainingLabel = timeRemaining;

            var averageSpeed = new Label();

            AverageSpeedLabel = averageSpeed;

            var currentSpeed = new Label();

            CurrentSpeedLabel = currentSpeed;

            var frameIndex = new Label();

            FrameIndexLabel = frameIndex;

            var progressPanelList = new List <Tuple <FrameworkElement, FrameworkElement> >();

            progressPanelList.Add(Tuple.Create <FrameworkElement, FrameworkElement>(new Label {
                Content = "Time Elapsed"
            }, timeElapsedLabel));
            progressPanelList.Add(Tuple.Create <FrameworkElement, FrameworkElement>(new Label {
                Content = "Time Remaining"
            }, timeRemaining));
            progressPanelList.Add(Tuple.Create <FrameworkElement, FrameworkElement>(new Label {
                Content = "Average Speed"
            }, averageSpeed));
            progressPanelList.Add(Tuple.Create <FrameworkElement, FrameworkElement>(new Label {
                Content = "Current Speed"
            }, currentSpeed));
            progressPanelList.Add(Tuple.Create <FrameworkElement, FrameworkElement>(new Label {
                Content = "Frame Index"
            }, frameIndex));
            var progressPanel = WpfHelper.CreateDualColumnPanel(progressPanelList, 100, 1, 5);

            var groupBox = new GroupBox();

            groupBox.HorizontalAlignment = HorizontalAlignment.Left;
            groupBox.VerticalAlignment   = VerticalAlignment.Top;
            groupBox.Margin  = new Thickness(5);
            groupBox.Header  = "Progress";
            groupBox.Content = progressPanel;

            return(groupBox);
        }
Ejemplo n.º 2
0
        protected void ShowAboutWindow()
        {
            var textPanelList = new List <Tuple <FrameworkElement, FrameworkElement> >();

            textPanelList.Add(WpfHelper.CreateTuple("Version", AppVersion));
            textPanelList.Add(WpfHelper.CreateTuple("Developer", "myT"));
            var textPanel = WpfHelper.CreateDualColumnPanel(textPanelList, 100, 1);

            var image = new System.Windows.Controls.Image();

            image.HorizontalAlignment = HorizontalAlignment.Right;
            image.VerticalAlignment   = VerticalAlignment.Top;
            image.Margin  = new Thickness(5);
            image.Stretch = Stretch.None;
            image.Source  = AboutIcon.ToImageSource();

            var rootPanel = new StackPanel();

            rootPanel.HorizontalAlignment = HorizontalAlignment.Stretch;
            rootPanel.VerticalAlignment   = VerticalAlignment.Stretch;
            rootPanel.Margin      = new Thickness(5);
            rootPanel.Orientation = Orientation.Horizontal;
            rootPanel.Children.Add(textPanel);
            rootPanel.Children.Add(image);

            var window = new Window();

            window.WindowStyle   = WindowStyle.ToolWindow;
            window.ResizeMode    = ResizeMode.NoResize;
            window.Background    = new SolidColorBrush(System.Windows.SystemColors.ControlColor);
            window.ShowInTaskbar = false;
            window.Title         = "About UberMmeMuxer";
            window.Content       = rootPanel;
            window.Width         = 240;
            window.Height        = 100;
            window.Left          = MainWindow.Left + (MainWindow.Width - window.Width) / 2;
            window.Top           = MainWindow.Top + (MainWindow.Height - window.Height) / 2;
            window.Icon          = AboutIcon.ToImageSource();
            window.ShowDialog();
        }