kalkulator.axaml 1.8 KB

123456789101112131415161718192021222324252627
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:vm="clr-namespace:shkola.ViewModels"
  6. x:DataType="vm:MainWindowViewModel"
  7. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  8. x:Class="shkola.kalkulator">
  9. <StackPanel VerticalAlignment="Center" Margin="15">
  10. <TextBlock HorizontalAlignment="Center" FontSize="20">Калькулятор</TextBlock>
  11. <TextBlock Margin="0 15 0 0" HorizontalAlignment="Center">Выберите то что хотите сделать:</TextBlock>
  12. <ComboBox SelectedIndex="{Binding CP.Func}" Margin="0 5 0 0" HorizontalAlignment="Center" Width="400">
  13. <ComboBoxItem>Сложение</ComboBoxItem>
  14. <ComboBoxItem>Вычитание</ComboBoxItem>
  15. <ComboBoxItem>Умножение</ComboBoxItem>
  16. <ComboBoxItem>Деление</ComboBoxItem>
  17. </ComboBox>
  18. <TextBox Width="400" Margin="0 10 0 0" Text="{Binding CP.FirstArg}" TextAlignment="Center" Watermark="Число один"/>
  19. <TextBlock Width="50"></TextBlock>
  20. <TextBox Width="400" Text="{Binding CP.SecondArg}" TextAlignment="Center" Watermark="Число два"/>
  21. <Button Command="{Binding CP.ResultCalc}" Margin="0 10 0 0" HorizontalAlignment="Center" Width="400">Результат</Button>
  22. <Border Margin="0 10 0 0" Width="400" Height="30" BorderBrush="#393E46" BorderThickness="1" CornerRadius="3">
  23. <TextBlock TextAlignment="Center" Text="{Binding CP.Result}"></TextBlock>
  24. </Border>
  25. </StackPanel>
  26. </UserControl>