Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public enum WarningStatusCode {
InvalidColorFormat,
InvalidDimensionSpecified,
InvalidLanguage,
InvalidValue,
CustomWarning;

public final int swigValue() {
Expand Down
1 change: 1 addition & 0 deletions source/shared/cpp/ObjectModel/Enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ namespace AdaptiveSharedNamespace
InvalidColorFormat,
InvalidDimensionSpecified,
InvalidLanguage,
InvalidValue,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InvalidValue, [](start = 5, length = 16)

I think this means you need to re-SWIG :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

CustomWarning,
};
// No mapping to string needed
Expand Down
1 change: 1 addition & 0 deletions source/uwp/Renderer/idl/AdaptiveCards.Rendering.Uwp.idl
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ AdaptiveNamespaceStart
UnsupportedSchemaVersion,
UnsupportedMediaType,
InvalidMediaMix,
InvalidValue,
UnsupportedValue,
PerformingFallback,
CustomWarning,
Expand Down
32 changes: 25 additions & 7 deletions source/uwp/Renderer/lib/XamlBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2351,14 +2351,15 @@ namespace AdaptiveNamespace
EventRegistrationToken eventToken;
ComPtr<IInspectable> strongParentElement(parentElement);
THROW_IF_FAILED(brushAsImageBrush->add_ImageOpened(
Callback<IRoutedEventHandler>([ellipseAsUIElement, ellipsAsFrameworkElement, imageSourceAsBitmap, strongParentElement, isVisible](IInspectable* /*sender*/, IRoutedEventArgs * /*args*/) -> HRESULT {
Callback<IRoutedEventHandler>([ellipseAsUIElement, ellipsAsFrameworkElement, imageSourceAsBitmap, strongParentElement, isVisible](
IInspectable* /*sender*/, IRoutedEventArgs * /*args*/) -> HRESULT {
if (isVisible)
{
RETURN_IF_FAILED(ellipseAsUIElement->put_Visibility(Visibility::Visibility_Visible));
RETURN_IF_FAILED(SetAutoImageSize(ellipsAsFrameworkElement.Get(),
strongParentElement.Get(),
imageSourceAsBitmap.Get(),
isVisible));
strongParentElement.Get(),
imageSourceAsBitmap.Get(),
isVisible));
}
return S_OK;
})
Expand Down Expand Up @@ -3693,9 +3694,11 @@ namespace AdaptiveNamespace
HString hstringMin;
RETURN_IF_FAILED(adaptiveDateInput->get_Min(hstringMin.GetAddressOf()));
std::string min = HStringToUTF8(hstringMin.Get());
if (DateTimePreparser::TryParseSimpleDate(min, year, month, day))
DateTime minDate{};
boolean isMinValid{DateTimePreparser::TryParseSimpleDate(min, year, month, day)};
if (isMinValid)
{
DateTime minDate = GetDateTime(year, month, day);
minDate = GetDateTime(year, month, day);
RETURN_IF_FAILED(datePicker->put_MinDate(minDate));
}

Expand All @@ -3706,7 +3709,22 @@ namespace AdaptiveNamespace
if (DateTimePreparser::TryParseSimpleDate(max, year, month, day))
{
DateTime maxDate = GetDateTime(year, month, day);
RETURN_IF_FAILED(datePicker->put_MaxDate(maxDate));
if (isMinValid)
{
if (maxDate.UniversalTime > minDate.UniversalTime)
{
RETURN_IF_FAILED(datePicker->put_MaxDate(maxDate));
}
else
{
renderContext->AddWarning(ABI::AdaptiveNamespace::WarningStatusCode::InvalidValue,
HStringReference(L"Min value must be less than max in Input.Date").Get());
}
}
else
{
RETURN_IF_FAILED(datePicker->put_MaxDate(maxDate));
}
}

RETURN_IF_FAILED(
Expand Down