-
Notifications
You must be signed in to change notification settings - Fork 690
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(droid): workaround for ItemsControl's ObjectDisposedException
- Loading branch information
Showing
4 changed files
with
113 additions
and
3 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Controls/When_XBind_TargetDisposed.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<Page x:Class="Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml.Controls.When_XBind_TargetDisposed" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml.Controls" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
|
||
<ItemsControl ItemsSource="{x:Bind ViewModel.Items}" /> | ||
</Page> |
35 changes: 35 additions & 0 deletions
35
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Controls/When_XBind_TargetDisposed.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Collections.ObjectModel; | ||
using System.ComponentModel; | ||
using System.Linq; | ||
using Microsoft.UI.Xaml.Controls; | ||
|
||
namespace Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml.Controls; | ||
|
||
public sealed partial class When_XBind_TargetDisposed : Page | ||
{ | ||
public When_XBind_TargetDisposed_VM ViewModel { get; } | ||
|
||
public When_XBind_TargetDisposed() | ||
{ | ||
ViewModel = new(); | ||
this.InitializeComponent(); | ||
} | ||
//~When_XBind_TargetDisposed() | ||
//{ | ||
Check warning on line 18 in src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Controls/When_XBind_TargetDisposed.xaml.cs Codacy Production / Codacy Static Code Analysissrc/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Controls/When_XBind_TargetDisposed.xaml.cs#L18
|
||
//} | ||
|
||
//protected override void Dispose(bool disposing) | ||
//{ | ||
// base.Dispose(disposing); | ||
//} | ||
} | ||
|
||
public class When_XBind_TargetDisposed_VM | ||
{ | ||
public ObservableCollection<string> Items { get; } | ||
|
||
public When_XBind_TargetDisposed_VM() | ||
{ | ||
Items = new(Enumerable.Range(0, 10).Select(x => $"Item {x}")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters