<UserControl
    x:Class="AppFramework.Views.AddRolesView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:extensions="clr-namespace:AppFramework.Extensions"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sync="http://schemas.syncfusion.com/wpf"
    Width="800"
    Height="450"
    mc:Ignorable="d">
    <sync:SfBusyIndicator AnimationType="DualRing" IsBusy="{Binding IsBusy}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="auto" />
                <RowDefinition Height="auto" />
                <RowDefinition />
                <RowDefinition Height="auto" />
                <RowDefinition Height="auto" />
            </Grid.RowDefinitions>

            <Border
                Grid.RowSpan="5"
                Opacity="1"
                Style="{StaticResource BorderStyle}" />

            <TextBlock
                Margin="15"
                FontSize="18"
                FontWeight="Bold"
                Text="{extensions:Translate SelectRoles}" />

            <DockPanel Grid.Row="1" Margin="15,10">
                <Button
                    Margin="5,0,0,0"
                    Command="{Binding QueryCommand}"
                    DockPanel.Dock="Right"
                    Style="{DynamicResource SearchButtonStyle}" />
                <TextBox Text="{Binding Filter, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
            </DockPanel>

            <sync:SfDataGrid
                Grid.Row="2"
                Margin="15,0"
                AllowEditing="True"
                AllowFiltering="False"
                AutoGenerateColumns="False"
                IsReadOnly="False"
                ItemsSource="{Binding dataPager.GridModelList}"
                Style="{StaticResource SimpleDataGridStyle}">
                <sync:SfDataGrid.Columns>
                    <sync:GridCheckBoxColumn
                        Width="60"
                        AllowFiltering="False"
                        HeaderText="{extensions:Translate Select}"
                        MappingName="IsSelected" />
                    <sync:GridTextColumn HeaderText="{extensions:Translate Name}" MappingName="Value.Name" />
                </sync:SfDataGrid.Columns>
            </sync:SfDataGrid>

            <sync:SfDataPager
                Grid.Row="3"
                Margin="5,0"
                HorizontalAlignment="Right"
                NumericButtonCount="{Binding dataPager.NumericButtonCount}"
                PageCount="{Binding dataPager.PageCount, Mode=TwoWay}"
                PageSize="{Binding dataPager.PageSize, Mode=TwoWay}"
                UseOnDemandPaging="True"
                PageIndex="{Binding dataPager.PageIndex, Mode=TwoWay}" />

            <StackPanel
                Grid.Row="4"
                Margin="15"
                HorizontalAlignment="Right"
                Orientation="Horizontal">
                <Button
                    Margin="0,0,10,0"
                    Padding="5"
                    Command="{Binding CancelCommand}"
                    Content="{extensions:Translate Cancel}" />
                <Button
                    Padding="5"
                    Command="{Binding SaveCommand}"
                    Content="{extensions:Translate Save}" />
            </StackPanel>
        </Grid>
    </sync:SfBusyIndicator>
</UserControl>