CalculatorView.axaml 1.6 KB

12345678910111213141516171819202122232425262728293031
  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="task5_avalonia_mvvm_start.CalculatorView"
  7. x:DataType="vm:MainWindowViewModel"
  8. xmlns:vm="using:task5_avalonia_mvvm_start.ViewModels">
  9. <Grid>
  10. <StackPanel Classes="spBackground">
  11. <TextBlock Classes="headerCalc" Text="Выберите арифметическую операцию"></TextBlock>
  12. <StackPanel Classes="spAriphmetic">
  13. <ComboBox Classes="cbAriphm" ItemsSource="{Binding CalculatorVM.OperationsList}" SelectedItem="{Binding CalculatorVM.SelectedOperation}">
  14. <ComboBox.ItemTemplate>
  15. <DataTemplate>
  16. <TextBlock Text="{Binding Name}"/>
  17. </DataTemplate>
  18. </ComboBox.ItemTemplate>
  19. </ComboBox>
  20. <StackPanel Classes="spNums" Orientation="Horizontal">
  21. <TextBox Classes="tbNum" Text="{Binding CalculatorVM.Num1}"></TextBox>
  22. <TextBlock Classes="tbNum" Text="{Binding CalculatorVM.SelectedSign}"></TextBlock>
  23. <TextBox Classes="tbNum" Text="{Binding CalculatorVM.Num2}"></TextBox>
  24. </StackPanel>
  25. </StackPanel>
  26. <Button Classes="bCalc" Command="{Binding CalculatorVM.ToCalculate}">Вычислить</Button>
  27. <TextBlock Classes="headerCalc">Результат:</TextBlock>
  28. <TextBlock Classes="footerCalc" Text="{Binding CalculatorVM.Result}"></TextBlock>
  29. </StackPanel>
  30. </Grid>
  31. </UserControl>