protected virtual void CreateUIElements()
{
viewContainer = new ContentControl
{
HorizontalContentAlignment = HorizontalAlignment.Stretch,
VerticalContentAlignment = VerticalAlignment.Top,
};
maskingLayer = new Border
{
Child = viewContainer,
Background = new SolidColorBrush(Color.FromArgb(170, 0, 0, 0)),
VerticalAlignment = VerticalAlignment.Top,
HorizontalAlignment = HorizontalAlignment.Left
};
pageFreezingLayer = new Border
{
Background = new SolidColorBrush(Colors.Transparent),
Width = Application.Current.Host.Content.ActualWidth,
Height = Application.Current.Host.Content.ActualHeight
};
var panel = new Canvas();
panel.Children.Add(pageFreezingLayer);
panel.Children.Add(maskingLayer);
hostPopup = new Popup { Child = panel };
}