Several Horizontal.Aligments do not cooperate
Posted: 25 Jan 2019, 22:00
I've been building my GUI programattically and I came across this small problem when I started aligning elements to the right

RP1 RP2 and Radio should be on the right hand side of the screen
with the DOMAIN URL stretching
here is my code
Also, I have had trouble finding what properties I can set for elements,
such as text vs content, width span options (if any), etc
Also, I can't seem to set padding on Stack Panels but I can set margins.

RP1 RP2 and Radio should be on the right hand side of the screen
with the DOMAIN URL stretching
here is my code
Code: Select all
public Noesis.DockPanel Header()
{
Noesis.DockPanel _panel = new Noesis.DockPanel{};
_panel.Height = 26;
_panel.VerticalAlignment = VerticalAlignment.Top;
_panel.HorizontalAlignment = HorizontalAlignment.Stretch;
_panel.Background = Brushes.DimGray;
_panel.Children.Add(new Button{
Content = "File",
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Center,
Margin = Noesis.Thickness.Parse("6,0,6,0")
});
_panel.Children.Add(new TextBlock
{
Text = "DOMAIN URL",
HorizontalAlignment = HorizontalAlignment.Stretch,
VerticalAlignment = VerticalAlignment.Center,
Margin = Noesis.Thickness.Parse("6,0,6,0")
});
_panel.Children.Add(new Button
{
Content = "RP1",
HorizontalAlignment = HorizontalAlignment.Right,
VerticalAlignment = VerticalAlignment.Center,
Margin = Noesis.Thickness.Parse("6,0,6,0")
});
_panel.Children.Add(new Button
{
Content = "RP2",
HorizontalAlignment = HorizontalAlignment.Right,
VerticalAlignment = VerticalAlignment.Center,
Margin = Noesis.Thickness.Parse("6,0,6,0")
});
_panel.Children.Add(new Button
{
Content = "Radio",
HorizontalAlignment = HorizontalAlignment.Right,
VerticalAlignment = VerticalAlignment.Center,
Margin = Noesis.Thickness.Parse("6,0,6,0")
});
_panel.Children.Add(new Button
{
Content = "Radio",
HorizontalAlignment = HorizontalAlignment.Right,
VerticalAlignment = VerticalAlignment.Center,
Margin = Noesis.Thickness.Parse("6,0,6,0")
});
return _panel;such as text vs content, width span options (if any), etc
Also, I can't seem to set padding on Stack Panels but I can set margins.