123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <UserControl xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
- x:Class="kuzminIVProjectWorkOnDemo.ServiceListPage"
- xmlns:vm="using:kuzminIVProjectWorkOnDemo.ViewModels"
- x:DataType="vm:MainWindowViewModel">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="100"/>
- <RowDefinition Height="*"/>
- <RowDefinition Height="50"/>
- </Grid.RowDefinitions>
- <StackPanel Grid.Row="0">
- <StackPanel Orientation="Horizontal">
- <StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="Сортировать по: " Classes="Default" Margin="10"/>
- <ComboBox Width="200" SelectedIndex="{Binding ServiceListPageWM.IndexSort}" >
- <ComboBoxItem Content="По возрастанию" />
- <ComboBoxItem Content="По убыванию" />
- </ComboBox>
- </StackPanel>
- <StackPanel Orientation="Horizontal" >
- <TextBlock Text="Скидка" Classes="Default" Margin="10"/>
- <ComboBox Width="200" SelectedIndex="{Binding ServiceListPageWM.Costindex}">
- <ComboBoxItem Content="Все"/>
- <ComboBoxItem Content="от 0 до 5"/>
- <ComboBoxItem Content="от 5 до 15"/>
- <ComboBoxItem Content="от 15 до 30"/>
- <ComboBoxItem Content="от 30 до 70"/>
- <ComboBoxItem Content="от 70 до 100"/>
- </ComboBox>
- </StackPanel>
- </StackPanel>
- <StackPanel >
- <TextBlock >
- Поиск по наменованию
- <LineBreak/>
- и описанию услуги
- </TextBlock>
- <TextBox Width="200" Text="{Binding ServiceListPageWM.Search}" />
- </StackPanel>
- </StackPanel>
- </StackPanel>
- <ListBox Grid.Row="1" ItemsSource="{Binding ServiceListPageWM.Services}" >
- <ListBox.ItemTemplate>
- <DataTemplate>
- <StackPanel Background="{Binding PriceBackround}" >
- <Border BorderThickness="1" CornerRadius="10" BorderBrush="Black">
- <StackPanel Orientation="Horizontal">
- <StackPanel>
- <Image Margin="10" Height="150" Width="150" Source="{Binding ImageBitmap}" />
- </StackPanel>
- <DockPanel>
- <StackPanel DockPanel.Dock="Top">
- <TextBlock Text="{Binding Title}"/>
- <StackPanel Orientation="Horizontal">
- <TextBlock TextDecorations="StrikeThrough" Margin="0,0,10,0" IsVisible="{Binding VisibleBlock}" Text="{Binding Cost}" />
- <TextBlock Text="{Binding LessonDuration}"/>
- </StackPanel>
- <TextBlock Text="{Binding DiscountStr}" IsVisible="{Binding VisibleBlock}" />
- </StackPanel>
- <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" >
- <Button Width="150" IsVisible="{Binding IsVisibleAdmin}" Content="Редактировать" Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).UpadateService}" CommandParameter="{Binding Id}" Classes="ButtonInTemplate" Margin="0,0,10,0" />
- <Button Width="150" IsVisible="{Binding IsVisibleAdmin}" Content="Удалить" Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).DeleteUser}" CommandParameter="{Binding Id}" Classes="ButtonInTemplate" Margin="10,0,0,0" />
- </StackPanel>
- </DockPanel>
- </StackPanel>
- </Border>
- </StackPanel>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- <StackPanel Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center">
- <TextBlock Text="{Binding ServiceListPageWM.Textcount}" />
- </StackPanel>
- <Button Content="Добавить услугу" Command="{Binding ServiceListPageWM.AddService}" IsVisible="{Binding ServiceListPageWM.AdminBool}" Grid.Row="0" Width="150" HorizontalAlignment="Right" Classes="ButtonTemplate" />
- <Button Content="Записать клиента на услугу" Command="{Binding ServiceListPageWM.pressButton}" IsVisible="{Binding ServiceListPageWM.AdminBool}" Grid.Row="2" Width="230" Classes="ButtonTemplate" />
- <Button Content="Окно администратора" IsVisible="{Binding ServiceListPageWM.AdminBool}" Grid.Row="2" Width="200" HorizontalAlignment="Right" Classes="ButtonTemplate" />
- </Grid>
- </UserControl>
|