or
UC =
new
CircularGauge();
// Usercontrol WPF
UC.Width = 200; UC.Height = 200;
UC.Measure(
new
System.Windows.Size(UC.Width, UC.Height));
UC.Arrange(
new
Rect(0.0, 0.0, UC.Width, UC.Height));
UC.UpdateLayout();
RenderTargetBitmap oTargetBitmap =
new
RenderTargetBitmap((
int
)UC.Width, (
int
)UC.Height, 96.0, 96.0, System.Windows.Media.PixelFormats.Default);
oTargetBitmap.Render(UC);
PngBitmapEncoder oPngBitmapEncoder =
new
PngBitmapEncoder();
oPngBitmapEncoder.Frames.Add(BitmapFrame.Create(oTargetBitmap));
oPngBitmapEncoder.Save(msGaugeImage);
We have a grid with several properties. Length of each "Display name" is different: there are short names like "Step" and long names like "Upper alignment style". I want the "Display name" column (property name column) to auto-size according to the longest property name in the grid.
Currently I tried two options:
1. specify LabelColumnWidth to Auto, but this gives row-based auto-sizing, but I want that that all rows have the same width (looks like a single column)
2. not specify anything, the width is set to ~200px that's too long for me
Can you please suggest a proper way to have auto-sized width for the whole column?
Thank you!