Multi-Platform Package Manager for Stable Diffusion
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

110 lines
5.4 KiB

<controls:UserControlBase
x:Class="StabilityMatrix.Avalonia.Views.InferencePage"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:StabilityMatrix.Avalonia.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData"
xmlns:vmInference="using:StabilityMatrix.Avalonia.ViewModels.Inference"
xmlns:ui="using:FluentAvalonia.UI.Controls"
xmlns:vm="clr-namespace:StabilityMatrix.Avalonia.ViewModels"
d:DataContext="{x:Static mocks:DesignData.InferenceViewModel}"
d:DesignHeight="650"
d:DesignWidth="1000"
x:DataType="vm:InferenceViewModel"
mc:Ignorable="d">
<controls:UserControlBase.Resources>
<ui:CommandBarFlyout Placement="Right" x:Key="AddTabFlyout">
<!-- Note: unlike a regular CommandBar, primary items can be set as the xml content and don't need
to be wrapped in a <ui:CommandBarFlyout.PrimaryCommands> tag
-->
<!--<ui:CommandBarButton Label="Text to Image" ToolTip.Tip="Text to Image">
<ui:CommandBarButton.IconSource>
<controls:FASymbolIconSource Symbol="fa-solid fa-bolt"/>
</ui:CommandBarButton.IconSource>
</ui:CommandBarButton>
<ui:CommandBarButton Label="Save" ToolTip.Tip="Save" />
<ui:CommandBarButton Label="Delete" ToolTip.Tip="Delete" />-->
<ui:CommandBarFlyout.SecondaryCommands>
<ui:CommandBarButton
IconSource="FullScreenMaximize"
Label="Text to Image"
Click="AddTabMenu_TextToImageButton_OnClick"
ToolTip.Tip="Text to Image"/>
<ui:CommandBarButton
IsEnabled="False"
IconSource="ImageCopy"
Label="Image to Image"
ToolTip.Tip="Image to Image"/>
<ui:CommandBarButton
IsEnabled="False"
IconSource="ImageEdit"
Label="Inpaint"
ToolTip.Tip="Inpaint"/>
</ui:CommandBarFlyout.SecondaryCommands>
</ui:CommandBarFlyout>
</controls:UserControlBase.Resources>
<Grid>
<!-- AddTabButtonCommand="{Binding AddTabCommand}" -->
<ui:TabView
x:Name="TabView"
CanDragTabs="True"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
CanReorderTabs="True"
CloseButtonOverlayMode="Auto"
TabCloseRequested="TabView_OnTabCloseRequested"
AddTabButtonClick="TabView_OnAddTabButtonClick"
TabItems="{Binding Tabs}"
SelectedItem="{Binding SelectedTab}"
SelectedIndex="{Binding SelectedTabIndex}"
TabWidthMode="SizeToContent">
<ui:TabView.TabItemTemplate>
<DataTemplate DataType="{x:Type vmInference:InferenceTextToImageViewModel}">
<ui:TabViewItem Header="{Binding TabTitle}"
IconSource="Document"
Content="{Binding}" />
</DataTemplate>
</ui:TabView.TabItemTemplate>
<ui:TabView.TabStripFooter>
<StackPanel
Orientation="Horizontal"
Spacing="8"
HorizontalAlignment="Right">
<Button
Padding="12,4"
IsVisible="{Binding !ClientManager.IsConnected}"
Command="{Binding ConnectCommand}"
Classes="success"
Content="Connect"/>
<Button
Classes="transparent"
BorderThickness="0">
<ui:SymbolIcon FontSize="18" Symbol="MoreVertical"/>
<Button.Flyout>
<MenuFlyout Placement="BottomEdgeAlignedLeft">
<MenuItem Header="Open Project..."
Command="{Binding MenuOpenProjectCommand}"
InputGesture="Ctrl+O"/>
<Separator/>
<MenuItem Header="Save"
Command="{Binding MenuSaveCommand}"
InputGesture="Ctrl+S"/>
<MenuItem Header="Save As..."
Command="{Binding MenuSaveAsCommand}"
InputGesture="Ctrl+Shift+S"/>
<Separator IsVisible="{Binding ClientManager.IsConnected}"/>
<MenuItem Header="Disconnect"
Command="{Binding DisconnectCommand}"
IsVisible="{Binding ClientManager.IsConnected}"/>
</MenuFlyout>
</Button.Flyout>
</Button>
</StackPanel>
</ui:TabView.TabStripFooter>
</ui:TabView>
</Grid>
</controls:UserControlBase>