예제 #1
0
        private void RemoveAllGadgets()
        {
            while (Gadgets.Count > 0)
            {
                RemoveGadget(Gadgets[Gadgets.Count - 1]);
            }

            if (dataDictionaryControl != null)
            {
                canvasMain.Children.Remove(dataDictionaryControl);
                dataDictionaryControl = null;
            }

            if (propertiesControl != null)
            {
                canvasMain.Children.Remove(propertiesControl);
                propertiesControl = null;
            }

            Gadgets.Clear();
            EnableDisableOptions();
        }
예제 #2
0
        void mnuDataDictionary_Click(object sender, RoutedEventArgs e)
        {
            if (DashboardHelper != null)
            {
                if (dataDictionaryControl != null)
                {
                    canvasMain.Children.Remove(dataDictionaryControl);
                }
                dataDictionaryControl = new DataDictionaryControl(DashboardHelper);
                Canvas.SetLeft(dataDictionaryControl, mousePoint.X - 10);
                Canvas.SetTop(dataDictionaryControl, mousePoint.Y - 10);
                dataDictionaryControl.GadgetClosing += new GadgetClosingHandler(gadget_GadgetClosing);
                DragCanvas.SetZIndex(dataDictionaryControl, 10000);
                canvasMain.Children.Add(dataDictionaryControl);

                DragCanvas.SetCanBeDragged(dataDictionaryControl, true);
            }
        }