|
8 | 8 | xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
9 | 9 | xmlns:interop="using:FileLocksmith.Interop"
|
10 | 10 | xmlns:labs="using:CommunityToolkit.Labs.WinUI"
|
11 |
| - xmlns:local="using:PowerToys.FileLocksmithUI.Views" |
12 | 11 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
13 | 12 | xmlns:toolkitConverters="using:CommunityToolkit.WinUI.UI.Converters"
|
14 | 13 | mc:Ignorable="d">
|
|
41 | 40 | <RowDefinition Height="*" />
|
42 | 41 | </Grid.RowDefinitions>
|
43 | 42 |
|
44 |
| - <Grid Padding="18,0,18,4" VerticalAlignment="Bottom"> |
45 |
| - <!--<TextBlock Margin="0,2,0,0" Text="Current proccesses:" Style="{ThemeResource BodyStrongTextBlockStyle}"/>--> |
46 |
| - <Button Content="{x:Bind ViewModel.Paths, Converter={StaticResource fileListToDescriptionConverter}}" Click="ShowSelectedPathsButton_Click"> |
| 43 | + <Grid |
| 44 | + Padding="18,0,18,4" |
| 45 | + VerticalAlignment="Bottom"> |
| 46 | + <Button |
| 47 | + Click="ShowSelectedPathsButton_Click" |
| 48 | + Content="{x:Bind ViewModel.Paths, Converter={StaticResource fileListToDescriptionConverter}}"> |
47 | 49 | <Button.Template>
|
48 | 50 | <ControlTemplate TargetType="Button">
|
49 |
| - <TextBlock Margin="0,8,0,0" |
| 51 | + <TextBlock |
| 52 | + Margin="0,8,0,0" |
50 | 53 | HorizontalAlignment="Left"
|
51 | 54 | Style="{ThemeResource BodyStrongTextBlockStyle}"
|
52 |
| - Text="{TemplateBinding Content}" > |
53 |
| - </TextBlock> |
| 55 | + Text="{TemplateBinding Content}" /> |
54 | 56 | </ControlTemplate>
|
55 | 57 | </Button.Template>
|
56 | 58 | <ToolTipService.ToolTip>
|
57 |
| - <TextBlock x:Uid="PathsTooltipDescription" TextWrapping="WrapWholeWords"/> |
| 59 | + <TextBlock |
| 60 | + x:Uid="PathsTooltipDescription" |
| 61 | + TextWrapping="WrapWholeWords" /> |
58 | 62 | </ToolTipService.ToolTip>
|
59 | 63 | </Button>
|
60 |
| - |
| 64 | + |
61 | 65 | <StackPanel
|
62 | 66 | HorizontalAlignment="Right"
|
63 | 67 | VerticalAlignment="Bottom"
|
|
71 | 75 | <FontIcon
|
72 | 76 | FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
73 | 77 | FontSize="16"
|
74 |
| - Glyph="" /> |
| 78 | + Glyph="" /> |
75 | 79 | <ToolTipService.ToolTip>
|
76 | 80 | <TextBlock x:Uid="Reload" />
|
77 | 81 | </ToolTipService.ToolTip>
|
|
85 | 89 | <FontIcon
|
86 | 90 | FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
87 | 91 | FontSize="16"
|
88 |
| - Glyph="" /> |
| 92 | + Glyph="" /> |
89 | 93 | <ToolTipService.ToolTip>
|
90 | 94 | <TextBlock x:Uid="RestartAsAdmin" />
|
91 | 95 | </ToolTipService.ToolTip>
|
|
98 | 102 | <ListView
|
99 | 103 | x:Name="ProcessesListView"
|
100 | 104 | Grid.Row="1"
|
101 |
| - ItemsSource="{x:Bind ViewModel.Processes}" |
102 | 105 | IncrementalLoadingThreshold="10"
|
| 106 | + ItemsSource="{x:Bind ViewModel.Processes}" |
103 | 107 | SelectionMode="None">
|
104 | 108 | <ListView.ItemTemplate>
|
105 | 109 | <DataTemplate x:DataType="interop:ProcessResult">
|
106 |
| - <labs:SettingsExpander Margin="0,3,0,0"> |
107 |
| - <labs:SettingsExpander.Header> |
108 |
| - <!-- We can't use the HeaderIcon because it only support a BitmapIcon, which only supports UriSource - not a direct BitmapImage --> |
109 |
| - <StackPanel Orientation="Horizontal"> |
110 |
| - <Image |
111 |
| - Width="16" |
112 |
| - Height="16" |
113 |
| - Margin="2,0,24,0" |
114 |
| - Source="{x:Bind pid, Converter={StaticResource pidToIconConverter}}" /> |
115 |
| - <TextBlock IsTextSelectionEnabled="True" Text="{x:Bind name}" /> |
116 |
| - </StackPanel> |
117 |
| - </labs:SettingsExpander.Header> |
118 |
| - <labs:SettingsExpander.Content> |
| 110 | + <labs:SettingsExpander Margin="0,3,0,0"> |
| 111 | + <labs:SettingsExpander.Resources> |
| 112 | + <x:Double x:Key="SettingsCardWrapThreshold">0</x:Double> |
| 113 | + </labs:SettingsExpander.Resources> |
| 114 | + <labs:SettingsExpander.Header> |
| 115 | + <!-- We can't use the HeaderIcon because it only support a BitmapIcon, which only supports UriSource - not a direct BitmapImage --> |
119 | 116 | <StackPanel Orientation="Horizontal">
|
| 117 | + <Image |
| 118 | + Width="16" |
| 119 | + Height="16" |
| 120 | + Margin="2,0,24,0" |
| 121 | + Source="{x:Bind pid, Converter={StaticResource pidToIconConverter}}" /> |
| 122 | + <TextBlock |
| 123 | + IsTextSelectionEnabled="True" |
| 124 | + Text="{x:Bind name}" /> |
| 125 | + </StackPanel> |
| 126 | + </labs:SettingsExpander.Header> |
| 127 | + <labs:SettingsExpander.Content> |
| 128 | + <StackPanel |
| 129 | + Orientation="Horizontal" |
| 130 | + Spacing="8"> |
120 | 131 | <FontIcon
|
121 |
| - Margin="0,0,8,0" |
122 |
| - Glyph="" |
123 | 132 | Foreground="{ThemeResource InfoBarWarningSeverityIconBackground}"
|
124 |
| - Visibility="{x:Bind user, Mode=OneTime, Converter={StaticResource userToSystemWarningVisibilityConverter}}" |
125 |
| - > |
| 133 | + Glyph="" |
| 134 | + Visibility="{x:Bind user, Mode=OneTime, Converter={StaticResource userToSystemWarningVisibilityConverter}}"> |
126 | 135 | <ToolTipService.ToolTip>
|
127 |
| - <TextBlock TextWrapping="Wrap" x:Uid="ProcessIsSystemUserWarning" /> |
| 136 | + <TextBlock |
| 137 | + x:Uid="ProcessIsSystemUserWarning" |
| 138 | + TextWrapping="Wrap" /> |
128 | 139 | </ToolTipService.ToolTip>
|
129 | 140 | </FontIcon>
|
130 |
| - <Button Command="{Binding Path=DataContext.EndTaskCommand, ElementName=ProcessesListView}" CommandParameter="{Binding}"> |
131 |
| - <StackPanel Orientation="Horizontal" Spacing="6"> |
| 141 | + <Button |
| 142 | + MinWidth="132" |
| 143 | + Command="{Binding Path=DataContext.EndTaskCommand, ElementName=ProcessesListView}" |
| 144 | + CommandParameter="{Binding}"> |
| 145 | + <StackPanel |
| 146 | + Orientation="Horizontal" |
| 147 | + Spacing="6"> |
132 | 148 | <FontIcon
|
133 | 149 | FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
134 | 150 | FontSize="14"
|
135 | 151 | Glyph="" />
|
136 |
| - <TextBlock x:Uid="EndTask" /> |
| 152 | + <TextBlock |
| 153 | + x:Uid="EndTask" |
| 154 | + FontSize="14" /> |
137 | 155 | </StackPanel>
|
138 | 156 | </Button>
|
139 | 157 | </StackPanel>
|
140 |
| - </labs:SettingsExpander.Content> |
141 |
| - <labs:SettingsExpander.Items> |
142 |
| - <labs:SettingsCard x:Uid="ProcessID"> |
143 |
| - <TextBlock |
144 |
| - Foreground="{ThemeResource TextFillColorSecondaryBrush}" |
145 |
| - IsTextSelectionEnabled="True" |
146 |
| - Text="{x:Bind pid}" /> |
147 |
| - </labs:SettingsCard> |
148 |
| - <labs:SettingsCard x:Uid="User"> |
149 |
| - <TextBlock |
150 |
| - Foreground="{ThemeResource TextFillColorSecondaryBrush}" |
151 |
| - IsTextSelectionEnabled="True" |
152 |
| - Text="{x:Bind user}" /> |
153 |
| - </labs:SettingsCard> |
154 |
| - <labs:SettingsCard ContentAlignment="Vertical"> |
155 |
| - <labs:SettingsCard.Header> |
156 |
| - <TextBlock> |
157 |
| - <Run x:Uid="Files" /> |
158 |
| - <Run Text="(" /><Run Text="{x:Bind files, Converter={StaticResource fileCountConverter}}" /><Run Text=")" /> |
159 |
| - </TextBlock> |
160 |
| - </labs:SettingsCard.Header> |
161 |
| - <ListView |
162 |
| - Margin="-16,0,0,0" |
163 |
| - ItemsSource="{x:Bind files}" |
164 |
| - SelectionMode="None"> |
165 |
| - <ListView.ItemTemplate> |
166 |
| - <DataTemplate x:DataType="x:String"> |
167 |
| - <TextBlock |
168 |
| - FontSize="12" |
169 |
| - Foreground="{ThemeResource TextFillColorSecondaryBrush}" |
170 |
| - IsTextSelectionEnabled="True" |
171 |
| - Style="{StaticResource CaptionTextBlockStyle}" |
172 |
| - Text="{Binding}" |
173 |
| - TextTrimming="CharacterEllipsis" |
174 |
| - TextWrapping="NoWrap" |
175 |
| - ToolTipService.ToolTip="{Binding}" /> |
176 |
| - </DataTemplate> |
177 |
| - </ListView.ItemTemplate> |
178 |
| - </ListView> |
179 |
| - </labs:SettingsCard> |
180 |
| - </labs:SettingsExpander.Items> |
181 |
| - </labs:SettingsExpander> |
| 158 | + </labs:SettingsExpander.Content> |
| 159 | + <labs:SettingsExpander.Items> |
| 160 | + <labs:SettingsCard x:Uid="ProcessID"> |
| 161 | + <TextBlock |
| 162 | + Foreground="{ThemeResource TextFillColorSecondaryBrush}" |
| 163 | + IsTextSelectionEnabled="True" |
| 164 | + Text="{x:Bind pid}" /> |
| 165 | + </labs:SettingsCard> |
| 166 | + <labs:SettingsCard x:Uid="User"> |
| 167 | + <TextBlock |
| 168 | + Foreground="{ThemeResource TextFillColorSecondaryBrush}" |
| 169 | + IsTextSelectionEnabled="True" |
| 170 | + Text="{x:Bind user}" /> |
| 171 | + </labs:SettingsCard> |
| 172 | + <labs:SettingsCard ContentAlignment="Vertical"> |
| 173 | + <labs:SettingsCard.Header> |
| 174 | + <TextBlock> |
| 175 | + <Run x:Uid="Files" /> |
| 176 | + <Run Text="(" /><Run Text="{x:Bind files, Converter={StaticResource fileCountConverter}}" /><Run Text=")" /> |
| 177 | + </TextBlock> |
| 178 | + </labs:SettingsCard.Header> |
| 179 | + <ItemsRepeater |
| 180 | + Margin="-16,0,0,0" |
| 181 | + ItemsSource="{x:Bind files}"> |
| 182 | + <ItemsRepeater.ItemTemplate> |
| 183 | + <DataTemplate x:DataType="x:String"> |
| 184 | + <TextBlock |
| 185 | + Margin="16,0,0,4" |
| 186 | + FontSize="12" |
| 187 | + Foreground="{ThemeResource TextFillColorSecondaryBrush}" |
| 188 | + IsTextSelectionEnabled="True" |
| 189 | + Style="{StaticResource CaptionTextBlockStyle}" |
| 190 | + Text="{Binding}" |
| 191 | + TextTrimming="CharacterEllipsis" |
| 192 | + TextWrapping="NoWrap" |
| 193 | + ToolTipService.ToolTip="{Binding}" /> |
| 194 | + </DataTemplate> |
| 195 | + </ItemsRepeater.ItemTemplate> |
| 196 | + </ItemsRepeater> |
| 197 | + </labs:SettingsCard> |
| 198 | + </labs:SettingsExpander.Items> |
| 199 | + </labs:SettingsExpander> |
182 | 200 | </DataTemplate>
|
183 | 201 | </ListView.ItemTemplate>
|
184 | 202 | </ListView>
|
|
188 | 206 | Orientation="Vertical"
|
189 | 207 | Spacing="8"
|
190 | 208 | Visibility="{x:Bind ViewModel.Processes.Count, Mode=OneWay, Converter={StaticResource doubleToVisibilityConverter}}">
|
191 |
| - <Button HorizontalAlignment="Center" Command="{Binding LoadProcessesCommand}" > |
| 209 | + <Button |
| 210 | + HorizontalAlignment="Center" |
| 211 | + Command="{Binding LoadProcessesCommand}"> |
192 | 212 | <Button.Template>
|
193 | 213 | <ControlTemplate TargetType="Button">
|
194 |
| - <FontIcon FontSize="32" Glyph="" /> |
| 214 | + <FontIcon |
| 215 | + FontSize="32" |
| 216 | + Glyph="" /> |
195 | 217 | </ControlTemplate>
|
196 | 218 | </Button.Template>
|
197 | 219 | <ToolTipService.ToolTip>
|
198 | 220 | <TextBlock x:Uid="Reload" />
|
199 | 221 | </ToolTipService.ToolTip>
|
200 | 222 | </Button>
|
201 |
| - <TextBlock x:Uid="EmptyListDescription" Foreground="{ThemeResource TextFillColorSecondaryBrush}" /> |
| 223 | + <TextBlock |
| 224 | + x:Uid="EmptyListDescription" |
| 225 | + Foreground="{ThemeResource TextFillColorSecondaryBrush}" /> |
202 | 226 | </StackPanel>
|
203 | 227 | </Grid>
|
204 | 228 | <ProgressRing
|
|
208 | 232 | </Grid>
|
209 | 233 | <ContentDialog
|
210 | 234 | x:Name="SelectedFilesListDialog"
|
211 |
| - x:Uid="SelectedFilesListDialog" |
212 |
| - > |
213 |
| - <ScrollViewer HorizontalScrollBarVisibility="Auto" HorizontalScrollMode="Auto" VerticalScrollBarVisibility="Auto" VerticalScrollMode="Auto"> |
214 |
| - <TextBlock IsTextSelectionEnabled="True" Text="{x:Bind ViewModel.PathsToString, Mode=OneWay}"/> |
| 235 | + x:Uid="SelectedFilesListDialog"> |
| 236 | + <ScrollViewer |
| 237 | + HorizontalScrollBarVisibility="Auto" |
| 238 | + HorizontalScrollMode="Auto" |
| 239 | + VerticalScrollBarVisibility="Auto" |
| 240 | + VerticalScrollMode="Auto"> |
| 241 | + <TextBlock |
| 242 | + IsTextSelectionEnabled="True" |
| 243 | + Text="{x:Bind ViewModel.PathsToString, Mode=OneWay}" /> |
215 | 244 | </ScrollViewer>
|
216 | 245 | </ContentDialog>
|
217 | 246 | </Grid>
|
|
0 commit comments