|
| 1 | +<!-- Copyright (c) 2023 Files Community. Licensed under the MIT License. See the LICENSE. --> |
| 2 | +<Page |
| 3 | + x:Class="Files.App.Views.Settings.GitPage" |
| 4 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 5 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 6 | + xmlns:converters="using:CommunityToolkit.WinUI.UI.Converters" |
| 7 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 8 | + xmlns:helpers="using:Files.App.Helpers" |
| 9 | + xmlns:i="using:Microsoft.Xaml.Interactivity" |
| 10 | + xmlns:icore="using:Microsoft.Xaml.Interactions.Core" |
| 11 | + xmlns:local="using:Files.App.UserControls.Settings" |
| 12 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 13 | + xmlns:vm="using:Files.App.ViewModels.Settings" |
| 14 | + mc:Ignorable="d"> |
| 15 | + |
| 16 | + <Page.Resources> |
| 17 | + <ResourceDictionary> |
| 18 | + <ResourceDictionary.MergedDictionaries> |
| 19 | + <ResourceDictionary Source="/ResourceDictionaries/RightAlignedToggleSwitchStyle.xaml" /> |
| 20 | + </ResourceDictionary.MergedDictionaries> |
| 21 | + |
| 22 | + <converters:BoolNegationConverter x:Key="BoolNegationConverter" /> |
| 23 | + </ResourceDictionary> |
| 24 | + </Page.Resources> |
| 25 | + |
| 26 | + <Page.DataContext> |
| 27 | + <vm:GitViewModel x:Name="ViewModel" /> |
| 28 | + </Page.DataContext> |
| 29 | + |
| 30 | + <Grid> |
| 31 | + <StackPanel |
| 32 | + HorizontalAlignment="Stretch" |
| 33 | + VerticalAlignment="Stretch" |
| 34 | + Spacing="4"> |
| 35 | + <StackPanel.ChildrenTransitions> |
| 36 | + <TransitionCollection> |
| 37 | + <EntranceThemeTransition /> |
| 38 | + </TransitionCollection> |
| 39 | + </StackPanel.ChildrenTransitions> |
| 40 | + |
| 41 | + <!-- Title --> |
| 42 | + <TextBlock |
| 43 | + Padding="0,0,0,12" |
| 44 | + FontSize="24" |
| 45 | + FontWeight="Medium" |
| 46 | + Text="{helpers:ResourceString Name=Git}" /> |
| 47 | + |
| 48 | + <!-- Connect to GitHub --> |
| 49 | + <local:SettingsBlockControl |
| 50 | + x:Name="ConnectToGitHubSection" |
| 51 | + Title="{helpers:ResourceString Name=ConnectToGitHub}" |
| 52 | + HorizontalAlignment="Stretch" |
| 53 | + x:Load="{x:Bind ViewModel.IsLogoutEnabled, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}"> |
| 54 | + <local:SettingsBlockControl.Icon> |
| 55 | + <FontIcon Glyph="" /> |
| 56 | + </local:SettingsBlockControl.Icon> |
| 57 | + <Button Command="{x:Bind ViewModel.ConnectToGitHubCommand}" Content="{helpers:ResourceString Name=Login}" /> |
| 58 | + </local:SettingsBlockControl> |
| 59 | + |
| 60 | + <!-- Remove credentials --> |
| 61 | + <local:SettingsBlockControl |
| 62 | + x:Name="RemoveCredentialsSection" |
| 63 | + Title="{helpers:ResourceString Name=ConnectedToGitHub}" |
| 64 | + HorizontalAlignment="Stretch" |
| 65 | + x:Load="{x:Bind ViewModel.IsLogoutEnabled, Mode=OneWay}"> |
| 66 | + <local:SettingsBlockControl.Icon> |
| 67 | + <FontIcon Glyph="" /> |
| 68 | + </local:SettingsBlockControl.Icon> |
| 69 | + <Button Command="{x:Bind ViewModel.RemoveCredentialsCommand}" Content="{helpers:ResourceString Name=Logout}" /> |
| 70 | + </local:SettingsBlockControl> |
| 71 | + </StackPanel> |
| 72 | + </Grid> |
| 73 | +</Page> |
0 commit comments