What you are doing is actually quite complex.
You actually want it left aligned. That is easy. Set it to HorizontalAlignment="Left".
You want a min size and max size and the ability to grow in between those sizes when the window is resized.
First, you need the TextBox to have a parent between it and the Column that will expand to the full width of the Column.
<Window x:Class="TestTextAlignment.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:loc="clr-namespace:TestTextAlignment"
Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
<Grid Name="MainGrid" ShowGridLines="True" Height="30" >
<Grid.Resources>
<loc:ColumnSizeToTextBoxSizeConverter x:Key="SizeConverter" LeftMargin="5" RightMargin="25"/>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Name="ColDef1" Width="*"></ColumnDefinition>
<ColumnDefinition Name="ColDef2" Width="*"></ColumnDefinition>
<ColumnDefinition Name="ColDef3" Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<DockPanel Name="Col1">
<TextBox Text="Text 1" Margin="5" HorizontalAlignment="Left" MinWidth="100" MaxWidth="300"
Width="{Binding ElementName=Col1, Path=ActualWidth, Mode=OneWay, Converter={StaticResource SizeConverter}}" />
</DockPanel>
<DockPanel Name="Col2" Grid.Column="1">
<TextBox Text="Text 2" Margin="5" HorizontalAlignment="Left" MinWidth="100" MaxWidth="300"
Width="{Binding ElementName=Col2, Path=ActualWidth, Mode=OneWay, Converter={StaticResource SizeConverter}}" />
</DockPanel>
<DockPanel Name="Col3" Grid.Column="2" >
<TextBox Text="Text 3" Margin="5" HorizontalAlignment="Left" MinWidth="100" MaxWidth="300"
Width="{Binding ElementName=Col3, Path=ActualWidth, Mode=OneWay, Converter={StaticResource SizeConverter}}" />
</DockPanel>
</Grid>
</Window>
Then as you see in the XAML, you need a converter, that will set the TextBox size to the parent object minus the left and right margins.
using System;
using System.Windows.Data;
namespace TestTextAlignment
{
public class ColumnSizeToTextBoxSizeConverter : IValueConverter
{
#region IValueConverter Members
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return (double)value - LeftMargin - RightMargin;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
#endregion
public double LeftMargin { get; set; }
public double RightMargin { get; set; }
}
}
Note: You could enhance the converter to take the left and right margins in as Convert Parameters so one converter can be used to send different sizes to any element.