private void OnOpenYAutoSizeWindowButtonClick(NEventArgs arg) { NTopLevelWindow window = new NTopLevelWindow(); window.Modal = true; // allow the user to resize the X window dimension window.AllowXResize = true; // bind the window Height to the desired height of the window NBindingFx bindingFx = new NBindingFx(window, NTopLevelWindow.DesiredHeightProperty); bindingFx.Guard = true; window.SetFx(NTopLevelWindow.HeightProperty, bindingFx); // create a wrap flow panel (by default flows from left to right) NWrapFlowPanel wrapPanel = new NWrapFlowPanel(); window.Content = wrapPanel; for (int i = 0; i < 10; i++) { wrapPanel.Add(new NButton("Button" + i)); } // open the window OwnerWindow.Windows.Add(window); window.Open(); }
private void OnOpenXAutoSizeWindowButtonClick(NEventArgs arg) { NTopLevelWindow window = new NTopLevelWindow(); window.Modal = true; // allow the user to resize the Y window dimension window.AllowYResize = true; // bind the window Width to the desired width of the window NBindingFx bindingFx = new NBindingFx(window, NTopLevelWindow.DesiredWidthProperty); bindingFx.Guard = true; window.SetFx(NTopLevelWindow.WidthProperty, bindingFx); // create a wrap flow panel with Y direction NWrapFlowPanel wrapPanel = new NWrapFlowPanel(); wrapPanel.Direction = ENHVDirection.TopToBottom; window.Content = wrapPanel; for (int i = 0; i < 10; i++) { wrapPanel.Add(new NButton("Button" + i)); } // open the window OwnerWindow.Windows.Add(window); window.Open(); }
protected override NWidget CreateExampleContent() { m_WrapFlowPanel = new NWrapFlowPanel(); m_WrapFlowPanel.Border = NBorder.CreateFilledBorder(NColor.Red); m_WrapFlowPanel.BorderThickness = new NMargins(1); for (int i = 1; i <= 16; i++) { m_WrapFlowPanel.Add(new NButton("Button " + i.ToString())); } return(m_WrapFlowPanel); }