Skip to content

Commit

Permalink
windows: check if OrientationSelector is found
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimecbernardo committed Jan 29, 2021
1 parent 4553ba5 commit 1fe403b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion windows/RCTPdf/RCTPdfControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,11 @@ namespace winrt::RCTPdf::implementation

void RCTPdfControl::SetOrientation(bool horizontal) {
m_horizontal = horizontal;
FindName(winrt::to_hstring("OrientationSelector")).try_as<StackPanel>().Orientation(m_horizontal ? Orientation::Horizontal : Orientation::Vertical);
StackPanel orientationSelector;
if (FindName(winrt::to_hstring("OrientationSelector")).try_as<StackPanel>(orientationSelector))
{
orientationSelector.Orientation(m_horizontal ? Orientation::Horizontal : Orientation::Vertical);
}
}

winrt::IAsyncAction RCTPdfControl::RenderVisiblePages(int page) {
Expand Down

0 comments on commit 1fe403b

Please sign in to comment.