Calculator.axaml 1.7 KB

12345678910111213141516171819202122232425262728293031323334
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:vm="using:avaloniaPr.ViewModels"
  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. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  7. x:DataType="vm:MainWindowViewModel"
  8. x:Class="avaloniaPr.Calculator">
  9. <Grid Background="Gray">
  10. <Grid.RowDefinitions>
  11. <RowDefinition Height="0.1*"/>
  12. <RowDefinition Height="0.3*"/>
  13. <RowDefinition/>
  14. <RowDefinition Height="0.1*"/>
  15. </Grid.RowDefinitions>
  16. <Grid.ColumnDefinitions>
  17. <ColumnDefinition Width="0.3*"/>
  18. <ColumnDefinition/>
  19. <ColumnDefinition Width="0.3*"/>
  20. </Grid.ColumnDefinitions>
  21. <TextBlock Text="Calculator" Classes="centerTB" Grid.Column="1" Grid.Row="1"/>
  22. <StackPanel Grid.Row="2" Grid.Column="1">
  23. <TextBlock Text="{Binding CalculatorVM.TextCalculator}" Classes="TBLMain"/>
  24. <ComboBox SelectedValue="{Binding CalculatorVM.SV}" ItemsSource="{Binding CalculatorVM.ListItem}" Width="250"/>
  25. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,30" Background="#87929c">
  26. <TextBox Text="{Binding CalculatorVM.OneNum}" Classes="TBCalculator"/>
  27. <TextBlock Text="{Binding CalculatorVM.SV}" Classes="TBLCalculator"/>
  28. <TextBox Text="{Binding CalculatorVM.TwoNum}" Classes="TBCalculator"/>
  29. </StackPanel>
  30. <Button Content="{Binding CalculatorVM.TextButton}" Command="{Binding CalculatorVM.CommandCalculator}" Classes="ButtonStyle"/>
  31. <TextBlock Text="{Binding CalculatorVM.Result, StringFormat = Результат {0}}" Classes="TBLMain"/>
  32. </StackPanel>
  33. </Grid>
  34. </UserControl>