Beispiel #1
0
        private void show_window_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            sub_show newshow = new sub_show();

            newshow.Width  = 700;
            newshow.Height = 800;
            //newshow.HorizontalAlignment = HorizontalAlignment.Center;
            //newshow.Margin = new Thickness(0, 200, 0, 0);
            DataObject data = new DataObject(typeof(sub_show), newshow);

            DragDrop.DoDragDrop(newshow, data, DragDropEffects.Copy);
            sub_addelement newadd = new sub_addelement();
        }
Beispiel #2
0
        private void main_grid_Drop(object sender, DragEventArgs e)
        {
            IDataObject data = new DataObject();

            data = e.Data;
            sub_show newshow = new sub_show();

            subwindow1.Width  = 700;
            subwindow1.Height = 800;
            //newshow.Name = "show";
            subwindow1.Opacity = 0.9;
            //newshow = data.GetData(typeof(sub_show)) as sub_show;
            subwindow1.Margin = new Thickness(e.GetPosition(main_grid).X, e.GetPosition(main_grid).Y, 0, 0);
            //subwindow1.Margin = new Thickness(100,100, 0, 0);
            newshow.PreviewMouseRightButtonDown += new MouseButtonEventHandler(newshow_PreviewMouseRightButtonDown);
            subwindow_content1.Children.Add(newshow);

            //PublicClass.show_left = subwindow1.Margin.Left;
            //PublicClass.show_right = subwindow1.Margin.Left + subwindow1.Width;
            //PublicClass.show_bottom = subwindow1.Margin.Top + subwindow1.Height-45;
        }