MainWindow.xaml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <Window x:Class="t8_elements.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:t8_elements"
  7. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  8. xmlns:col="clr-namespace:System.Collections;assembly=mscorlib"
  9. mc:Ignorable="d"
  10. Title="MainWindow" Height="450" Width="800">
  11. <Grid>
  12. <Grid.ColumnDefinitions>
  13. <ColumnDefinition
  14. Width="5*"/>
  15. <ColumnDefinition
  16. Width="11*"/>
  17. <ColumnDefinition Width="4*"/>
  18. </Grid.ColumnDefinitions>
  19. <Grid.RowDefinitions>
  20. <RowDefinition
  21. Height="1.4*"/>
  22. <RowDefinition
  23. Height="*"/>
  24. </Grid.RowDefinitions>
  25. <StackPanel
  26. HorizontalAlignment="Center"
  27. Width="150"
  28. Grid.RowSpan="2">
  29. <Button
  30. x:Name="acceptButton"
  31. Content="ОК"
  32. IsDefault="True"
  33. Margin="0 3 0 0"
  34. Click="acceptButton_Click" />
  35. <Button
  36. x:Name="escButton"
  37. Content="Выход"
  38. IsCancel="True"
  39. Click="escButton_Click" />
  40. <CheckBox
  41. x:Name="checkBox"
  42. IsChecked="False"
  43. Height="20"
  44. HorizontalAlignment="Center"
  45. VerticalContentAlignment="Center"
  46. Content="Флажок"
  47. IsThreeState="True"
  48. Unchecked="checkBox_Unchecked"
  49. Checked="checkBox_Checked"
  50. Indeterminate="checkBox_Indeterminate"
  51. />
  52. <RadioButton
  53. GroupName="Languages"
  54. Content="C#"
  55. IsChecked="False" />
  56. <RadioButton
  57. GroupName="Languages"
  58. Checked="RadioButton_Checked"
  59. Content="VB.NET" />
  60. <RadioButton
  61. GroupName="Languages"
  62. Content="C++" />
  63. <RadioButton
  64. GroupName="Technologies"
  65. Content="WPF"
  66. IsChecked="False" />
  67. <RadioButton
  68. GroupName="Technologies"
  69. Content="WinForms" />
  70. <RadioButton
  71. GroupName="Technologies"
  72. Content="ASP.NET" />
  73. <TextBox
  74. MaxLength="250"
  75. Margin="5">
  76. Начальный текст
  77. </TextBox>
  78. <TextBox
  79. x:Name="textBox1"
  80. AcceptsReturn="True"
  81. SpellCheck.IsEnabled="True"
  82. Language="ru-ru"
  83. Height="60"
  84. Margin="5"
  85. TextWrapping="Wrap"
  86. VerticalScrollBarVisibility="Auto"
  87. HorizontalScrollBarVisibility="Auto">
  88. Начальный текст
  89. </TextBox>
  90. <Button
  91. Content="Выделить текст"
  92. Height="30"
  93. Width="100"
  94. Click="Button_Click"
  95. Margin="5"/>
  96. <Label
  97. Target="{Binding ElementName=TextBox1}">
  98. _Привет
  99. </Label>
  100. <TextBox
  101. Name="TextBox1"
  102. Height="20"
  103. Width="100" />
  104. <PasswordBox
  105. PasswordChar="*"
  106. MinHeight="10"
  107. Margin="0 3 0 0"/>
  108. <PasswordBox
  109. MinHeight="10" />
  110. </StackPanel>
  111. <StackPanel
  112. Grid.Column="1" Grid.ColumnSpan="2">
  113. <ListBox
  114. Name="list"
  115. Width="150"
  116. Margin="0 5 0 0"
  117. DisplayMemberPath="Title"
  118. SelectionChanged="list_Selected">
  119. <local:Phone
  120. Title="iPhone6S"
  121. Company="Apple"
  122. Price="54990"/>
  123. <local:Phone
  124. Title="Lumia 950"
  125. Company="Microsoft"
  126. Price="39990" />
  127. <local:Phone
  128. Title="Nexus 5X"
  129. Company="Google"
  130. Price="29990" />
  131. </ListBox>
  132. <ComboBox
  133. Height="80"
  134. Width="170"
  135. Margin=" 0 5 0 0"
  136. VerticalAlignment="Top">
  137. <ComboBoxItem IsSelected="True">
  138. <StackPanel Orientation="Horizontal">
  139. <Image
  140. Source="nagiev1.jpg"
  141. Width="60"
  142. Height="80"/>
  143. <TextBlock>первый нагиев</TextBlock>
  144. </StackPanel>
  145. </ComboBoxItem>
  146. <StackPanel Orientation="Horizontal">
  147. <Image
  148. Source="nagiev2.jpg"
  149. Width="60"
  150. Height="80"/>
  151. <TextBlock>второй нагиев</TextBlock>
  152. </StackPanel>
  153. <StackPanel Orientation="Horizontal">
  154. <Image
  155. Source="nagiev3.jpg"
  156. Width="60"
  157. Height="80"/>
  158. <TextBlock>третий нагиев</TextBlock>
  159. </StackPanel>
  160. </ComboBox>
  161. <DataGrid
  162. x:Name="phonesGrid"
  163. Margin="0 5 0 0"
  164. AutoGenerateColumns="False"
  165. HorizontalGridLinesBrush="DarkGray"
  166. RowBackground="LightGray"
  167. AlternatingRowBackground="White"
  168. MaxWidth="228">
  169. <DataGrid.Items>
  170. <local:Phone
  171. Title="iPhone 6S"
  172. Company="Apple"
  173. Price="54990" />
  174. <local:Phone
  175. Title="Lumia 950"
  176. Company="Microsoft"
  177. Price="39990" />
  178. <local:Phone
  179. Title="Nexus 5X"
  180. Company="Google"
  181. Price="29990" />
  182. </DataGrid.Items>
  183. <DataGrid.Columns>
  184. <DataGridTextColumn
  185. Header="Модель"
  186. Binding="{Binding Path=Title}"
  187. Width="90" />
  188. <DataGridHyperlinkColumn
  189. Header="Компания"
  190. Binding="{Binding Path=Company}"
  191. Width="80" />
  192. <DataGridTextColumn
  193. Header="Цена"
  194. Binding="{Binding Path=Price}"
  195. Width ="50" />
  196. </DataGrid.Columns>
  197. <DataGrid.RowDetailsTemplate>
  198. <DataTemplate>
  199. <StackPanel Orientation="Horizontal">
  200. <TextBlock
  201. Text="{Binding Path=Price}"/>
  202. <TextBlock
  203. Text=" рублей по скидке"/>
  204. </StackPanel>
  205. </DataTemplate>
  206. </DataGrid.RowDetailsTemplate>
  207. </DataGrid>
  208. </StackPanel>
  209. <Grid
  210. Grid.Column="1"
  211. Background="Bisque" Grid.ColumnSpan="2" Margin="0,253,0,0" Grid.RowSpan="2">
  212. <Grid.ColumnDefinitions>
  213. <ColumnDefinition
  214. Width="0.5*"/>
  215. <ColumnDefinition/>
  216. </Grid.ColumnDefinitions>
  217. <Image Grid.Column="0" x:Name="mainNagiev">
  218. <Image.Source>
  219. <FormatConvertedBitmap Source="nagiev1.jpg"
  220. DestinationFormat="Gray32Float"/>
  221. </Image.Source>
  222. </Image>
  223. <StackPanel Grid.Column="1">
  224. <Image Source="nagiev3.jpg"/>
  225. </StackPanel>
  226. </Grid>
  227. </Grid>
  228. </Window>