Esempio n. 1
0
        void SetUp()
        {
            Application.Current.Dispatcher.Invoke((Action) delegate
            {
                var _grid = new Grid
                {
                    VerticalAlignment   = System.Windows.VerticalAlignment.Stretch,
                    HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch,
                    Width  = OverlayWindow.Width,
                    Height = OverlayWindow.Height
                };

                _label = new Label
                {
                    FontSize            = 28,
                    Foreground          = Brushes.Red,
                    Background          = (Brush)Application.Current.FindResource("OverlayLabelBG"),
                    Content             = Application.Current.FindResource("m_AlertWindow"),
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Center,
                };
                _grid.Children.Add(_label);
                OverlayWindow.Add(_grid);
            });
        }
Esempio n. 2
0
        private void SetUp()
        {
            var button = new Image
            {
                Margin = new Thickness(0, 0, 0, 0),
                Width  = 50,
                Height = 50,
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment   = VerticalAlignment.Stretch,
                Source = Properties.Resources.close2.ToImageSource()
            };

            OverlayWindow.Add(button);
            #region shapes
            //var _polygon = new Polygon
            //{
            //    Points = new PointCollection(5) {
            //        new Point(100, 150),
            //        new Point(120, 130),
            //        new Point(140, 150),
            //        new Point(140, 200),
            //        new Point(100, 200)
            //    },
            //    Stroke = new SolidColorBrush(Color.FromRgb(0, 0, 255)),
            //    Fill =
            //        new RadialGradientBrush(
            //            Color.FromRgb(255, 255, 0),
            //            Color.FromRgb(255, 0, 255))
            //};

            //OverlayWindow.Add(_polygon);

            //// Create a line
            //_line = new Line
            //{
            //    X1 = 100,
            //    X2 = 300,
            //    Y1 = 200,
            //    Y2 = 200,
            //    Stroke = new SolidColorBrush(Color.FromRgb(0, 255, 0)),
            //    StrokeThickness = 2
            //};

            //OverlayWindow.Add(_line);

            //// Create an ellipse (circle)
            //_ellipse = new Ellipse
            //{
            //    Width = 15,
            //    Height = 15,
            //    Margin = new Thickness(300, 300, 0, 0),
            //    Stroke =
            //        new SolidColorBrush(Color.FromRgb(0, 255, 255))
            //};

            ////OverlayWindow.Add(_ellipse);

            //// Create a rectangle
            //_rectangle = new Rectangle
            //{
            //    RadiusX = 2,
            //    RadiusY = 2,
            //    Width = 50,
            //    Height = 100,
            //    Margin = new Thickness(400, 400, 0, 0),
            //    Stroke = new SolidColorBrush(Color.FromRgb(255, 0, 0)),
            //    Fill =
            //        new SolidColorBrush(Color.FromArgb(100, 255, 255,
            //            255))
            //};

            ////OverlayWindow.Add(_rectangle);
            #endregion
        }