Questions tagged [gridlength]

14 questions
25
votes
1 answer

How to use WPF's asterisk size value in codebehind?

I create some control in codebehind and would like to set its size dynamically. I can assign numerical values as well as System.Windows.GridLength.Auto, but there is no equivalent to "*". Is that because the "*" from XAML gets translated into code…
Martin Hennings
  • 16,418
  • 9
  • 48
  • 68
13
votes
1 answer

C# WPF - GridLength GridUnitType.Auto

Can anyone explain the difference between using: GridLength length = new GridLength(0, GridUnitType.Auto) and GridLength length = new GridLength(1, GridUnitType.Auto) My limited knowledge of this leads me to believing these would both be…
shann1990
  • 133
  • 1
  • 1
  • 7
5
votes
1 answer

How to discrete animate GridLength from "Auto" to "*"?

I need to animate this property using a Storyboard. Is writing your own animation is a best choice?
Sergey Aldoukhov
  • 22,316
  • 18
  • 72
  • 99
3
votes
2 answers

int to System.Windows.GridLength - VB.NET

How can I convert int to System.Windows.GridLength in VB, NET so that I can set the height of a grid row in Silverlight (xaml). In xaml file: In VB.NET: rowerror.Height = CType(30,…
eriksv88
  • 3,482
  • 3
  • 31
  • 50
3
votes
1 answer

WPF GridLength in XAML

I'm trying to define a common Width resource in Common.xaml which will be shared by different controls, like following: 20 I then use it in a Button style defined in ButtonStyle.xaml
wd113
  • 477
  • 1
  • 9
  • 18
1
vote
1 answer

Animation and GridLength in Xamarin forms

I have class Model public class Model : INotifyPropertyChanged ... private GridLength detailsPanelHeight { get; set; } public GridLength DetailsPanelHeight { get { return detailsPanelHeight; } set { if…
Remin Maxim
  • 41
  • 1
  • 9
1
vote
1 answer

Why does this data binding not change the GridUnitType?

My goal is to save a GridSplitter position for later recall. The splitter is inside a Grid control that has three columns defined thusly:
DonBoitnott
  • 10,787
  • 6
  • 49
  • 68
1
vote
3 answers

DependencyProperty typeof GridLength is not passing value "Auto" to ChildElement in CustomControl

I am building a CustomControl with some DependencyProperty's. It's a simple Control to browse for a path, and contains a label, a textbox and a button. I would like to set the width of the label, the textbox and the button sepperately. So I added…
Stef Geysels
  • 1,023
  • 11
  • 27
1
vote
1 answer

Storyboard targeting GridLength for WP8

I want to make a storyboard for RowDefinition changing the Height, and I found this to help me. The only problem when I want to create the class GridLengthAnimation, I cannot make it a AnimationTimeline. Is this because windows phone 8 does not…
JonasN89
  • 1,386
  • 2
  • 11
  • 23
1
vote
1 answer

Assign static value to GridLength resource

Case I've defined a series of GridLenghts as a resource in my WPF Window: 17 Since this scrollbar height is variable dependent on the operating system used, I'd like to refactor this line of…
Herman Cordes
  • 4,628
  • 9
  • 51
  • 87
0
votes
1 answer

Saving a Grid to a DependencyProperty in WinUI 3: Working with the AppTitleBar in WinUI 3

I've run into a curious problem trying to work with the AppTitleBar in a WinUI 3 program. The title bar is meant to reformat itself dynamically (for visually challenged users) which means I need to know where everything in the WindowChrome is. I'm…
aturnbul
  • 347
  • 2
  • 12
0
votes
1 answer

How many pixel from 1 star (GridUnitType.Star) in WPF

I found here var gridLength = new GridLength(1, GridUnitType.Star); I want to know, 1 star = ? pixel I was reached on the Internet, but I couldn't found any threads about this Thanks.
0
votes
2 answers

Namespace for creating StaticResource of GridLength

I'm trying to create a StaticResource of the type GridLength to use in my XAML. I want to define columns of uniform width, but I cannot seem to find the Namespace in Xaml that allows me to define my StaticResource. In the documentation, I have found…
hededo
  • 371
  • 2
  • 16
0
votes
1 answer

Add/Subtract GridLength in WPF

I have three columns containing two expanders in left and right columns. When both the expnders collapsed, I need to arrage the content in the middle column on the full window. For that I need to calculate the gridlengths. For Example GridLength w1=…
Sauron
  • 16,668
  • 41
  • 122
  • 174