<UserControl
    x:Class="Pixeval.Controls.WorkView"
    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:flyoutContent="using:Pixeval.Controls.FlyoutContent"
    xmlns:local="using:Pixeval.Controls"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    Loaded="WorkView_OnLoaded"
    mc:Ignorable="d">
    <UserControl.Resources>
        <DataTemplate x:Key="NovelItemDataTemplate" x:DataType="local:NovelItemViewModel">
            <ItemContainer>
                <local:NovelItem
                    OpenNovelRequested="NovelItem_OnOpenNovelRequested"
                    RequestAddToBookmark="WorkItem_OnRequestAddToBookmark"
                    RequestOpenUserInfoPage="WorkItem_OnRequestOpenUserInfoPage"
                    RequestTeachingTip="WorkItem_OnRequestTeachingTip"
                    ViewModel="{x:Bind}"
                    ViewModelChanged="WorkItem_OnViewModelChanged" />
            </ItemContainer>
        </DataTemplate>
        <DataTemplate x:Key="IllustrationItemDataTemplate" x:DataType="local:IllustrationItemViewModel">
            <ItemContainer>
                <local:IllustrationItem
                    RequestAddToBookmark="WorkItem_OnRequestAddToBookmark"
                    RequestOpenUserInfoPage="WorkItem_OnRequestOpenUserInfoPage"
                    RequestTeachingTip="WorkItem_OnRequestTeachingTip"
                    RequiredParam="IllustrationItem_OnRequiredParam"
                    ViewModel="{x:Bind}"
                    ViewModelChanged="WorkItem_OnViewModelChanged" />
            </ItemContainer>
        </DataTemplate>
        <TeachingTip
            x:Name="AddToBookmarkTeachingTip"
            x:Uid="/EntryView/AddToBookmarkTeachingTip"
            CloseButtonClick="AddToBookmarkTeachingTip_OnCloseButtonClick"
            IsLightDismissEnabled="True">
            <flyoutContent:BookmarkTagSelector
                x:Name="BookmarkTagSelector"
                MaxHeight="{StaticResource TeachingTipContentMaxHeight}"
                Type="{x:Bind Type, Mode=OneWay}" />
        </TeachingTip>
    </UserControl.Resources>
    <local:EntryView
        x:Name="EntryView"
        x:Uid="/EntryView/IllustrationQrCodeTeachingTip"
        HasNoItem="{x:Bind ViewModel.HasNoItem, Mode=OneWay}"
        IsLoadingMore="{x:Bind ItemsView.IsLoadingMore, Mode=OneWay}">
        <local:EntryView.Content>
            <local:AdvancedItemsView
                x:Name="ItemsView"
                IsItemInvokedEnabled="True"
                ItemInvoked="ItemsView_OnItemInvoked"
                SelectionChanged="WorkView_OnSelectionChanged"
                SelectionMode="{x:Bind local:C.ToSelectionMode(ViewModel.IsSelecting), Mode=OneWay}">
                <local:AdvancedItemsView.ItemTransitionProvider>
                    <LinedFlowLayoutItemCollectionTransitionProvider />
                </local:AdvancedItemsView.ItemTransitionProvider>
            </local:AdvancedItemsView>
        </local:EntryView.Content>
    </local:EntryView>
</UserControl>
