随笔分类 - 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; 在更高
阅读全文
摘要:今天写代码的时候遇到一个问题,在wp8中执行下面的代码后,弹出对话框后,停滞一段时间程序退出。protected override void OnBackKeyPress(CancelEventArgs e) { try{ MessageBoxResult result = MessageBox.Show("确定要退出吗?", "提示", MessageBoxButton.OKCancel); if (result == MessageBoxResult.OK) { base.OnBackKeyPress(e); } els...
阅读全文

浙公网安备 33010602011771号