|
@@ -1,7 +1,8 @@
|
|
|
- Ýëåìåíòû óïðàâëåíèÿ
|
|
|
+ # Ðлементы управлениÑ�
|
|
|
|
|
|
|
|
|
- <Grid>
|
|
|
+ ```
|
|
|
+<Grid>
|
|
|
<Grid.ColumnDefinitions>
|
|
|
<ColumnDefinition Width="*" />
|
|
|
<ColumnDefinition Width="*" />
|
|
@@ -11,7 +12,7 @@
|
|
|
Background="Lavender">
|
|
|
<Button
|
|
|
Visibility="Collapsed"
|
|
|
- Content="Ïàíåëü Collapsed" />
|
|
|
+ Content="Панель Collapsed" />
|
|
|
<Button
|
|
|
Height="20"
|
|
|
Content="Visible Button" />
|
|
@@ -21,27 +22,32 @@
|
|
|
Background="LightGreen">
|
|
|
<Button
|
|
|
Visibility="Hidden"
|
|
|
- Content="Ïàíåëü Hidden" />
|
|
|
+ Content="Панель Hidden" />
|
|
|
<Button
|
|
|
Height="20"
|
|
|
Content="Visible Button" />
|
|
|
</StackPanel>
|
|
|
</Grid>
|
|
|
+```
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
- <StackPanel>
|
|
|
- <TextBlock FlowDirection="RightToLeft">
|
|
|
- RightToLeft
|
|
|
- </TextBlock>
|
|
|
- <TextBlock FlowDirection="LeftToRight">
|
|
|
- LeftToRight
|
|
|
- </TextBlock>
|
|
|
+```
|
|
|
+<StackPanel>
|
|
|
+<TextBlock FlowDirection="RightToLeft">
|
|
|
+ RightToLeft
|
|
|
+</TextBlock>
|
|
|
+<TextBlock FlowDirection="LeftToRight">
|
|
|
+ LeftToRight
|
|
|
+</TextBlock>
|
|
|
</StackPanel>
|
|
|
+```
|
|
|
|
|
|
|
|
|
- <Button x:Name="button1">
|
|
|
+ ```
|
|
|
+<Button x:Name="button1">
|
|
|
<StackPanel>
|
|
|
- <TextBlock Text="Íàáîð êíîïêîê" />
|
|
|
+ <TextBlock Text="�абор кнопок" />
|
|
|
<Button
|
|
|
Background="Red"
|
|
|
Height="20"
|
|
@@ -56,140 +62,159 @@
|
|
|
Content="Green" />
|
|
|
</StackPanel>
|
|
|
</Button>
|
|
|
+```
|
|
|
|
|
|
|
|
|
- <StackPanel>
|
|
|
- <Button
|
|
|
- Margin="5"
|
|
|
- HorizontalContentAlignment="Left"
|
|
|
- Content="Left"
|
|
|
- Height="90"
|
|
|
- Width="500" />
|
|
|
- <Button
|
|
|
- Margin="5"
|
|
|
- HorizontalContentAlignment="Right"
|
|
|
- Content="Right"
|
|
|
- Height="90"
|
|
|
- Width="500" />
|
|
|
- <Button
|
|
|
- Margin="5"
|
|
|
- HorizontalContentAlignment="Center"
|
|
|
- Content="Center"
|
|
|
- Height="90"
|
|
|
- Width="500" />
|
|
|
- </StackPanel>
|
|
|
+ ```
|
|
|
+<StackPanel>
|
|
|
+ <Button
|
|
|
+ Margin="5"
|
|
|
+ HorizontalContentAlignment="Left"
|
|
|
+ Content="Left"
|
|
|
+ Height="90"
|
|
|
+ Width="500" />
|
|
|
+ <Button
|
|
|
+ Margin="5"
|
|
|
+ HorizontalContentAlignment="Right"
|
|
|
+ Content="Right"
|
|
|
+ Height="90"
|
|
|
+ Width="500" />
|
|
|
+ <Button
|
|
|
+ Margin="5"
|
|
|
+ HorizontalContentAlignment="Center"
|
|
|
+ Content="Center"
|
|
|
+ Height="90"
|
|
|
+ Width="500" />
|
|
|
+</StackPanel>
|
|
|
+```
|
|
|
|
|
|
|
|
|
|
|
|
- <StackPanel>
|
|
|
- <Button
|
|
|
- x:Name="button1"
|
|
|
- Padding="50 30 0 40"
|
|
|
- HorizontalContentAlignment="Left">
|
|
|
- Hello World
|
|
|
- </Button>
|
|
|
- <Button
|
|
|
- x:Name="button2"
|
|
|
- Padding="60 20 0 30"
|
|
|
- HorizontalContentAlignment="Center">
|
|
|
- Hello World
|
|
|
- </Button>
|
|
|
- </StackPanel>
|
|
|
+
|
|
|
+```
|
|
|
+<StackPanel>
|
|
|
+ <Button
|
|
|
+ x:Name="button1"
|
|
|
+ Padding="50 30 0 40"
|
|
|
+ HorizontalContentAlignment="Left">
|
|
|
+ Hello World
|
|
|
+ </Button>
|
|
|
+ <Button
|
|
|
+ x:Name="button2"
|
|
|
+ Padding="60 20 0 30"
|
|
|
+ HorizontalContentAlignment="Center">
|
|
|
+ Hello World
|
|
|
+ </Button>
|
|
|
+</StackPanel>
|
|
|
+```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- <StackPanel>
|
|
|
- <Button
|
|
|
- x:Name="acceptButton"
|
|
|
- Content="ÎÊ"
|
|
|
- IsDefault="True"
|
|
|
- Click="acceptButton_Click" />
|
|
|
- <Button
|
|
|
- x:Name="escButton"
|
|
|
- Content="Âûõîä"
|
|
|
- IsCancel="True"
|
|
|
- Click="escButton_Click" />
|
|
|
- </StackPanel>
|
|
|
+
|
|
|
+ ```
|
|
|
+<StackPanel>
|
|
|
+ <Button
|
|
|
+ x:Name="acceptButton"
|
|
|
+ Content="Ок"
|
|
|
+ IsDefault="True"
|
|
|
+ Click="acceptButton_Click" />
|
|
|
+ <Button
|
|
|
+ x:Name="escButton"
|
|
|
+ Content="Выход"
|
|
|
+ IsCancel="True"
|
|
|
+ Click="escButton_Click" />
|
|
|
+</StackPanel>
|
|
|
+```
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
- using System.Windows;
|
|
|
+```
|
|
|
+using System.Windows;
|
|
|
|
|
|
namespace ControlsApp
|
|
|
{
|
|
|
- public partial class MainWindow : Window
|
|
|
+public partial class MainWindow : Window
|
|
|
+{
|
|
|
+ public MainWindow()
|
|
|
+ {
|
|
|
+ InitializeComponent();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void acceptButton_Click(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ MessageBox.Show("Дей�твие выполнено");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void escButton_Click(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
- public MainWindow()
|
|
|
- {
|
|
|
- InitializeComponent();
|
|
|
- }
|
|
|
-
|
|
|
- private void acceptButton_Click(object sender, RoutedEventArgs e)
|
|
|
- {
|
|
|
- MessageBox.Show("Äåéñòâèå âûïîëíåíî");
|
|
|
- }
|
|
|
-
|
|
|
- private void escButton_Click(object sender, RoutedEventArgs e)
|
|
|
- {
|
|
|
- this.Close(); // çàêðûòèå îêíà
|
|
|
- }
|
|
|
+ this.Close();
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
+```
|
|
|
|
|
|
|
|
|
|
|
|
+```
|
|
|
<StackPanel x:Name="stackPanel">
|
|
|
<CheckBox
|
|
|
x:Name="checkBox1"
|
|
|
IsThreeState="True"
|
|
|
IsChecked="False"
|
|
|
Height="20"
|
|
|
- Content="Íåîòìå÷åíî" />
|
|
|
+ Content="�еотмечено" />
|
|
|
<CheckBox
|
|
|
x:Name="checkBox2"
|
|
|
IsThreeState="True"
|
|
|
IsChecked="True"
|
|
|
Height="20"
|
|
|
- Content="Îòìå÷åíî" />
|
|
|
+ Content="Отмечено" />
|
|
|
<CheckBox
|
|
|
x:Name="checkBox3"
|
|
|
IsThreeState="True"
|
|
|
IsChecked="{x:Null}"
|
|
|
Height="20"
|
|
|
- Content="Íåîïðåäåëåíî"/>
|
|
|
+ Content="�еопределено"/>
|
|
|
</StackPanel>
|
|
|
|
|
|
+```
|
|
|
|
|
|
|
|
|
+```
|
|
|
<CheckBox
|
|
|
x:Name="checkBox"
|
|
|
IsChecked="False"
|
|
|
Height="20"
|
|
|
- Content="Ôëàæîê"
|
|
|
+ Content="Флажок"
|
|
|
IsThreeState="True"
|
|
|
Unchecked="checkBox_Unchecked"
|
|
|
Indeterminate="checkBox_Indeterminate"
|
|
|
Checked="checkBox_Checked" />
|
|
|
+```
|
|
|
|
|
|
|
|
|
- private void checkBox_Checked(object sender, RoutedEventArgs e)
|
|
|
+```
|
|
|
+private void checkBox_Checked(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
- MessageBox.Show(checkBox.Content.ToString() + " îòìå÷åí");
|
|
|
+MessageBox.Show(checkBox.Content.ToString() + " Отмечен");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private void checkBox_Unchecked(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
- MessageBox.Show(checkBox.Content.ToString() + " íå îòìå÷åí");
|
|
|
+MessageBox.Show(checkBox.Content.ToString() + " не отмечен");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private void checkBox_Indeterminate(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
- MessageBox.Show(checkBox.Content.ToString() + " â íåîïðåäåëåííîì ñîñòîÿíèè");
|
|
|
+MessageBox.Show(checkBox.Content.ToString() + "В неопределённом �о�то�нии");
|
|
|
}
|
|
|
+```
|
|
|
|
|
|
|
|
|
|
|
|
+```
|
|
|
<StackPanel x:Name="stackPanel">
|
|
|
<RadioButton
|
|
|
GroupName="Languages"
|
|
@@ -212,11 +237,13 @@ private void checkBox_Indeterminate(object sender, RoutedEventArgs e)
|
|
|
GroupName="Technologies"
|
|
|
Content="ASP.NET" />
|
|
|
</StackPanel>
|
|
|
+```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+```
|
|
|
<StackPanel>
|
|
|
<PasswordBox
|
|
|
PasswordChar="*"
|
|
@@ -224,49 +251,55 @@ private void checkBox_Indeterminate(object sender, RoutedEventArgs e)
|
|
|
<PasswordBox
|
|
|
MinHeight="30" />
|
|
|
</StackPanel>
|
|
|
+```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- <ComboBox
|
|
|
- Name="phonesList"
|
|
|
- Height="30"
|
|
|
- VerticalAlignment="Top">
|
|
|
- <TextBlock>LG Nexus 5X</TextBlock>
|
|
|
- <TextBlock>Huawai Nexus 6P</TextBlock>
|
|
|
- <TextBlock>iPhone 6S</TextBlock>
|
|
|
- <TextBlock>iPhone 6S Plus</TextBlock>
|
|
|
- <TextBlock>Microsoft Lumia 950</TextBlock>
|
|
|
- </ComboBox>
|
|
|
+ ```
|
|
|
+<ComboBox
|
|
|
+Name="phonesList"
|
|
|
+Height="30"
|
|
|
+VerticalAlignment="Top">
|
|
|
+ <TextBlock>LG Nexus 5X</TextBlock>
|
|
|
+ <TextBlock>Huawai Nexus 6P</TextBlock>
|
|
|
+ <TextBlock>iPhone 6S</TextBlock>
|
|
|
+ <TextBlock>iPhone 6S Plus</TextBlock>
|
|
|
+ <TextBlock>Microsoft Lumia 950</TextBlock>
|
|
|
+</ComboBox>
|
|
|
|
|
|
+```
|
|
|
|
|
|
|
|
|
- <ComboBox
|
|
|
- Height="50"
|
|
|
- Width="150"
|
|
|
- VerticalAlignment="Top"
|
|
|
+
|
|
|
+```
|
|
|
+<ComboBox
|
|
|
+Height="50"
|
|
|
+Width="150"
|
|
|
+VerticalAlignment="Top"
|
|
|
>
|
|
|
- <ComboBoxItem IsSelected="True">
|
|
|
- <StackPanel Orientation="Horizontal">
|
|
|
- <Image
|
|
|
- Source="cats.jpg"
|
|
|
- Width="60" />
|
|
|
- <TextBlock>cats.jpg</TextBlock>
|
|
|
- </StackPanel>
|
|
|
- </ComboBoxItem>
|
|
|
- <StackPanel Orientation="Horizontal">
|
|
|
- <Image
|
|
|
- Source="windowcat.jpg"
|
|
|
- Width="60" />
|
|
|
- <TextBlock>windowcat.jpg</TextBlock>
|
|
|
- </StackPanel>
|
|
|
+ <ComboBoxItem IsSelected="True">
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
<Image
|
|
|
- Source="234.jpg"
|
|
|
+ Source="cats.jpg"
|
|
|
Width="60" />
|
|
|
- <TextBlock>234.jpg</TextBlock>
|
|
|
+ <TextBlock>cats.jpg</TextBlock>
|
|
|
</StackPanel>
|
|
|
- </ComboBox>
|
|
|
+ </ComboBoxItem>
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
+ <Image
|
|
|
+ Source="windowcat.jpg"
|
|
|
+ Width="60" />
|
|
|
+ <TextBlock>windowcat.jpg</TextBlock>
|
|
|
+ </StackPanel>
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
+ <Image
|
|
|
+ Source="234.jpg"
|
|
|
+ Width="60" />
|
|
|
+ <TextBlock>234.jpg</TextBlock>
|
|
|
+ </StackPanel>
|
|
|
+</ComboBox>
|
|
|
+```
|
|
|
|
|
|
|
|
|
|