Skip to content

Commit 807d80d

Browse files
committed
code_style: remove xaml warnings
Signed-off-by: leo <[email protected]>
1 parent 749be04 commit 807d80d

File tree

8 files changed

+20
-27
lines changed

8 files changed

+20
-27
lines changed

src/Views/DropHead.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:m="using:SourceGit.Models"
65
xmlns:vm="using:SourceGit.ViewModels"
76
xmlns:c="using:SourceGit.Converters"
87
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"

src/Views/EditRepositoryNode.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:m="using:SourceGit.Models"
65
xmlns:c="using:SourceGit.Converters"
76
xmlns:vm="using:SourceGit.ViewModels"
87
xmlns:v="using:SourceGit.Views"

src/Views/Histories.axaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@
4949
ContextRequested="OnCommitListContextRequested"
5050
DoubleTapped="OnCommitListDoubleTapped"
5151
KeyDown="OnCommitListKeyDown">
52-
<DataGrid.Resources>
53-
<SolidColorBrush x:Key="DataGridGridLinesBrush" Color="{DynamicResource Color.Border0}" />
54-
</DataGrid.Resources>
55-
5652
<DataGrid.Styles>
5753
<Style Selector="DataGrid.static_scrollbar">
5854
<Style Selector="^ /template/ DataGridRowsPresenter#PART_RowsPresenter">
@@ -62,6 +58,9 @@
6258
<Style Selector="^ /template/ DataGridColumnHeadersPresenter#PART_ColumnHeadersPresenter">
6359
<Setter Property="Grid.Column" Value="0" />
6460
</Style>
61+
<Style Selector="^ /template/ Rectangle#PART_ColumnHeadersAndRowsSeparator">
62+
<Setter Property="Fill" Value="{DynamicResource Brush.Border0}"/>
63+
</Style>
6564
<Style Selector="^ /template/ ScrollBar">
6665
<Setter Property="Background" Value="{DynamicResource Brush.Contents}"/>
6766
</Style>

src/Views/InteractiveRebase.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<Border Grid.Row="2" Margin="8,0,8,8" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
7171
<Grid RowDefinitions="*,3,*">
7272
<v:InteractiveRebaseListBox Grid.Row="0"
73-
x:Name="IRItemListBox"
73+
x:Name="ItemListBox"
7474
Focusable="True"
7575
Background="{DynamicResource Brush.Contents}"
7676
ItemsSource="{Binding Items}"

src/Views/InteractiveRebase.axaml.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public InteractiveRebase()
172172
{
173173
CloseOnESC = true;
174174
InitializeComponent();
175-
IRItemListBox?.Focus();
175+
ItemListBox?.Focus();
176176
}
177177

178178
public void OpenCommitMessageEditor(ViewModels.InteractiveRebaseItem item)
@@ -206,7 +206,7 @@ private void OnRowsSelectionChanged(object _, SelectionChangedEventArgs e)
206206
if (isFirstTimeHere)
207207
_firstSelectionChangedHandled = true;
208208

209-
var selected = IRItemListBox.SelectedItems ?? new List<object>();
209+
var selected = ItemListBox.SelectedItems ?? new List<object>();
210210
var items = new List<ViewModels.InteractiveRebaseItem>();
211211
foreach (var item in selected)
212212
{
@@ -230,10 +230,10 @@ private async void OnRowPointerPressed(object sender, PointerPressedEventArgs e)
230230
return;
231231

232232
var builder = new StringBuilder();
233-
var selected = IRItemListBox.SelectedItems ?? new List<object>();
233+
var selected = ItemListBox.SelectedItems ?? new List<object>();
234234
if (selected.Count > 0 && !selected.Contains(item))
235235
{
236-
IRItemListBox.SelectedItem = item;
236+
ItemListBox.SelectedItem = item;
237237
builder.Append(item.Commit.SHA).Append(';');
238238
}
239239
else
@@ -252,7 +252,7 @@ private async void OnRowPointerPressed(object sender, PointerPressedEventArgs e)
252252

253253
private void OnRowDragOver(object sender, DragEventArgs e)
254254
{
255-
if (DataContext is not ViewModels.InteractiveRebase vm)
255+
if (DataContext is not ViewModels.InteractiveRebase)
256256
return;
257257

258258
if (e.DataTransfer.TryGetValue(_dndItemFormat) is not { Length: > 0 } hashes)
@@ -294,7 +294,7 @@ private void OnRowDrop(object sender, DragEventArgs e)
294294
if (hashes.IndexOf(dst.Commit.SHA, StringComparison.Ordinal) >= 0)
295295
return;
296296

297-
var selected = IRItemListBox.SelectedItems ?? new List<object>();
297+
var selected = ItemListBox.SelectedItems ?? new List<object>();
298298
if (selected.Count == 0)
299299
return;
300300

@@ -310,7 +310,7 @@ private void OnRowDrop(object sender, DragEventArgs e)
310310
}
311311

312312
vm.Move(commits, before ? idx : idx + 1);
313-
IRItemListBox.SelectedItems = commits;
313+
ItemListBox.SelectedItems = commits;
314314

315315
dst.DropDirectionIndicator = new Thickness(0);
316316
e.DragEffects = DragDropEffects.None;
@@ -322,7 +322,7 @@ private void OnMoveSelectedUp(object sender, RoutedEventArgs e)
322322
if (DataContext is not ViewModels.InteractiveRebase vm)
323323
return;
324324

325-
if (IRItemListBox.SelectedItems is not { Count: > 0 } selected)
325+
if (ItemListBox.SelectedItems is not { Count: > 0 } selected)
326326
return;
327327

328328
var hashes = new HashSet<string>();
@@ -347,7 +347,7 @@ private void OnMoveSelectedUp(object sender, RoutedEventArgs e)
347347
}
348348

