|
| 1 | +<ci:SettingsPageBase x:Class="StartUpAsAdmin.StartUpAsAdminSettingsPage" |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 5 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 6 | + xmlns:local="clr-namespace:StartUpAsAdmin" |
| 7 | + xmlns:ci="http://classisland.tech/schemas/xaml/core" |
| 8 | + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" |
| 9 | + mc:Ignorable="d" |
| 10 | + d:DesignHeight="450" d:DesignWidth="800" |
| 11 | + TextElement.Foreground="{DynamicResource MaterialDesignBody}" |
| 12 | + Background="{DynamicResource MaterialDesignPaper}" |
| 13 | + FontFamily="{StaticResource HarmonyOsSans}" |
| 14 | + TextElement.FontWeight="Regular" |
| 15 | + TextElement.FontSize="14" |
| 16 | + TextOptions.TextFormattingMode="Ideal" |
| 17 | + TextOptions.TextRenderingMode="Auto" |
| 18 | + Title="StartUpAsAdminSettingsPage" |
| 19 | + d:DataContext="{d:DesignInstance local:StartUpAsAdminSettingsPage}"> |
| 20 | + |
| 21 | + <ci:SettingsPageBase.Resources> |
| 22 | + <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> |
| 23 | + <ci:BooleanToVisibilityReConverter x:Key="BooleanToVisibilityReConverter" /> |
| 24 | + |
| 25 | + </ci:SettingsPageBase.Resources> |
| 26 | + <StackPanel MaxWidth="750" Margin="6"> |
| 27 | + <materialDesign:ColorZone Background="#22FF0000" |
| 28 | + Margin="0 0 0 6" |
| 29 | + Visibility="{Binding ViewModel.IsRunningAsAdmin, Converter={StaticResource BooleanToVisibilityReConverter}}"> |
| 30 | + <Grid TextElement.FontSize="14"> |
| 31 | + <DockPanel Margin="8 4 4 4"> |
| 32 | + <materialDesign:PackIcon Kind="Administrator" |
| 33 | + Margin="0 0 4 0" |
| 34 | + VerticalAlignment="Center"/> |
| 35 | + <TextBlock Text="你需要以管理员身份运行 ClassIsland 才能更改此处的设置。" |
| 36 | + TextWrapping="Wrap" |
| 37 | + VerticalAlignment="Center"/> |
| 38 | + <Button Style="{StaticResource MaterialDesignFlatButton}" |
| 39 | + Foreground="{DynamicResource MaterialDesignBody}" |
| 40 | + Margin="0 -4" |
| 41 | + Padding="8 0" |
| 42 | + materialDesign:RippleAssist.Feedback="{DynamicResource MaterialDesignBody}" |
| 43 | + HorizontalAlignment="Right" |
| 44 | + Click="ButtonRestartAsAdmin_OnClick"> |
| 45 | + <ci:IconText Kind="Restart" Text="以管理员身份重启"/> |
| 46 | + </Button> |
| 47 | + </DockPanel> |
| 48 | + </Grid> |
| 49 | + </materialDesign:ColorZone> |
| 50 | + |
| 51 | + <!-- 以管理员身份自启动 --> |
| 52 | + <materialDesign:Card Margin="0 0 0 6" |
| 53 | + IsEnabled="{Binding ViewModel.IsRunningAsAdmin}"> |
| 54 | + <Expander Background="Transparent" |
| 55 | + IsExpanded="True" |
| 56 | + TextBlock.Foreground="{DynamicResource MaterialDesignBody}"> |
| 57 | + <Expander.Header> |
| 58 | + <ci:SettingsControl IconGlyph="Administrator" |
| 59 | + Foreground="{DynamicResource MaterialDesignBody}" |
| 60 | + Header="以管理员身份自启动" |
| 61 | + Description="ClassIsland 将创建一个计划任务以实现以管理员身份自启动,并禁用应用内置的自启动方式。" |
| 62 | + HasSwitcher="False" |
| 63 | + Margin="-12 0" /> |
| 64 | + </Expander.Header> |
| 65 | + <StackPanel Margin="36 0 48 12"> |
| 66 | + <WrapPanel> |
| 67 | + <Button Click="ButtonCreateTask_OnClick" Style="{StaticResource MaterialDesignFlatButton}"> |
| 68 | + <ci:IconText Kind="Add" Text="创建/更新计划任务" /> |
| 69 | + </Button> |
| 70 | + <Button Click="ButtonRemoveTask_OnClick" Style="{StaticResource MaterialDesignFlatButton}" |
| 71 | + Margin="4 0 0 0"> |
| 72 | + <ci:IconText Kind="Remove" Text="删除计划任务" /> |
| 73 | + </Button> |
| 74 | + </WrapPanel> |
| 75 | + </StackPanel> |
| 76 | + </Expander> |
| 77 | + </materialDesign:Card> |
| 78 | + |
| 79 | + |
| 80 | + </StackPanel> |
| 81 | +</ci:SettingsPageBase> |
0 commit comments