Example #1
0
        public FloatingWindow AddDisplay(UIElement display, string title = "", Rect?bounds = null, bool visible = true, object tag = null)
        {
            FloatingWindow window = new FloatingWindow()
            {
                Content  = display,
                Tag      = tag,
                Title    = title,
                IconText = title
            };

            host.Add(window);

            if (bounds.HasValue)
            {
                window.Width  = bounds.Value.Width;
                window.Height = bounds.Value.Height;
                window.Show(bounds.Value.TopLeft.X, bounds.Value.TopLeft.Y);
            }
            else
            {
                window.Show(100, 100);
            }

            if (!visible)
            {
                window.MinimizeWindow();
            }

            return(window);
        }
Example #2
0
        private void ShowNewWindow(bool withIcon)
        {
            FloatingWindow window = (withIcon)? new WindowWithIcon() : new FloatingWindow();

            if (Application.Current.Host.Settings.EnableGPUAcceleration) //GPU acceleration can been turned on at HTML/ASPX page or at OOB settings for OOB apps
            {
                window.CacheMode = new BitmapCache();                    //must do this before setting the "Scale" property, since it will set "RenderAtScale" property of the BitmapCache
            }
            window.Scale = 1d / host.ZoomHost.ContentScale;              //TODO: !!! don't use host.ContentScale, has bug and is always 1

            string title = "Window " + nWindows++;

            window.Title    = title;
            window.IconText = title;

            window.Activated        += (s, a) => Debug.WriteLine("Activated: {0}", window.IconText);
            window.Deactivated      += (s, a) => Debug.WriteLine("Deactivated: {0}", window.IconText);
            window.HelpRequested    += (s, a) => { Debug.WriteLine("Help button pressed"); MessageBox.Show("Help..."); };
            window.OptionsRequested += (s, a) => { Debug.WriteLine("Options button pressed"); MessageBox.Show("Options..."); };

            host.Add(window);

            //Point startPoint = new Point(host.ZoomHost.ContentOffsetX + host.ZoomHost.ContentViewportWidth / 2, host.ZoomHost.ContentOffsetY + host.ZoomHost.ContentViewportHeight / 2); //Center at current view
            //window.Show(startPoint, true);

            window.Show(); //show centered
        }
Example #3
0
        private void ShowPreviewWindow()
        {
            if (previewWindow != null)
            {
                HidePreviewWindow();
            }

            FrameworkElement element;
            Size             size;

            if (this.IsComponent)
            {
                element = CreateComponentElement();

                size = new Size(double.NaN, double.NaN);
            }
            else
            {
                // Content Copy
                element = XamlReader.Parse(XamlWriter.Save(contentPresenter.Content)) as FrameworkElement;

                size = contentPresenter.RenderSize;
            }

            previewWindow = new FloatingWindow(element, size.Width, size.Height);

            UpdatePreviewWindow();

            previewWindow.Show();
        }
Example #4
0
        public MainPage()
        {
            InitializeComponent();

            FloatingWindow window = new FloatingWindow();

            window.Title    = "Centered Window";
            window.IconText = "Centered Window";
            host.Add(window);
            window.Show();
        }
