ฉันมีป๊อปอัปที่จะเติมเต็มทั้งหน้าเมื่อเปิด
<Grid x:Name="gridRoot" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Button Content="Open" HorizontalAlignment="Center" Click="{x:Bind viewModel.OpenPopup}" />
<Popup x:Name="popupCorrect" VerticalAlignment="Top" IsOpen="{Binding IsOpen}" IsLightDismissEnabled="False">
<Popup.ChildTransitions>
<TransitionCollection>
<PaneThemeTransition Edge="Left" />
</TransitionCollection>
</Popup.ChildTransitions>
<uc:MyPopup Width="{Binding ElementName=gridRoot, Path=ActualWidth}" Height="{Binding ElementName=gridRoot, Path=ActualHeight}"/>
</Popup>
</Grid>
ป๊อปอัปคือ UserControl
<Grid Background="Red">
<Button Content="Close" HorizontalAlignment="Center" Click="{x:Bind viewModel.ClosePopup}" />
</Grid>
- หน้า
- เมื่อป๊อปอัปปรากฏขึ้น
- ปิดป๊อปอัป ปรับขนาดหน้า จากนั้นเปิดป๊อปอัปอีกครั้ง โปรดสังเกตว่ามันไม่ตรงกับขนาดใหม่ของหน้าคอนเทนเนอร์ แม้ว่า
Width
และHeight
จะผูกไว้กับgridRoot
ก็ตาม ฉันต้องตั้งค่าWidth
และHeight
ใหม่สำหรับป๊อปอัปด้วยตนเองหรือไม่ เหตุใดฉันจึงไม่บรรลุเป้าหมายนี้ด้วยการผูกมัด ปัญหานี้ยังปรากฏบนมือถือในช่วง 'OrientationChanged'
ActualWidth
เป็นแหล่งที่มาของการเชื่อมโยงมักจะไม่ทำงานตามที่คาดไว้ ดูสิ่งนี้สำหรับข้อมูลเพิ่มเติม - person Decade Moon   schedule 19.03.2017Flyout
และตั้งค่าคุณสมบัติPlacementMode=Full
ได้หรือไม่ - person Lindsay   schedule 21.03.2017