Я работаю с XAML и мне нужно выполнить следующие действия:Fit Content Для столбцов XAML
У меня есть ряд кнопок, и мне нужно быть в хорошей форме в отношении конкретного столбца при изменении разрешения. Используйте элемент DockPanel, но какое достижение - это то, что подходят кнопки столбца. Мне нужно, чтобы размер кнопок соответствовал столбцу. Любые предложения?
Вот код
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="25*"/>
<ColumnDefinition Width="50*"/>
<ColumnDefinition Width="25*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0"/>
<Border Grid.Column="2"/>
<Border Grid.Column="1" >
<Grid Name ="grillaEditor">
<Grid.RowDefinitions>
<RowDefinition Height="12*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Grid.Row="0"/>
<Border Grid.Row="1">
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal" >
<Button Width="30" Height="30" BorderBrush="{x:Null}" >
<StackPanel>
<Image Source="Resources/Images/Icons/undo-26.png" ></Image>
</StackPanel>
</Button>
<Button Width="30" Height="30" BorderBrush="{x:Null}" >
<StackPanel>
<Image Source="Resources/Images/Icons/redo-26.png" ></Image>
</StackPanel>
</Button>
<Button Width="30" Height="30" BorderBrush="{x:Null}">
<StackPanel>
<Image Source="Resources/Images/Icons/paste-26.png" ></Image>
</StackPanel>
</Button>
<Button Width="30" Height="30" BorderBrush="{x:Null}" >
<StackPanel>
<Image Source="Resources/Images/Icons/cut-26.png" ></Image>
</StackPanel>
</Button>
<Button Width="30" Height="30" BorderBrush="{x:Null}" >
<StackPanel>
<Image Source="Resources/Images/Icons/copy-26.png" ></Image>
</StackPanel>
</Button>
<Button Width="30" Height="30" BorderBrush="{x:Null}">
<StackPanel>
<Image Source="Resources/Images/Icons/trash-26.png" ></Image>
</StackPanel>
</Button>
<Button Width="30" Height="30" >
<StackPanel>
<Image Source="Resources/Images/Icons/left_circular-26.png" ></Image>
</StackPanel>
</Button>
<Button Width="30" Height="30" >
<StackPanel>
<Image Source="Resources/Images/Icons/right_circular-26.png" ></Image>
</StackPanel>
</Button>
<Button Width="30" Height="30"" >
<StackPanel>
<Image Source="Resources/Images/Icons/up_circular-26.png" ></Image>
</StackPanel>
</Button>
<Button Width="30" Height="30" >
<StackPanel>
<Image Source="Resources/Images/Icons/down_circular-26.png" ></Image>
</StackPanel>
</Button>
<Button Width="30" Height="30" >
<StackPanel>
<Image Source="Resources/Images/Icons/restart-26.png" ></Image>
</StackPanel>
</Button>
<Button Width="30" Height="30" >
<StackPanel>
<Image Source="Resources/Images/Icons/select_all-26.png" ></Image>
</StackPanel>
</Button>
<Button Width="30" Height="30" BorderBrush="{x:Null}" >
<StackPanel>
<Image Source="Resources/Images/Icons/zoom_out-26.png" ></Image>
</StackPanel>
</Button>
<Button Width="30" Height="30" BorderBrush="{x:Null}" >
<StackPanel>
<Image Source="Resources/Images/Icons/zoom_in-26.png" ></Image>
</StackPanel>
</Button>
<Button Width="30" Height="30" BorderBrush="{x:Null}" >
<StackPanel>
<Image Source="Resources/Images/Icons/resize_four_directions-26.png" ></Image>
</StackPanel>
</Button>
</StackPanel>
</StackPanel>
</Border>
</Grid>
</Border>
используйте сетку, возможно, единую линию вместо стекальной панели и не давайте кнопкам размер – ZSH