随笔分类 -  windows phone ——— 问题集

摘要:一、获取某个元素相对另一元素的相对位置1、使用TransformToVisual获取某个元素相对于另外一个元素的偏移量。 例如:要获得rect相对于LayoutRoot的偏移量,就将LayoutRoot作为参数传进去,然后针对0,0这个点做一个transform:Point translate = this.rect.TransformToVisual(this.LayoutRoot).Transform(new Point(0, 0)); 之后就可以在e.ManipulationOrigin的基础上加上这个偏移量了:x += translate.X;y += translate.Y; 在更高 阅读全文
posted @ 2013-08-28 10:11 ╰→劉じ尛鶴 阅读(254) 评论(0) 推荐(0)
摘要:今天写代码的时候遇到一个问题,在wp8中执行下面的代码后,弹出对话框后,停滞一段时间程序退出。protected override void OnBackKeyPress(CancelEventArgs e) { try{ MessageBoxResult result = MessageBox.Show("确定要退出吗?", "提示", MessageBoxButton.OKCancel); if (result == MessageBoxResult.OK) { base.OnBackKeyPress(e); } els... 阅读全文
posted @ 2013-07-26 13:02 ╰→劉じ尛鶴 阅读(704) 评论(1) 推荐(0)