Esempio n. 1
0
        public void RefreshVisuals()
        {
            var height = ((Shell)Window.Current.Content).ActualHeight;
            var width  = ((Shell)Window.Current.Content).ActualWidth;

            var   ttv          = ChatBubble.TransformToVisual(Window.Current.Content);
            Point screenCoords = ttv.TransformPoint(new Point(0, 0));

            var controlWidth  = ChatBubble.Width;
            var controlHeight = ChatBubble.Height;

            BgColor.Width  = width;
            BgColor.Height = height;

            var marg = BgColor.Margin;

            marg.Left   = screenCoords.X - width;
            marg.Top    = screenCoords.Y - height;
            marg.Right  = screenCoords.X - width - controlWidth;
            marg.Bottom = screenCoords.Y - height - controlHeight;

            BgColor.Margin = marg;
        }