private static void W_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            Window w = (Window)sender;
            //собираем основную информацию о окне и сохраняем
            PanelItemParametry pip = new PanelItemParametry();

            pip.Element  = w.GetType();
            pip.Bounds   = new Rect(w.Left, w.Top, w.Width, w.Height);
            pip.Position = WindowPositionBehaviour.GetWindowPosition(w);

            PanelSettings.SingleBuild(sender.GetType(), pip);
        }
Beispiel #2
0
        public void SetValues(UIElement element, IEnumerable values)
        {
            var            sender    = (FrameworkElement)element;
            PanelParametry parametry = (PanelParametry)((FrameworkElement)sender.Parent).DataContext;

            foreach (ControlMenuItem item in values)
            {
                if (item.ToString() != "{DisconnectedItem}")
                {
                    WindowPosition     wp = parametry.Position;
                    PanelItemParametry pp = new PanelItemParametry {
                        Element = item.TypeElement, Position = wp, Bounds = new Rect(GetStartSizeByTypePanel(item.TypeElement))
                    };
                    parametry.Items.Add(pp);
                    CollectionViewSource.GetDefaultView(parametry.Items).Refresh();

                    _panelsList = null;
                    this.SendPropertyChanged(nameof(PanelsList));
                }
            }
        }