ConfigsBox.Children.Add(newButton);
var button = new Button();
((IAddChild)ConfigsBox).AddChild(button);
<Grid>
<Grid.RowDefenitions>
<RowDefenition height='*' />
<RowDefenition height='auto' />
<RowDefenition height='*' />
</Grid.RowDefenitions>
<Grid.ColumnDefenitions>
<ColumnDefenition width='*' />
<ColumnDefenition width='auto' />
<ColumnDefenition width='*' />
</Grid.ColumnDefenitions>
<Frame Grid.Row="1" Grid.Column="1" Content="{Binding CurrentPage}"
NavigationUIVisibility="Hidden"
Opacity="{Binding Opacity}"/>
</Grid>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<!-- Задаете шаблон отображения -->
<ScrollViewer.Template>
<ControlTemplate TargetType="{x:Type ScrollViewer}">
<Grid>
<ScrollContentPresenter /> <!-- Это область куда помещаются элементы, что будут скролировать -->
<!-- Вместо этого комментария можно поместить кнопку, если не нужно, чтобы она скролировалась -->
<ScrollBar x:Name="PART_VerticalScrollBar" Value="{TemplateBinding VerticalOffset}" Maximum="{TemplateBinding ScrollableHeight}"
ViewportSize="{TemplateBinding ViewportHeight}" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
HorizontalAlignment="Right" Style="{DynamicResource ResourceKey=ScrollBarStyle}" />
</Grid>
</ControlTemplate>
</ScrollViewer.Template>
<!-- А здесь помещаете все, что должно скролироваться -->
</ScrollViewer>
<ContentControl Content="{StaticResource Kubok}" Style="{StaticResource KubokStyle}" Margin="5" Width="30" />
<Style key="KubokStyle" TargetType="ContentControl">
<Style.Resources>
<Style TargetType="Path">
<Setter Property="Fill" Value="Red" />
</Style>
</Style.Resources>
</Style>
Process proc = new Process();
proc.StartInfo.FileName = "команда.exe";
proc.StartInfo.Arguments = "<ее параметры>";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.Start();
proc.StandardOutput.ReadToEnd()
while (isActiveThread)
{
// действие
}
event.WaitOne(); // Будет ждать пока вы его не взведете в сигнальное состояние
event.WaitOne(1000); // Ждем сигнального или 1 сек.
private void button1_Click(object sender, EventArgs e)
{
List<string> lstTest = new List<string>();
var thread = new Thread(Start);
thread.Start(lstTest);
}
private void Start(object obj)
{
List<string> lstTest = (List<string>)obj;
int count = lstTest.Count();
}