Skip to content

Commit c998f09

Browse files
committed
address comments
1 parent 70e9c98 commit c998f09

File tree

7 files changed

+18
-7
lines changed

7 files changed

+18
-7
lines changed

Microsoft.Toolkit.Parsers/Rss/RssHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,9 @@ public static string TimeZoneToOffset(string tz)
311311

312312
tz = tz.ToUpper().Trim();
313313

314-
if (timeZones.ContainsKey(tz))
314+
if (TimeZones.ContainsKey(tz))
315315
{
316-
return timeZones[tz].First();
316+
return TimeZones[tz].First();
317317
}
318318

319319
return null;
@@ -374,7 +374,7 @@ private static IEnumerable<string> GetImagesInHTMLString(string htmlString)
374374
/// <summary>
375375
/// Dictionary of timezones.
376376
/// </summary>
377-
private static readonly Dictionary<string, string[]> timeZones = new Dictionary<string, string[]>
377+
private static readonly Dictionary<string, string[]> TimeZones = new Dictionary<string, string[]>
378378
{
379379
{ "ACDT", new[] { "-1030", "Australian Central Daylight" } },
380380
{ "ACST", new[] { "-0930", "Australian Central Standard" } },

Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/DataGrid.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3207,7 +3207,7 @@ public void ScrollIntoView(object item, DataGridColumn column)
32073207
rowGroupInfo = RowGroupInfoFromCollectionViewGroup(collectionViewGroup);
32083208
if (rowGroupInfo == null)
32093209
{
3210-
Debug.Assert(false, "Expected non-null rowGroupInfo.");
3210+
Debug.Fail("Expected non-null rowGroupInfo.");
32113211
return;
32123212
}
32133213

Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/DataGridCellsPresenter.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ protected override Size MeasureOverride(Size availableSize)
274274
// then we will resize all the columns to fit the available space.
275275
if (this.OwningGrid.UsesStarSizing && !this.OwningGrid.AutoSizingColumns)
276276
{
277+
double adjustment = this.OwningGrid.CellsWidth - totalDisplayWidth;
278+
this.OwningGrid.AdjustColumnWidths(0, adjustment, false);
279+
277280
// Since we didn't know the final widths of the columns until we resized,
278281
// we waited until now to measure each cell
279282
double leftEdge = 0;

Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/DataGridColumnHeadersPresenter.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,9 @@ protected override Size MeasureOverride(Size availableSize)
359359
// then we will resize all the columns to fit the available space.
360360
if (this.OwningGrid.UsesStarSizing && !this.OwningGrid.AutoSizingColumns)
361361
{
362+
double adjustment = double.IsPositiveInfinity(availableSize.Width) ? this.OwningGrid.CellsWidth : availableSize.Width - totalDisplayWidth;
363+
this.OwningGrid.AdjustColumnWidths(0, adjustment, false);
364+
362365
// Since we didn't know the final widths of the columns until we resized,
363366
// we waited until now to measure each header
364367
double leftEdge = 0;

Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/DataGridDataConnection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ public bool GetPropertyIsReadOnly(string propertyName)
544544
// Either the property doesn't exist or it does exist but is read-only.
545545
return true;
546546
}
547+
547548
// Check if EditableAttribute is defined on the property and if it indicates uneditable
548549
var editableAttribute = propertyInfo.GetCustomAttributes().OfType<EditableAttribute>().FirstOrDefault();
549550
if (editableAttribute != null && !editableAttribute.AllowEdit)

Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.Events.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ private void ImageCropperThumb_KeyDown(object sender, KeyRoutedEventArgs e)
2323
if (e.Key == VirtualKey.Left)
2424
{
2525
diffPos.X--;
26-
if (Window.Current.CoreWindow.GetAsyncKeyState(VirtualKey.Up) == CoreVirtualKeyStates.Down)
26+
var upKeyState = Window.Current.CoreWindow.GetAsyncKeyState(VirtualKey.Up);
27+
var downKeyState = Window.Current.CoreWindow.GetAsyncKeyState(VirtualKey.Down);
28+
if (upKeyState == CoreVirtualKeyStates.Down)
2729
{
2830
diffPos.Y--;
2931
}
3032

31-
if (Window.Current.CoreWindow.GetAsyncKeyState(VirtualKey.Down) == CoreVirtualKeyStates.Down)
33+
if (downKeyState == CoreVirtualKeyStates.Down)
3234
{
3335
diffPos.Y++;
3436
}

Microsoft.Toolkit.Uwp/Extensions/StringExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ namespace Microsoft.Toolkit.Uwp.Extensions
1111
/// </summary>
1212
public static class StringExtensions
1313
{
14+
private static readonly ResourceLoader IndependentLoader = ResourceLoader.GetForViewIndependentUse();
15+
1416
/// <summary>
1517
/// Retrieves the provided resource for the current view context.
1618
/// </summary>
@@ -25,7 +27,7 @@ public static string GetViewLocalized(this string resourceKey)
2527
/// <param name="resourceKey">Resource key to retrieve.</param>
2628
/// <returns>string value for given resource or empty string if not found.</returns>
2729
public static string GetLocalized(this string resourceKey)
28-
=> ResourceLoader.GetForViewIndependentUse().GetString(resourceKey);
30+
=> IndependentLoader.GetString(resourceKey);
2931

3032
/// <summary>
3133
/// Retrieves the provided resource for the given key for use independent of the UI thread.

0 commit comments

Comments
 (0)