public static void uptadePropertyGrid() { InstersecElementManager.printPublic(); propGrid.AutoGenerateProperties = true; dynamic teste = new DynamicDictionary(); teste.batata = "teaaaaa"; teste.carro = "arrrrrr"; teste.numero = 10; //dynamic teste = new ExpandoObject(); // () // teste.batata = 10; // teste.rato = "testando"; // teste.Add("rato","ratoooooo"); propGrid.SelectedObject = ((Dictionary <string, object>)teste.dictionary).Values; // ((IDictionary<string, Object>)ProgramManager.ActiveScreen.Screen.IntersectedProps).Keys; }
public void MyCanvas_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { DependencyObject parent; CanvasContentControl _MovedElementCCC = e.Source as CanvasContentControl; _MovedElement = e.Source as UIElement; parent = VisualTreeHelper.GetParent(_MovedElement); if (e.Source == _myCanvas) { // Console.WriteLine("here71"); // e.Handled = true; if (ProgramManager.AddingScreen == false) { ProgramManager.ActiveScreen.Screen.UnselectAll(); } // e.Handled = true; } else { // ProgramManager.ActiveControl.ActiveControl =null; if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift)) { if (ProgramManager.ActiveScreen.Screen.GetActiveExist()) { if (_MovedElementCCC.IsActiveCCC) { _MovedElementCCC.IsActiveCCC = true; } } _MovedElementCCC.IsSelectedCCC = !_MovedElementCCC.IsSelectedCCC; e.Handled = true; } else if (Keyboard.IsKeyDown(Key.LeftAlt) || Keyboard.IsKeyDown(Key.RightAlt)) { if (_MovedElementCCC.IsSelectedCCC == true) { if (ProgramManager.ActiveScreen.Screen.ActiveElement != null) { ProgramManager.ActiveScreen.Screen.ActiveElement.CanvasContetControlInstance.IsActiveCCC = false; } ProgramManager.ActiveScreen.Screen.ActiveElement = (SimpleTextImageElement)_MovedElementCCC.IContentFather; _MovedElementCCC.IsActiveCCC = true; // ProgramManager.uptadePropertyGrid(ProgramManager.ActiveScreen.Screen.ActiveElement.elementData); // Console.WriteLine("heeeeeereeee"); InstersecElementManager.update(); e.Handled = true; } else { ProgramManager.ActiveScreen.Screen.UnselectAll(); _MovedElementCCC.IsSelectedCCC = true; _MovedElementCCC.IsActiveCCC = true; ProgramManager.ActiveScreen.Screen.ActiveElement = (SimpleTextImageElement)_MovedElementCCC.IContentFather; // ProgramManager.uptadePropertyGrid(ProgramManager.ActiveScreen.Screen.ActiveElement.elementData); e.Handled = true; } } else if (_MovedElementCCC.IsSelectedCCC == false) { ProgramManager.ActiveScreen.Screen.UnselectAll(); _MovedElementCCC.IsSelectedCCC = true; _MovedElementCCC.IsActiveCCC = true; ProgramManager.ActiveScreen.Screen.ActiveElement = (SimpleTextImageElement)_MovedElementCCC.IContentFather; e.Handled = true; } _isDown = true; _myCanvas.CaptureMouse(); } //ProgramManager.ActiveControl.ActiveControl = _MovedElementCCC.IContentFather; //if (e.ClickCount == 2) //{ // Console.WriteLine($"here73 {_MovedElementCCC.IsSelectedCCC} {_MovedElementCCC.GetHashCode()}"); // _MovedElementCCC.IsSelectedCCC = !_MovedElementCCC.IsSelectedCCC; // ProgramManager.ActiveControl.ActiveControl = null; // e.Handled=true; //} //else //{ // _isDown = true; // _myCanvas.CaptureMouse(); //} //} // Console.WriteLine($" active elementeeeee {ProgramManager.ActiveScreen.Screen.ActiveElement.elementData.Name}"); ProgramManager.uptadePropertyGrid(); }