Skip to content

Commit 64ed89f

Browse files
committed
refactor: use Models.Null instead of null to remove warings in Rider
Signed-off-by: leo <longshuang@msn.cn>
1 parent 03e86f9 commit 64ed89f

2 files changed

Lines changed: 9 additions & 13 deletions

File tree

src/ViewModels/Histories.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ private void PostSelectedCommitsChanged()
437437
if (_selectedCommits.Count == 0)
438438
{
439439
_repo.SearchCommitContext.Selected = null;
440-
DetailContext = null;
440+
DetailContext = new Models.Null();
441441
}
442442
else if (_selectedCommits.Count == 1)
443443
{
@@ -473,7 +473,7 @@ private void PostSelectedCommitsChanged()
473473
private Models.CommitGraph _graph = null;
474474
private List<Models.Commit> _selectedCommits = [];
475475
private Models.Bisect _bisect = null;
476-
private object _detailContext = null;
476+
private object _detailContext = new Models.Null();
477477
private bool _ignoreSelectionChange = false;
478478

479479
private GridLength _leftArea = new GridLength(1, GridUnitType.Star);

src/Views/Histories.axaml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,11 @@
263263
Focusable="False"
264264
IsEnabled="{Binding #ThisControl.IsDetailsPanelExpanded, Mode=OneWay}"/>
265265

266-
<Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3">
267-
<ContentControl>
268-
<ContentControl.Content>
269-
<Binding Path="DetailContext">
270-
<Binding.TargetNullValue>
271-
<TabControl Padding="0,4">
266+
<Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" >
267+
<ContentControl Content="{Binding DetailContext, Mode=OneWay}">
268+
<ContentControl.DataTemplates>
269+
<DataTemplate DataType="m:Null">
270+
<TabControl Padding="0,4">
272271
<TabItem>
273272
<TabItem.Header>
274273
<Border Background="Transparent" PointerPressed="OnTabHeaderPointerPressed">
@@ -303,11 +302,8 @@
303302
</TabItem.Header>
304303
</TabItem>
305304
</TabControl>
306-
</Binding.TargetNullValue>
307-
</Binding>
308-
</ContentControl.Content>
309-
310-
<ContentControl.DataTemplates>
305+
</DataTemplate>
306+
311307
<DataTemplate DataType="vm:CommitDetail">
312308
<v:CommitDetail IsDetailsPanelExpanded="{Binding #ThisControl.IsDetailsPanelExpanded, Mode=OneWay}"/>
313309
</DataTemplate>

0 commit comments

Comments
 (0)