Example #5
0
        public void Execute(object parameter)
        {
            if (!string.IsNullOrWhiteSpace(StyleName) && AttachmentEditorStyle == null)
            {
                return;
            }

            FeatureLayer layer = GetFeatureLayer(parameter);

            if (layer == null)
            {
                return;
            }

            Graphic graphic = layer.SelectedGraphics != null?layer.SelectedGraphics.ElementAt(0) : null;

            if (graphic == null)
            {
                return;
            }

            if (_configuration == null)
            {
                _configuration = new AttachmentEditorConfiguration();
            }

            if (_attachmentEditor == null)
            {
                _attachmentEditor             = new AttachmentEditor();
                _attachmentEditor.Width       = _configuration.Width;
                _attachmentEditor.Height      = _configuration.Height;
                _attachmentEditor.FilterIndex = _configuration.FilterIndex;
                _attachmentEditor.Filter      = _configuration.Filter;
                _attachmentEditor.Multiselect = _configuration.MultiSelect;
                if (AttachmentEditorStyle != null)
                {
                    _attachmentEditor.Style = AttachmentEditorStyle;
                }

                _window         = new FloatingWindow();
                _window.Content = _attachmentEditor;
                _window.Title   = Resources.Strings.AttachmentEditorHeader;
            }

            _attachmentEditor.DataContext   = _configuration;
            _attachmentEditor.GraphicSource = null;
            _attachmentEditor.FeatureLayer  = null;
            if (graphic != null)
            {
                _attachmentEditor.FeatureLayer  = layer;
                _attachmentEditor.GraphicSource = graphic;
                _window.Show(true);
            }
        }
Example #6
0
        private void CreateNewDAWindow()
        {
            //  MainWindow.RadTabbedWindow_CreateNewTab(new DeliveryAdviceSingleView(Logistics, null), "DA: " );
            if (_mywindow == null)
            {
                _mywindow          = new FloatingWindow();
                _mywindow.IsClosed = true;
            }
            else
            {
                _mywindow.grd_Layoutroot.Children.Clear();
            }

            _mywindow.grd_Layoutroot.Children.Add(new DeliveryAdviceSingleView(Logistics, null));

            if (_mywindow.IsClosed == true)
            {
                _mywindow.Show();
            }
        }
        public MainPage()
        {
            InitializeComponent();

            FloatingWindow window = new FloatingWindow(); //can also create floating windows directly in the XAML (see MainPage.xaml)

            window.Title    = "Centered Window";
            window.IconText = "Centered Window";
            host.Add(window);
            window.Show();
        }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (floatingWindow == null)
     {
         floatingWindow         = new FloatingWindow();
         floatingWindow.Owner   = this;
         floatingWindow.Closed += FloatingWindow_Closed;
     }
     floatingWindow.Show();
     floatingWindow.Activate();
 }
        public MainWindow()
        {
            InitializeComponent();

            this.Width  = System.Windows.SystemParameters.WorkArea.Width - 200;
            this.Height = System.Windows.SystemParameters.WorkArea.Height - 200;

            FloatingWindow window = new FloatingWindow();

            window.Title    = "Centered Window";
            window.IconText = "Centered Window";
            host.Add(window);
            window.Show();
        }
        private void ShowNewWindow_Click(object sender, RoutedEventArgs e)
        {
            FloatingWindow window = new FloatingWindow();
            string         title  = "Window " + nWindows++;

            window.Title    = title;
            window.IconText = title;

            window.Activated   += (s, a) => Debug.WriteLine("Activated: {0}", window.IconText);
            window.Deactivated += (s, a) => Debug.WriteLine("Deactivated: {0}", window.IconText);

            host.Add(window);
            window.Show(startPoint);
            startPoint = startPoint.Add(20, 20);
        }
        private void ShowFloat(FloatSite floatSite)
        {
            FloatingWindow floatingControl = this.GetFloatingControl(floatSite);

            floatingControl.DataContext = (object)floatSite;
            this.EnsureFloatingSiteInVisibleBounds(floatSite);
            if (this.CanShowFloatingWindows)
            {
                floatingControl.Show();
            }
            else
            {
                this.DelayShowElement(floatingControl);
            }
        }
        public MainWindow()
        {
            InitializeComponent();

            this.Width  = System.Windows.SystemParameters.WorkArea.Width - 200;
            this.Height = System.Windows.SystemParameters.WorkArea.Height - 200;

            FloatingWindow window = new FloatingWindow();

            window.Title    = "Centered Window";
            window.IconText = "Centered Window";

            //TODO: is this needed?
            window.Scale = 1d / host.ZoomHost.ContentScale; //TODO: !!! don't use host.ContentScale, has bug and is always 1

            host.Add(window);
            window.Show();
        }