Calc.axaml 1.5 KB

12345678910111213141516171819202122232425
  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. x:DataType="vm:MainWindowViewModel"
  6. xmlns:vm="using:Auth.ViewModels"
  7. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  8. x:Class="Auth.Calc">
  9. <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="350">
  10. <TextBlock>Выберите арифметическую операцию</TextBlock>
  11. <ComboBox x:Name="cm1" ItemsSource="{Binding Calc_VM.Operation}" SelectedItem="{Binding Calc_VM.SelectedOperation}" Width="260">
  12. </ComboBox>
  13. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10" Width="425">
  14. <NumericUpDown Width="150" Value="{Binding Calc_VM.Chislo1}" Increment="1" HorizontalAlignment="Stretch"/>
  15. <TextBlock FontSize="24" Margin="20 0 20 0" Text="{Binding Calc_VM.Znaki}"></TextBlock>
  16. <NumericUpDown Width="150" Value="{Binding Calc_VM.Chislo2}" Increment="1" HorizontalAlignment="Stretch"/>
  17. </StackPanel>
  18. <Button Width="260" Command="{Binding Calc_VM.Resultat}">
  19. <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">Вычислить</TextBlock>
  20. </Button>
  21. <TextBlock>Результат:</TextBlock>
  22. <TextBlock Text="{Binding Calc_VM.Result}"> </TextBlock>
  23. </StackPanel>
  24. </UserControl>