349349
vm.Move(items, idx);
350-
IRItemListBox.SelectedItems = items;
350+
ItemListBox.SelectedItems = items;
351351
e.Handled = true;
352352
}
353353

@@ -356,7 +356,7 @@ private void OnMoveSelectedDown(object sender, RoutedEventArgs e)
356356
if (DataContext is not ViewModels.InteractiveRebase vm)
357357
return;
358358

359-
if (IRItemListBox.SelectedItems is not { Count: > 0 } selected)
359+
if (ItemListBox.SelectedItems is not { Count: > 0 } selected)
360360
return;
361361

362362
var hashes = new HashSet<string>();
@@ -381,7 +381,7 @@ private void OnMoveSelectedDown(object sender, RoutedEventArgs e)
381381
}
382382

383383
vm.Move(items, idx);
384-
IRItemListBox.SelectedItems = items;
384+
ItemListBox.SelectedItems = items;
385385
e.Handled = true;
386386
}
387387

@@ -461,7 +461,7 @@ private void CreateActionMenuItem(MenuFlyout flyout, ViewModels.InteractiveRebas
461461
menuItem.Icon = new Ellipse() { Width = 14, Height = 14, Fill = iconBrush };
462462
menuItem.Header = header;
463463
menuItem.Tag = hotkey;
464-
menuItem.Click += (_, __) => ChangeItemsAction(item, action);
464+
menuItem.Click += (_, _) => ChangeItemsAction(item, action);
465465

466466
flyout.Items.Add(menuItem);
467467
}
@@ -471,7 +471,7 @@ private void ChangeItemsAction(ViewModels.InteractiveRebaseItem target, Models.I
471471
if (DataContext is not ViewModels.InteractiveRebase vm)
472472
return;
473473

474-
var selected = IRItemListBox.SelectedItems ?? new List<object>();
474+
var selected = ItemListBox.SelectedItems ?? new List<object>();
475475
var items = new List<ViewModels.InteractiveRebaseItem>();
476476
foreach (var item in selected)
477477
{
@@ -491,7 +491,7 @@ private void ChangeItemsAction(ViewModels.InteractiveRebaseItem target, Models.I
491491
OpenCommitMessageEditor(items[0]);
492492
}
493493

494-
private bool _firstSelectionChangedHandled = false;
494+
private bool _firstSelectionChangedHandled;
495495
private readonly DataFormat<string> _dndItemFormat = DataFormat.CreateStringApplicationFormat("sourcegit-dnd-ir-item");
496496
}
497497
}

src/Views/PushToNewBranch.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
v:AutoFocusBehaviour.IsEnabled="True">
4848
<TextBox.InnerLeftContent>
4949
<Border Height="22" CornerRadius="10" Margin="4,0,0,0" Background="Green">
50-
<TextBlock Grid.Column="0" x:Name="TxtPrefix" Text="REMOTE" Foreground="White" Margin="8,0"/>
50+
<TextBlock x:Name="TxtPrefix" Text="REMOTE" Foreground="White" Margin="8,0"/>
5151
</Border>
5252
</TextBox.InnerLeftContent>
5353
</TextBox>

src/Views/RenameBranch.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
55
xmlns:vm="using:SourceGit.ViewModels"
66
xmlns:v="using:SourceGit.Views"
7-
xmlns:c="using:SourceGit.Converters"
87
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
98
x:Class="SourceGit.Views.RenameBranch"
109
x:DataType="vm:RenameBranch">

src/Views/RepositoryConfigure.axaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,10 +381,7 @@
381381
<TextBox Grid.Row="5" Margin="0,4,0,0" CornerRadius="3" Height="28" Text="{Binding URLTemplate, Mode=TwoWay}"/>
382382
<TextBlock Grid.Row="6" Margin="0,2,0,0" Text="{DynamicResource Text.Configure.IssueTracker.URLTemplate.Tip}" Foreground="{DynamicResource Brush.FG2}"/>
383383

384-
<CheckBox Grid.Row="7" Grid.Column="1"
385-
Margin="0,4,0,0"
386-
Content="{DynamicResource Text.Configure.IssueTracker.Share}"
387-
IsChecked="{Binding IsShared, Mode=TwoWay}"/>
384+
<CheckBox Grid.Row="7" Margin="0,4,0,0" Content="{DynamicResource Text.Configure.IssueTracker.Share}" IsChecked="{Binding IsShared, Mode=TwoWay}"/>
388385
</Grid>
389386
</DataTemplate>
390387
</ContentControl.DataTemplates>

0 commit comments

Comments
 (0)