CalculatorPage.axaml 1.8 KB

1234567891011121314151617181920212223242526272829
  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. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  6. x:Class="Calculator.CalculatorPage"
  7. xmlns:vm="using:Calculator.ViewModels"
  8. x:DataType="vm:MainWindowViewModel">
  9. <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
  10. <TextBlock HorizontalAlignment="Center">Выберите арифметическую операцию</TextBlock>
  11. <ComboBox SelectedIndex="{Binding CP.Func}" Margin="0,10,0,0" Width="200" HorizontalAlignment="Center">
  12. <ComboBoxItem>Сложение</ComboBoxItem>
  13. <ComboBoxItem>Вычитание</ComboBoxItem>
  14. <ComboBoxItem>Умножение</ComboBoxItem>
  15. <ComboBoxItem>Деление</ComboBoxItem>
  16. </ComboBox>
  17. <StackPanel Margin="0,10,0,0" HorizontalAlignment="Center" Orientation="Horizontal">
  18. <TextBox Text="{Binding CP.FirstArg}"/>
  19. <TextBlock VerticalAlignment="Center" Text="{Binding CP.Symb}" Margin="10,0,0,0"/>
  20. <TextBox Text="{Binding CP.SecondArg}" Margin="10,0,0,0"/>
  21. </StackPanel>
  22. <Button Command="{Binding CP.ResultCalc}" Margin="0,10,0,0" HorizontalAlignment="Center" HorizontalContentAlignment="Center" Width="200" Content="Вычислить"/>
  23. <TextBlock Margin="0,10,0,0" TextAlignment="Center" Width="200">Результат</TextBlock>
  24. <TextBlock Text="{Binding CP.Result}" Margin="0,10,0,0" TextAlignment="Center" Width="200"/>
  25. <TextBlock Text="{Binding CP.Message}" Margin="0,10,0,0" TextAlignment="Center"/>
  26. </StackPanel>
  27. </UserControl>