winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

MainPage.xaml (6515B)


      1 <!-- Copyright (c) Microsoft Corporation.
      2      Licensed under the MIT License. -->
      3 <Page
      4     x:Class="AppInstallerCaller.MainPage"
      5     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      6     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      7     xmlns:local="using:AppInstallerCaller"
      8     xmlns:deployment="using:Microsoft.Management.Deployment"
      9     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     10     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     11     mc:Ignorable="d">
     12 
     13     <Page.Resources>
     14         <ResourceDictionary>
     15             <Style TargetType="StackPanel">
     16                 <Setter Property="Margin" Value="5" />
     17                 <Setter Property="HorizontalAlignment" Value="Center" />
     18             </Style>
     19             <Style TargetType="Button">
     20                 <Setter Property="Margin" Value="5" />
     21                 <Setter Property="HorizontalAlignment" Value="Center" />
     22             </Style>
     23         </ResourceDictionary>
     24     </Page.Resources>
     25 
     26     <Grid MinWidth="800" MinHeight="600">
     27         <Grid.RowDefinitions>
     28             <RowDefinition Height="Auto"/>
     29             <RowDefinition Height="Auto"/>
     30             <RowDefinition Height="Auto"/>
     31         </Grid.RowDefinitions>
     32         <Grid.ColumnDefinitions>
     33             <ColumnDefinition Width="*"/>
     34             <ColumnDefinition Width="*"/>
     35         </Grid.ColumnDefinitions>
     36 
     37         <ToggleSwitch x:Name="toggleDevSwitch" Toggled="ToggleDevSwitchToggled">Use WinGetDev</ToggleSwitch>
     38 
     39         <StackPanel Grid.Row="1">
     40             <TextBlock Style="{StaticResource SubheaderTextBlockStyle}">Select catalog</TextBlock>
     41 
     42             <Button x:Name="findSourcesButton" Click="FindSourcesButtonClickHandler">Find Catalogs</Button>
     43             <TextBlock>Select catalog to search</TextBlock>
     44             <ListBox x:Name="catalogsListBox" ItemsSource="{x:Bind PackageCatalogs}" SelectionMode="Single" Height="200">
     45                 <ItemsControl.ItemTemplate>
     46                     <DataTemplate x:DataType="deployment:PackageCatalogReference">
     47                         <TextBlock Text="{x:Bind Info.Name, Mode=OneTime}"/>
     48                     </DataTemplate>
     49                 </ItemsControl.ItemTemplate>
     50             </ListBox>
     51         </StackPanel>
     52 
     53         <StackPanel Grid.Row="1" Grid.Column="1">
     54             <TextBlock Style="{StaticResource SubheaderTextBlockStyle}">Install app</TextBlock>
     55 
     56             <StackPanel Orientation="Horizontal">
     57                 <TextBox x:Name="catalogIdTextBox" Header="Find an app to install:" PlaceholderText="App Id (e.g. Microsoft.Teams)"></TextBox>
     58                 <Button x:Name="searchButton" Click="SearchButtonClickHandler" VerticalAlignment="Bottom" Margin="0">🔍</Button>
     59             </StackPanel>
     60 
     61             <StackPanel Orientation="Horizontal">
     62                 <Button x:Name="installButton" Click="InstallButtonClickHandler" IsEnabled="False">Install</Button>
     63                 <Button x:Name="cancelButton" Click="CancelButtonClickHandler" IsEnabled="False">Cancel</Button>
     64             </StackPanel>
     65 
     66             <ProgressBar x:Name="installProgressBar" Value="0" Maximum="100" Width="200px"/>
     67             <TextBlock x:Name="installStatusText" Text="" HorizontalAlignment="Center"/>
     68 
     69             <TextBox x:Name="downloadDirectoryTextBox" Header="Download Location:" PlaceholderText="Existing directory path to download to"></TextBox>
     70             <StackPanel Orientation="Horizontal">
     71                 <Button x:Name="downloadButton" Click="DownloadButtonClickHandler" IsEnabled="False">Download</Button>
     72                 <Button x:Name="downloadCancelButton" Click="DownloadCancelButtonClickHandler" IsEnabled="False">Cancel</Button>
     73             </StackPanel>
     74 
     75             <ProgressBar x:Name="downloadProgressBar" Value="0" Maximum="100" Width="200px"/>
     76             <TextBlock x:Name="downloadStatusText" Text="" HorizontalAlignment="Center"/>
     77         </StackPanel>
     78 
     79         <StackPanel Grid.Row="2" Margin="3">
     80             <TextBlock Style="{StaticResource SubheaderTextBlockStyle}">Installed apps</TextBlock>
     81             <TextBlock>List installed apps from selected catalog</TextBlock>
     82             <StackPanel Orientation="Horizontal" >
     83                 <Button x:Name="refreshButton" Click="RefreshInstalledButtonClickHandler" IsEnabled="True">Refresh</Button>
     84                 <Button x:Name="clearInstalledButton" Click="ClearInstalledButtonClickHandler" IsEnabled="True">Clear</Button>
     85             </StackPanel>
     86             <TextBlock x:Name="installedStatusText" Text=""/>
     87             <ListBox x:Name="installedListBox" ItemsSource="{x:Bind InstalledApps}" Height="300" ScrollViewer.VerticalScrollBarVisibility="Visible">
     88                 <ItemsControl.ItemTemplate>
     89                     <DataTemplate x:DataType="deployment:CatalogPackage">
     90                         <TextBlock Text="{x:Bind Name, Mode=OneWay}"/>
     91                     </DataTemplate>
     92                 </ItemsControl.ItemTemplate>
     93             </ListBox>
     94         </StackPanel>
     95 
     96         <StackPanel Grid.Row="2" Grid.Column="1" Margin="3">
     97             <TextBlock Style="{StaticResource SubheaderTextBlockStyle}">Installing apps</TextBlock>
     98             <TextBlock>List apps being installed from selected catalog</TextBlock>
     99             <StackPanel Orientation="Horizontal" >
    100                 <Button x:Name="installingRefreshButton" Click="RefreshInstallingButtonClickHandler" IsEnabled="True">Refresh</Button>
    101                 <Button x:Name="installingClearInstalledButton" Click="ClearInstallingButtonClickHandler" IsEnabled="True">Clear</Button>
    102             </StackPanel>
    103             <TextBlock x:Name="installingStatusText" Text=""/>
    104             <ListBox x:Name="installingListBox" ItemsSource="{x:Bind InstallingPackages}" Height="300" ScrollViewer.VerticalScrollBarVisibility="Visible">
    105                 <ItemsControl.ItemTemplate>
    106                     <DataTemplate x:DataType="local:InstallingPackageView">
    107                         <StackPanel HorizontalAlignment="Center">
    108                             <TextBlock Text="{x:Bind Package.Id, Mode=OneWay}"/>
    109                             <ProgressBar Value="{x:Bind Progress, Mode=OneWay}" Maximum="100" Width="200px"></ProgressBar>
    110                             <TextBlock Text="{x:Bind StatusText, Mode=OneWay}" HorizontalAlignment="Center"></TextBlock>
    111                         </StackPanel>
    112                     </DataTemplate>
    113                 </ItemsControl.ItemTemplate>
    114             </ListBox>
    115         </StackPanel>
    116     </Grid>
    117 </Page>