Skip to content

Commit 093c4b2

Browse files
committed
Removed unnecessary namespace reference and simplified OnOrientationChanged logic
1 parent c4e0ae3 commit 093c4b2

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

components/Segmented/src/Segmented/Segmented.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,10 @@ private void OnOrientationChanged()
160160
{
161161
for (int i = 0; i < Items.Count; i++)
162162
{
163-
var container = ContainerFromIndex(i) as SegmentedItem;
164-
if (container is null)
165-
continue;
166-
167-
container.UpdateOrientation(Orientation);
163+
if (ContainerFromIndex(i) is SegmentedItem item)
164+
{
165+
item.UpdateOrientation(Orientation);
166+
}
168167
}
169168
}
170169
}

components/Segmented/src/SegmentedItem/SegmentedItem.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using Windows.Media.Devices;
6-
75
namespace CommunityToolkit.WinUI.Controls;
86

97
/// <summary>

0 commit comments

Comments
 (0)