Skip to content

Commit

Permalink
chore: Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb committed May 28, 2021
1 parent 1011519 commit 39ec72b
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="5">
<DatePicker x:Name="min" Header="MinDate" Date="{Binding MinDate, ElementName=sut, Mode=TwoWay}" />
<DatePicker x:Name="min" Header="MaxDate" Date="{Binding MaxDate, ElementName=sut, Mode=TwoWay}" />
<DatePicker x:Name="max" Header="MaxDate" Date="{Binding MaxDate, ElementName=sut, Mode=TwoWay}" />
</StackPanel>

<StackPanel Orientation="Horizontal" Spacing="5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,11 @@ internal static void VerifyDateTimesAreEqual(DateTimeOffset date1, DateTimeOffse

internal static void CheckFocusedItem()
{
#if WINDOWS_UWP
var item = FocusManager.GetFocusedElement();
#else
var item = FocusManager.GetFocusedElement(TestServices.WindowHelper.WindowContent.XamlRoot);
#endif
TestServices.LOG_OUTPUT("Type of focused item is: %s", item.GetType().FullName);
var itemAsFE = (FrameworkElement)(item);
if (itemAsFE is { })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,4 @@ protected static int ARRAYSIZE(Array array)
protected static CalendarPanel CalendarPanel(object o) => o as CalendarPanel;
protected static CalendarViewDayItem CalendarViewDayItem(object o) => o as CalendarViewDayItem;
}

internal class XcbPurpleBrush : SolidColorBrush
{
internal XcbPurpleBrush()
{
Color = Colors.Purple;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ await RunOnUIThread(() =>
TestServices.Utilities.VerifyMockDCompOutput(MockDComp.SurfaceComparison.NoComparison);
}

#if !WINDOWS_UWP
[TestMethod]
public async Task DonotResizeCalendarView()
{
Expand Down Expand Up @@ -731,6 +732,7 @@ await RunOnUIThread(() =>
});
await TestServices.WindowHelper.WaitForIdle();
}
#endif

[TestMethod]
public async Task CanPresetDate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2980,8 +2980,8 @@ await RunOnUIThread(() =>
cv.MaxDate = ConvertToDateTime(1, 2014, 1, 1);
cv.SelectedDates.Add(ConvertToDateTime(1, 2014, 1, 1));

cv.CalendarItemBorderBrush = new XcbPurpleBrush();
cv.CalendarItemBackground = new XcbPurpleBrush();
cv.CalendarItemBorderBrush = new SolidColorBrush { Color = Colors.Purple };
cv.CalendarItemBackground = new SolidColorBrush { Color = Colors.Purple };
rootPanel.Children.Add(cv);
});

Expand Down
8 changes: 8 additions & 0 deletions src/Uno.UI.RuntimeTests/MUX/Helpers/FlyoutHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,21 @@ public static FrameworkElement GetOpenFlyoutPresenter()
public static void HideFlyout<T>(T flyoutControl)
where T : FlyoutBase
{
#if WINDOWS_UWP
flyoutControl.Hide();
#else
flyoutControl.Close();
#endif
}

internal static void OpenFlyout<T>(T flyoutControl, FrameworkElement target, FlyoutOpenMethod openMethod)
where T: FlyoutBase
{
#if WINDOWS_UWP
flyoutControl.ShowAt(target);
#else
flyoutControl.Open();
#endif
}

public static void ValidateOpenFlyoutOverlayBrush(string name)
Expand Down
2 changes: 1 addition & 1 deletion src/Uno.UI.RuntimeTests/MUX/Utilities/TestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public class App
public static UIElement TestContentRoot
{
get => TestServices.WindowHelper.WindowContent;
set => TestServices.WindowHelper.WindowContent = value;
set => TestServices.WindowHelper.WindowContent = value as UIElement;
}

public static Application Current => Application.Current;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,6 @@ internal int CalculateOffsetFromMinDate(DateTime date)
long diffInUTC = 0;
int diffInUnit = 0;

int maxEstimationRetryCount = 3; // the max times that we should estimate
int maxReboundCount = 3; // the max times that we should reduce the step when the estimation is over the boundary.
int minDistanceToEstimate = 3; // the min estimated distance that we should do estimation.

pCalendar.SetDateTime(estimatedDate);
Expand All @@ -363,6 +361,8 @@ internal int CalculateOffsetFromMinDate(DateTime date)
// we could need more times (uncommon scenario)
var averageTicksPerUnit = GetAverageTicksPerUnit();
#if DEBUG
int maxEstimationRetryCount = 3; // the max times that we should estimate
int maxReboundCount = 3; // the max times that we should reduce the step when the estimation is over the boundary.
int estimationCount = 0;
#endif
while (true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ private void SyncDate()
date = (DateTime)spDateReference;
// if Date property is being set, we should always display the Date when Calendar is open.
SetDisplayDate(date);
spSelectedDates.Append(date);
spSelectedDates.Add(date);
}
}
finally
Expand Down
22 changes: 22 additions & 0 deletions src/Uno.UI/UI/Xaml/Controls/Border/BorderLayerRenderer.net.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Linq;
using Windows.UI.Xaml.Media;
using Uno.Disposables;
using Uno.Extensions;
using Uno.UI.Xaml;

namespace Windows.UI.Xaml.Shapes
{
internal class BorderLayerRenderer
{
public void UpdateLayer(
UIElement element,
Brush background,
Thickness borderThickness,
Brush borderBrush,
CornerRadius cornerRadius,
object image)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public static void SetBackgroundBrush(FrameworkElement element, Brush brush)
break;
case XamlCompositionBrushBase unsupportedCompositionBrush:
var fallbackColor = unsupportedCompositionBrush.FallbackColorWithOpacity;
WindowManagerInterop.SetElementBackgroundColor(HtmlId, fallbackColor);
WindowManagerInterop.SetElementBackgroundColor(element.HtmlId, fallbackColor);
RecalculateBrushOnSizeChanged(element, false);
break;
default:
Expand Down
4 changes: 4 additions & 0 deletions src/Uno.UI/UI/Xaml/FrameworkElement.net.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ public partial class FrameworkElement : IEnumerable

internal UIElement VisualParent => ((IDependencyObjectStoreProvider)this).Store.Parent as UIElement;

internal bool ShouldInterceptInvalidate { get; set; }

internal void UpdateHitTest() { }

private protected virtual void OnPostLoading() { }

partial void OnLoadingPartial();
Expand Down

0 comments on commit 39ec72b

Please sign in to comment.