<StackPanel Orientation="Horizontal">
<StackPanel.Resources>
<Style TargetType="Button">
<Setter Property="Margin" Value="0 0 10 0"/>
<Setter Property="Width" Value="100"/>
</Style>
</StackPanel.Resources>
<Button Content="Кнопка 1" Command="{Binding CustomButtonCommand}" CommandParameter="Btn1"/>
<Button Content="Кнопка 2" Command="{Binding CustomButtonCommand}" CommandParameter="Btn2"/>
<Button Content="Кнопка 3" Command="{Binding CustomButtonCommand}" CommandParameter="Btn3"/>
<Button Content="OK" Command="{Binding OkButtonCommand}"/>
<Button Content="Отмена" Command="{Binding CancelButtonCommand}"/>
</StackPanel>
services:
app.tab_stack:
class: SourceBundle\Tab\TabStack
arguments:
- "@other_service"
- [ "tab1", "tab2", "tab3"]
services:
app.tab_stack:
class: SourceBundle\Tab\TabStack
arguments: [ "@other_service" ]
calls:
- [register, [ "tab1" ]]
- [register, [ "tab2" ]]
- [register, [ "tab3" ]]
да, при изменении длины массива с помощью метода Array.Resize() создаётся новый массив, аллокация будет каждый раз. Указывайте нужное количество элементов заранее, перед циклом. Если количество не известно заранее (например, в цикле while), то используйте
List<T>
- в нём находится массив, длина которого изменяется логарифмически.Пример:
покажет