|
14 | 14 |
|
15 | 15 | <UserControl.Resources>
|
16 | 16 | <converters:NullToTrueConverter x:Key="NullToFalseConverter" Inverse="True" />
|
| 17 | + <converters:NullToVisibilityCollapsedConverter x:Key="NullToVisibilityCollapsedConverter" /> |
17 | 18 |
|
18 | 19 | <Style x:Key="Local.RadioButtonStyle" TargetType="RadioButton">
|
19 | 20 | <Setter Property="Foreground" Value="{ThemeResource TextFillColorSecondaryBrush}" />
|
|
100 | 101 | </Style>
|
101 | 102 | </UserControl.Resources>
|
102 | 103 |
|
103 |
| - <Grid Padding="8,0" ColumnSpacing="8"> |
| 104 | + <Grid Padding="8,0" ColumnSpacing="4"> |
104 | 105 | <Grid.ColumnDefinitions>
|
105 | 106 | <ColumnDefinition />
|
106 | 107 | <ColumnDefinition Width="Auto" />
|
| 108 | + <ColumnDefinition Width="Auto" /> |
107 | 109 | </Grid.ColumnDefinitions>
|
108 | 110 | <StackPanel
|
109 | 111 | Grid.Column="0"
|
|
201 | 203 | <TextBlock Text="{x:Bind DirectoryPropertiesViewModel.PullInfo, Mode=OneWay}" />
|
202 | 204 | </StackPanel>
|
203 | 205 | </Button>
|
| 206 | + </StackPanel> |
204 | 207 |
|
205 |
| - <Button |
206 |
| - x:Name="GitBranch" |
207 |
| - Height="24" |
208 |
| - Padding="8,0,8,0" |
209 |
| - Background="Transparent" |
210 |
| - BorderBrush="Transparent" |
211 |
| - ToolTipService.ToolTip="{helpers:ResourceString Name=ManageBranches}"> |
212 |
| - |
213 |
| - <Button.Content> |
214 |
| - <StackPanel Orientation="Horizontal" Spacing="8"> |
215 |
| - <usercontrols:OpacityIcon Style="{StaticResource ColorIconGitBranches}" /> |
216 |
| - |
217 |
| - <!-- Branch Name --> |
218 |
| - <TextBlock Text="{x:Bind DirectoryPropertiesViewModel.GitBranchDisplayName, Mode=OneWay}" /> |
219 |
| - </StackPanel> |
220 |
| - </Button.Content> |
| 208 | + <!-- Use visibility because it causes a crash to use a TwoWay x:Bind on an element that is inside an element with x:Load (#12589, #12599) --> |
| 209 | + <Button |
| 210 | + x:Name="GitBranch" |
| 211 | + Grid.Column="2" |
| 212 | + Height="24" |
| 213 | + Padding="8,0,8,0" |
| 214 | + Background="Transparent" |
| 215 | + BorderBrush="Transparent" |
| 216 | + ToolTipService.ToolTip="{helpers:ResourceString Name=ManageBranches}" |
| 217 | + Visibility="{x:Bind DirectoryPropertiesViewModel.GitBranchDisplayName, Mode=OneWay, Converter={StaticResource NullToVisibilityCollapsedConverter}}"> |
221 | 218 |
|
222 |
| - <Button.Flyout> |
223 |
| - <Flyout x:Name="BranchesFlyout" Opening="BranchesFlyout_Opening"> |
224 |
| - <Grid |
225 |
| - Width="300" |
226 |
| - Height="340" |
227 |
| - Margin="-16"> |
228 |
| - <Grid.RowDefinitions> |
229 |
| - <RowDefinition Height="Auto" /> |
230 |
| - <RowDefinition Height="*" /> |
231 |
| - </Grid.RowDefinitions> |
| 219 | + <Button.Content> |
| 220 | + <StackPanel Orientation="Horizontal" Spacing="8"> |
| 221 | + <usercontrols:OpacityIcon Style="{StaticResource ColorIconGitBranches}" /> |
232 | 222 |
|
233 |
| - <!-- Header --> |
234 |
| - <Grid |
235 |
| - Grid.Row="0" |
236 |
| - Padding="4,8,8,8" |
237 |
| - Background="{ThemeResource AcrylicBackgroundFillColorDefaultBrush}" |
238 |
| - BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" |
239 |
| - BorderThickness="0,0,0,1"> |
| 223 | + <!-- Branch Name --> |
| 224 | + <TextBlock Text="{x:Bind DirectoryPropertiesViewModel.GitBranchDisplayName, Mode=OneWay}" /> |
| 225 | + </StackPanel> |
| 226 | + </Button.Content> |
240 | 227 |
|
241 |
| - <!-- Locals and Remotes --> |
242 |
| - <StackPanel |
243 |
| - Grid.Row="1" |
244 |
| - HorizontalAlignment="Left" |
245 |
| - VerticalAlignment="Center" |
246 |
| - Orientation="Horizontal"> |
247 |
| - <RadioButton |
248 |
| - Content="{helpers:ResourceString Name=Locals}" |
249 |
| - IsChecked="{x:Bind DirectoryPropertiesViewModel.ShowLocals, Mode=TwoWay}" |
250 |
| - Style="{StaticResource Local.RadioButtonStyle}" /> |
251 |
| - <RadioButton Content="{helpers:ResourceString Name=Remotes}" Style="{StaticResource Local.RadioButtonStyle}" /> |
252 |
| - </StackPanel> |
| 228 | + <Button.Flyout> |
| 229 | + <Flyout x:Name="BranchesFlyout" Opening="BranchesFlyout_Opening"> |
| 230 | + <Grid |
| 231 | + Width="300" |
| 232 | + Height="340" |
| 233 | + Margin="-16"> |
| 234 | + <Grid.RowDefinitions> |
| 235 | + <RowDefinition Height="Auto" /> |
| 236 | + <RowDefinition Height="*" /> |
| 237 | + </Grid.RowDefinitions> |
253 | 238 |
|
254 |
| - <!-- New Branch Button --> |
255 |
| - <Button |
256 |
| - x:Name="NewBranchButton" |
257 |
| - Height="24" |
258 |
| - Padding="8,0" |
259 |
| - HorizontalAlignment="Right" |
260 |
| - Command="{x:Bind DirectoryPropertiesViewModel.NewBranchCommand, Mode=OneWay}" |
261 |
| - Content="{helpers:ResourceString Name=CreateBranch}" |
262 |
| - FontSize="12" |
263 |
| - ToolTipService.ToolTip="{helpers:ResourceString Name=CreateBranch}" /> |
264 |
| - </Grid> |
| 239 | + <!-- Header --> |
| 240 | + <Grid |
| 241 | + Grid.Row="0" |
| 242 | + Padding="4,8,8,8" |
| 243 | + Background="{ThemeResource AcrylicBackgroundFillColorDefaultBrush}" |
| 244 | + BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" |
| 245 | + BorderThickness="0,0,0,1"> |
265 | 246 |
|
266 |
| - <!-- Branches List --> |
267 |
| - <ListView |
268 |
| - x:Name="BranchesList" |
| 247 | + <!-- Locals and Remotes --> |
| 248 | + <StackPanel |
269 | 249 | Grid.Row="1"
|
270 |
| - Padding="4" |
271 |
| - Background="{ThemeResource CardBackgroundFillColorDefaultBrush}" |
272 |
| - IsItemClickEnabled="True" |
273 |
| - ItemClick="BranchesList_ItemClick" |
274 |
| - ItemsSource="{x:Bind DirectoryPropertiesViewModel.BranchesNames, Mode=OneWay}" |
275 |
| - SelectedIndex="{x:Bind DirectoryPropertiesViewModel.SelectedBranchIndex, Mode=TwoWay}" |
276 |
| - SelectionMode="Single" /> |
| 250 | + HorizontalAlignment="Left" |
| 251 | + VerticalAlignment="Center" |
| 252 | + Orientation="Horizontal"> |
| 253 | + <RadioButton |
| 254 | + Content="{helpers:ResourceString Name=Locals}" |
| 255 | + IsChecked="{x:Bind DirectoryPropertiesViewModel.ShowLocals, Mode=TwoWay}" |
| 256 | + Style="{StaticResource Local.RadioButtonStyle}" /> |
| 257 | + <RadioButton Content="{helpers:ResourceString Name=Remotes}" Style="{StaticResource Local.RadioButtonStyle}" /> |
| 258 | + </StackPanel> |
| 259 | + |
| 260 | + <!-- New Branch Button --> |
| 261 | + <Button |
| 262 | + x:Name="NewBranchButton" |
| 263 | + Height="24" |
| 264 | + Padding="8,0" |
| 265 | + HorizontalAlignment="Right" |
| 266 | + Command="{x:Bind DirectoryPropertiesViewModel.NewBranchCommand, Mode=OneWay}" |
| 267 | + Content="{helpers:ResourceString Name=CreateBranch}" |
| 268 | + FontSize="12" |
| 269 | + ToolTipService.ToolTip="{helpers:ResourceString Name=CreateBranch}" /> |
277 | 270 | </Grid>
|
278 |
| - </Flyout> |
279 |
| - </Button.Flyout> |
280 |
| - </Button> |
281 |
| - </StackPanel> |
| 271 | + |
| 272 | + <!-- Branches List --> |
| 273 | + <ListView |
| 274 | + x:Name="BranchesList" |
| 275 | + Grid.Row="1" |
| 276 | + Padding="4" |
| 277 | + Background="{ThemeResource CardBackgroundFillColorDefaultBrush}" |
| 278 | + IsItemClickEnabled="True" |
| 279 | + ItemClick="BranchesList_ItemClick" |
| 280 | + ItemsSource="{x:Bind DirectoryPropertiesViewModel.BranchesNames, Mode=OneWay}" |
| 281 | + SelectedIndex="{x:Bind DirectoryPropertiesViewModel.SelectedBranchIndex, Mode=TwoWay}" |
| 282 | + SelectionMode="Single" /> |
| 283 | + </Grid> |
| 284 | + </Flyout> |
| 285 | + </Button.Flyout> |
| 286 | + </Button> |
282 | 287 | </Grid>
|
283 | 288 | </UserControl>
|
0 commit comments