あなたは高さと幅のためのコンバーターを書くことによってそれをすることができます。
public class WidthConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
return Window.Current.Bounds.Width;
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
public class HeightConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
return Window.Current.Bounds.Height;
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
これをページリソースセクションに追加します-
<common:WidthConverter x:Key="wc" />
<common:HeightConverter x:Key="hc" />
ポップアップに使用してください-
<Popup x:Name="myPopup" >
<Grid Background="#FFE5E5E5" Height="{Binding Converter={StaticResource hc}}" Width="{Binding Converter={StaticResource wc}}" />
</Popup>